Jump to content
  • Advertisement
Sign in to follow this  
jdub

Calculating the number of unique vertices in a Serpinski triangle

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

I am in the process of creating a program to Create and render a Serpinski triangle given x iterations and the position of the three vertices of the triangle. The only problem I am having is figuring out how to calculate the amount unique vertices (not indices) in all the triangles that make up my Serpinski triangle. I know that the amount of indices is 3^iterations, so can I use this value to calculate the amount of vertices or is there another way to find it?

Share this post


Link to post
Share on other sites
Advertisement
Im pretty sure there is 3 per triangle. I dont notice any shared vertices but I could be really bad at conceptualizing/anaylizing.

Share this post


Link to post
Share on other sites
Well, because the triangles in a serpinski triangle share vertices with triangles that are adjacent to them, there are not 3 unique vertices for each triangle.

Share this post


Link to post
Share on other sites
I thought the triangles were made with vertices in the center of the triangles edges.

OH. I just realized that interior ones will be the same as some exteriors. Silly me!

Share this post


Link to post
Share on other sites
Off the top of my head: an (n) Serpinski triangle consists of three (n - 1) triangles. These three triangles share three vertices. So if an (n) triangle has f(n) unique vertices then an (n + 1) triangle should have (3 * f(n) - 3) unique vertices. The base triangle has three unique vertices. So you have the recurrance relation:

f(0) = 3
f(n) = 3 * f(n - 1) - 3

Share this post


Link to post
Share on other sites
Sign in to follow this  

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