Archived

This topic is now archived and is closed to further replies.

BluePhoenix

rotating meshes

Recommended Posts

BluePhoenix    122
I''m trying to modify the 5th Tutorial that comes with the DXSDK to rotate the mesh around its own axis rather than performing a world rotation. In the past I just had a vertex buffer and modified each vertex by substracting the old location vector of its object, rotating it by multiplying it with an rotation matrix build dynamically from the x,y,z axises of its object, computing the new location with the old location and a "direction" vector and translating the vertex back by adding the new location to it. However I can''t access the individual vertexes of the mesh and a search in the forums gave me a post that said meshes don''t really exist and now I''m quite confused.

Share this post


Link to post
Share on other sites
RapidStunna    122
Yes, meshes exist .

As a note, you should never update those vertices manually if you''re going to do simple translations, rotations, or scalings. You''ll have to look into transformation matrices - especially the world matrix for your purposes.

Basically, you create a matrix and with the help of D3DX, you can apply transformations on your mesh AS A WHOLE with ease. What happens is when your vertices get send down the Direct3D pipeline, the first step is transformation and lighting. It takes each one of the vertices you send down and applies the matrices to them.

---
Brent Gunning | My Site

Share this post


Link to post
Share on other sites
drdlord    122
you should be using the world transform for that, sounds to me like you don''t understand the point of the world transform, it''s a transformation on the object to place it in the world, not a transformation of the screen to show the world, generaly each object you render has it''s own world transform.

Share this post


Link to post
Share on other sites