Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

GimpMaster

Primative Count

This topic is 5593 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

Just a quick question. I know how many vertices I have. I know how many triangles it would be. Do you put your triangle count in the DrawPrimitives() func? Or do you put how many strips? Whats a easy way to figure out how many triangle strips you would have with a certain amount of vertices? thanks

Share this post


Link to post
Share on other sites
Advertisement
If you''re talking about the PrimitiveCount parameter of DrawPrimitive() and DrawIndexedPrimitive():

if your primitive type is set as triangles (PrimitiveType parameter == D3DPT_TRIANGLELIST, D3DPT_TRIANGLESTRIP or D3DPT_TRIANGLEFAN), then yes the primitive count is the number of triangles to draw. For lines, it''s the number of lines to draw and for points, the number of points to draw.


quote:
Whats a easy way to figure out how many triangle strips you would have with a certain amount of vertices?


If they are not indexed [i.e. you aren''t using an index buffer and DrawIndexedPrimitive()], then if you were using triangle strips (D3DPT_TRIANGLESTRIP) the number of triangles is: numberOfVertices-2 .

If you are using indexed primitives the number of triangles is numberOfIndices-2



--
Simon O''Connor
ex -Creative Asylum
Programmer &
Microsoft MVP

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
DrawIndexedPrimitive is MUCH faster than DrawPrimitive. Read more into it, and you''ll see that this is always the case. =)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!