examples/3d/quaternionLatLongExample/README.md
--
This openFrameworks example utilizes quaternions to plot latitude and longitude onto a sphere.
In the code, pay attention to:
cities which is a Vector to hold City objects for the data to plot onto the sphere camera.begin() to enable the camera and allowing drawing in the center of the screenofRotateDeg(earthSpin, 0, 1, 0); to spin the earthearthMesh.draw() to draw the sphereglm::angleAxis(ofDegToRad(-alatitude), glm::vec3(1, 0, 0)); to create a quaternion which will perform a rotation of an angleglm::angleAxis(ofDegToRad(alongitude), glm::vec3(0, 1, 0)); to create a quaternion which will perform a rotation of an angleglm::angleAxis(ofDegToRad(90+earthSpin), glm::vec3(0, 1, 0)); to create another quaternion to ensure it spins on the y axisglm::vec3 worldPoint = spinQuat * longRot * latRot * center; to generate the point to map the city by multiplying all of the quaternions and then multipying the center vector to apply the rotation to the center vectorWhen launching this app, you should see