Anyone know how to get an object spinning on its own axis?
-
Hi all, I have a straight forward problem for those who know anything about Direct3D and matrices. I have managed to setup the geometry pipeline and get my object (a cube) rotating around the world spaces origin (i.e. you can see it spinning around the camera view - it disappears out the left side of the screen and re-enters at the right, and keeps going). However, I would like it to spin on its own axis in front of the camera (not around the damn thing). I have setup the rotation (x,y and/or z), translation and scale matrix functions, but am unsure as to which ones I use? At the moment I am modifying the world_matrix because I want the actual object to spin and not the camera. My world matrix is the Identity matrix and in the UpdateFrame() function adds the rotationx evaluation before set the transform to that matrix and rendering it. Does this need to get set every frame update? or should I only set it once but do something else to the matrix to get it going? Urgent responses would be extremely appreciated (obviously). Cheers all, Alan. "When I left you I was but the learner, now I am the master" - Darth Vader