Skip to main content
GameDev.net gamedev.net
🔒 Locked

rotating meshes

Started by BluePhoenix Aug 10, 2003 at 3:45 AM 1 replies 400+ views
Original Post
BluePhoenix
BluePhoenix
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.
---today is the first day of the rest of my life
RapidStunna
RapidStunna
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
drdlord
drdlord
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.