I want to rotate a object around its own axes.
How to do the translate and rotate? In witch order?
I need a sample in Direct3D Retained.
I know that the object must be translated to the origin,
then rotated, and then must be moved back in position again.
Please help me!
Gandalf the White
Rotating a object in D3DRM
Word of advice (but no code, sorry)
when you create your objects, create them around the origin
example a cube with verts:
-1, -1, -1
1, -1, -1
1, 1, -1
-1, 1, -1
-1, -1, 1
1, -1, 1
1, 1, 1
-1, 1, 1
rotate, then translate
see, only two steps
your way, translate to origin, rotate, translate back
that is three steps
eats up additional cpu time
which equals less framerate
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
when you create your objects, create them around the origin
example a cube with verts:
-1, -1, -1
1, -1, -1
1, 1, -1
-1, 1, -1
-1, -1, 1
1, -1, 1
1, 1, 1
-1, 1, 1
rotate, then translate
see, only two steps
your way, translate to origin, rotate, translate back
that is three steps
eats up additional cpu time
which equals less framerate
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
I do that (creating the objects around origo), it´s getting
wrong anyway.
Thanks anyway.
Gandalf the White
wrong anyway.
Thanks anyway.
Gandalf the White
I think you need to explain what your problem is a bit more clearly. And getting sample code in D3D RM is not going to be easy since there aren''t a lot of people using it these day.
Rotations are always made around the origo, so if the object''s vertices aren''t centered around the origo they need to be translated there first.
- WitchLord
Rotations are always made around the origo, so if the object''s vertices aren''t centered around the origo they need to be translated there first.
- WitchLord
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement