Archived

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

cruZ

Moving Objects

Recommended Posts

Hi, Does anyone know how to move objects (enemies, birds...) around without locking the vertexbuffer and re-filling it every frame with the transformed model vertices? I don''t know how to do that because functions like SetTransform() D3DTS_VIEW or D3DTS_WORLD affect all objects in the scene. Is there any possibility to transform only certain vertices in a specific vertexbuffer without locking it every frame?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You use SetTransform multiple times. For each object you want to render you set the world-matrix and then render the object. Use the matrix manipulation functions in D3DX (or write your own) to create/change the matrix for each object.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I have one question: If I "move" objects changing the matrices I will not be able to detect collisions since positions of the vertices will be constant. What to do with it?

Share this post


Link to post
Share on other sites