How to move objects in D3D
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#.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement