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


Question about transformed vertices in directx8

Recommended Posts

Guest Anonymous Poster
I''ll go into a bit more detail...

I''ve drawn meshes using the DrawSubset command. I assume that once this is done a copy of the mesh is saved by the d3d device in the form of a vertex buffer (or something similar) and that the mesh is saved in it''s transformed state, is this right? If it is, and assuming the d3d device is still kept in the same state, how do I get the transformed mesh from the d3d device. I''ve tried a few things, but I''m really unsure what procedure to use. I''ve been trying to read out a vertex buffer from the device but don''t seem to be getting any results. If anyone knows what I should be doing a quick pointer would be greatly appreciated.

Share this post

Link to post
Share on other sites
Guest Anonymous Poster

ive never really used meshes before, but from a quick look this is how i would go about it:

-Get the vertex buffer pointer of the mesh,

-have another dynamic vert buffer for transformed verts. (in SYSMEM ''cos you''ll be doing alot of buffer reads)

-transform the mesh verts into the dynamic buffer.

-use the dynamic buffer to get the transformed verts and do collision.

-render the mesh.

now, rendering the mesh can either be done the usual way or rendered from the dynamic buffer, you should test it.

rendering from the mesh means the verts have to be transformed again, but this wouldn''t take that long. (esp w/ hardware)

rendering from the dynamic buffer means that you''re rendering from non optimal video memory.

there are also other possibilities, but it all depends on how many transformed faces you need etc.

have fun, hope this helps



Share this post

Link to post
Share on other sites