How to move objects in D3D

Started by
1 comment, last by piman 19 years, 11 months ago
Beginner help: I have an object (cube) created and rendered appropriately. I have its current position in space with x, y, z. I want to update its position to a new location (the cube moved). What is the best way to do this? The cube is made up of the VertexBuffer which has all the coordinates of the vertices, but I don''t know how to access those vertices to change them so that they will be rendered at the new location. Temporarily, I solved this by dropping the old cube and creating a new cube with the new position. Obviously this isn''t the best method as it has to clean up memory so much (every time the cube moves). There''s got to be a simpler way to update the vertices'' positions. Please help! Thanks! BTW, I''m writing in C#.
Advertisement
Search the SDK docs for "World Transformation".

---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

Thanks!
I used to do OpenGL a long time ago, now I''m starting to remember the matrix stuff.

This topic is closed to new replies.

Advertisement