So I got a set of Vertices like this:
So here is my question:Code:struct Vertex{ float x,y,z; float nx,ny,nz; DWORD color; }; /* ... */ Vertex Object[]={ {-0.5f,0.5f,0.2f, // ...}; }; // Well, some Set of Vertices which // let the DrawPrimitive() function // render an Object (f.e. a Cube) /* When I want the Vertices to be rendered I first must create a VertexBuffer, and copy the Vertices to the VertexBuffer */ /* ... */ /* Once the Vertices are in the Vertex Buffer DrawPrimitive can render the Set Of Vertices */
When I want the Object to change its Position, will I have to lock() the Vertex Buffer again, copy the new - valid - Values of the Vertices to the Vertex Buffer - and then unlock() it?
I don't want the camera or the entire world matrix to move or rotate, but only the Set Of Vertices I copied to the VertexBuffer (this 'Set Of Vertices' could be a cube f.e.).
Is this an appropriate way to move Objects (which are stored in Vertex Buffers)? I am not sure, once I got 20 Objects in 20 different Vertex Buffers this means I must call lock() 20 times and also unlock() 20 times. Can D3D handle so many calls to the
pD3DVertexBuffer->Lock() functions during one frame (f.e. when the game is running at 40 fps)?



LinkBack URL
About LinkBacks



CornedBee