X meshes and Vertex Buffers

Started by
1 comment, last by doxxan 21 years, 12 months ago
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..."
"What is darkness? It doesn't exist where there's light, and without light, it's nothing..."
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.
Just my thoughts take them as you will. "People spend too much time thinking about the past, whatever else it is, its gone"-Mel Gibson, Man Without A Face
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..."
"What is darkness? It doesn't exist where there's light, and without light, it's nothing..."

This topic is closed to new replies.

Advertisement