Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Research quaternions and axis-angle rotation. – stephelton May 18 '12 at 6:58
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 – dreta May 18 '12 at 7:30
up vote 1 down vote accepted

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?)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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