Jump to content
  • Advertisement
Sign in to follow this  
avion85

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.

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

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 this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!