Triangle Fan+Vertex Buffer

Started by
0 comments, last by dyerseve 18 years, 8 months ago
I have a terrain implemented using Quadtree and an triangle fan hwoever it doesnt use vertex buffer but i want to use it. However i got confuse on how to use it, I found it confusing on how to end rendering a single quad(using trangle fan) and proceed to the next quad. got my point? for example i got 2 quads, each is renderd by a triangle fan how can i specify in the buffer the this vert is the end for the rendering for the first quad and proceed rendering the triangle fan for the 2nd quad?
Advertisement
whoa, triangle fans?

Use TRIANGLE STRIPS.

Create vertex buffers with the CreateVertexBuffer member of IDirect3DDevice9 and lock it with the Lock method, and copy your vertex data to the pointer it returns. Then unlock the buffer.

To draw, use DrawPrimitive instead of DrawPrimitiveUP and bind the buffer by calling the SetStreamSource method of IDirect3DDeivce9.

This topic is closed to new replies.

Advertisement