1
\$\begingroup\$

I've modeled an earth using an sphere. I can rotate it using glRotatef function around z axix by incrementing the angle. How do I simulate earth's movement which looks like 23.5Degree around Z axis? (see this image)

I guess I need to calculate the x,y,z verctors. Any Idea? I'm a complete newbie in computer graphics programming.

\$\endgroup\$
2
  • \$\begingroup\$ Research quaternions and axis-angle rotation. \$\endgroup\$
    – notlesh
    May 18 '12 at 6:58
  • \$\begingroup\$ you have to describe the earth's coordinate system after the 23.5 degree rotation and use axii from that coordinate system to feed the glRotatef \$\endgroup\$
    – dreta
    May 18 '12 at 7:30
1
\$\begingroup\$

After applying the glRotatef to get the z axis rotation for time-of-day, call glRotatef again to get the tilt on the y (or is it x?)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.