# Multiple DrawIndexedPrimitive calls for a single object?

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

## Recommended Posts

Is it possible to call multiple DrawIndexedPrimitive times for a single object in d3d? The reasoning for this is the following: I am going to create a sphere with manual placement of vertices, since i'm having any luck with my "creaing a sphere manually thread". For this i am tringle strips for all of the vertices around the ball except the top and bottom one. Im my model, the top and bottom vertices are the ones where the most points converge, and for this i need a triangle fan. some thing like this:
		HR(gd3dDevice->SetStreamSource(0, SphereVertexBuffer, 0, sizeof(VertexPos)));
HR(gd3dDevice->SetIndices(SphereIndexBuffer));
HR(gd3dDevice->DrawIndexedPrimitive( D3DPT_TRIANGLELIST,0,0,8,0,12))
HR(gd3dDevice->DrawIndexedPrimitive( D3DPT_TRIANGLELIST,0,0,something,0,something))


So, is this possible in d3d9?

##### Share on other sites
Yes, it's pretty normal to do that.

You'd have some vertex stream with a ton of info in it, you'll set that once. And then call indexed primitives multiple times to render the different desired pieces from within the stream.

I think that's what you're asking.

Also there's no problem with drawing the same piece over and over, maybe you change the model transform in between. That's a pretty standard optimization when drawing multiple instances of the same mesh.

1. 1
2. 2
Rutin
20
3. 3
A4L
15
4. 4
5. 5
khawk
14

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633738
• Total Posts
3013617
×