i have manage to lock the vertices fine but each x,y,z is random points of the mesh , what i want todo is lock the indexbuffer and retrieve the first 3 x,y,z that make up the first triangle of the mesh , does anyone know how ?
need help with locking index and vertex buffer D3D
Started by Anddos, Oct 11 2008 03:17 AM
5 replies to this topic
#1
Posted 11 October 2008 - 03:17 AM
#2
Posted 11 October 2008 - 03:35 AM
The index buffer is just an array of either 16-bit or 32-bit ints, and each int is an index into the vertex array. So to get the first triangle you'd just take the first three indices and look those up in the vertex array.
reedbeta.com - developer blog, OpenGL demos, and other projects
#3
Posted 11 October 2008 - 03:51 AM
how do you look up the vertex from the array , i dont know how to implement that in to code , thanks
#4
Posted 11 October 2008 - 03:55 AM
Maybe you should review this thread...you seemed to know how to do it when you posted there.
Unless I'm misunderstanding your question?
reedbeta.com - developer blog, OpenGL demos, and other projects
#5
Posted 11 October 2008 - 03:59 AM
never mind , i think my previous code is ok , can you just confirm?
#6
Posted 11 October 2008 - 06:24 AM
It looks good to me. But why don't you just test it on a known mesh, and see?
reedbeta.com - developer blog, OpenGL demos, and other projects
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












