Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.