• Advertisement

Archived

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

X meshes and Vertex Buffers

This topic is 5850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Could someone please tell me how (and possibly show in code) to get the vertices from an x mesh to allow manipulation to stuff like tex coords n stuff? Please... I''ve found the lockbuffer command or something, but I''m not sure on how to use it... Peace "What is darkness? It doesn''t exist where there''s light, and without light, it''s nothing..."

Share this post


Link to post
Share on other sites
Advertisement
unsigned short* VerPtr=NULL;

d3dDevice->LockVertexBuffer(flags,(BYTE**)&VerPtr)

(for flags look it up in the dx8 docs)

then VerPtr is a pointer to the vertex info so put them into your own var:

for (int x=0;x{
Poly[x].x=*VerPtr;
VerPtr++;
Poly[x].y=*VerPtr;
VerPtr++;
Poly[x].z=*VerPtr;
VerPtr++;
}
then unlock the vertex buffer.

You might just be able to memcpy the VerPtr to your own var but Im not sure.

Disclaimer: Im new to this so I might have gotten some of it wrong .

Hope ive helped.

Share this post


Link to post
Share on other sites
tnx man. I''ll try it out.

Peace

"What is darkness? It doesn''t exist where there''s light, and without light, it''s nothing..."

Share this post


Link to post
Share on other sites

  • Advertisement