#### Archived

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

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

## 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 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 on other sites
Thank you. I must investigate into DrawIndexPrimative. Is it any faster? or better than just DrawPrimative?

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

1. 1
Rutin
42
2. 2
3. 3
4. 4
5. 5

• 9
• 27
• 20
• 14
• 14
• ### Forum Statistics

• Total Topics
633385
• Total Posts
3011605
• ### Who's Online (See full list)

There are no registered users currently online

×