# Calculating Triangles Per Vertices

This topic is 4911 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, In my current project I have a wireframe terrain rendered from a 256x256 height map. I am wondering how to go about finding the number of triangles that will be rendered given the 65,536 vertices that will be created from the height map. Thanks in advance.

##### Share on other sites
65,536 verts would be 256 square. I think terrain dimensions are usually preferred to be 2n+1, but in any case, I think the number of triangles for a given number of verts is:

numTris = (sqrt(numVerts)-1)2*2;

##### Share on other sites
Hey,

Thanks for the quick reply, that formula did it. However, one more question: why is it preferred to have terrain dimensions of 2^n+1?

##### Share on other sites
I don't do much with terrain, so don't take my word for this. But if the dimension in terms of vertices is 2^n+1, the dimension in terms of quads or pairs of triangles is an even power of two. This can be convenient (and in some cases necessary) for certain algorithms, such as level-of-detail.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 11
• 11
• 15
• 11
• 11
• ### Forum Statistics

• Total Topics
634149
• Total Posts
3015834
×