Primative Count

Started by
2 comments, last by GimpMaster 20 years, 8 months ago
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
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

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Thank you. I must investigate into DrawIndexPrimative. Is it any faster? or better than just DrawPrimative?
DrawIndexedPrimitive is MUCH faster than DrawPrimitive. Read more into it, and you''ll see that this is always the case. =)

This topic is closed to new replies.

Advertisement