1. Put your sun at the origin of world co-ordinates.
2. Put the planet at the origin. Make its axis of rotation the z axis.
3. Use a rotate transform to rotate it around its axis. (You've got this part.)
4. Translate the planet along the x axis, to its orbital radius.
5. Use a rotation around the z to position the planet in the x-y plane. (If the planet's orbit is not in the x-y plane, you will need more transformations.)

These techniques are covered in most introductory computer graphics texts--that's where to go to learn about this kind of problem; studying software docs won't get you very far.

Randolph

On 2010-02-14 19:22:50 -0800, Ernie Smethurst said:

I am trying to create a scene of a planetary system, using textures, lighting and primitives and am currently stuck with a problem that I cant quite work out, How to apply to rotations to a sphere. As it is a planet that I am trying to model it will rotate around its own axis and also rotate around a central sun.


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to