Archived

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

GimpMaster

Primative Count

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