rotating a sphere around its own axis
Posted on 2007-09-30
I'm making a small 3d renderer for fun. I just added a sphere primitive. I applied a rotation transform to make it appear as if it's sitting at a 30 degree angle (like our planet, kind of). I'd like to just keep rotating it around its axis now every frame of animatin, but it appears that when I am applying my transform of 3 degrees around the y axis, it's doing it around the global origin - so it looks like the axis of the sphere is actually pointing in different directions while rotating.
I'm not sure what the best solution is - should I implement a rotateSelf() function which applies a transform about the object's current origin? Or is there some other way?