Jump to content
  • Advertisement
Sign in to follow this  
DauntlessCrowd

Moddeling a sphere from triangles

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

Hi, I'm quite new to 3D and I'm looking for some resources about modeling a sphere out of triangles. I hope you know what I mean, 'cause I can't explain it in a different way. I am using ActionScript (Flash) so please don't point me to specific libraries or pre-made classes 'cause I won't be able to use them. It's because I'm new to 3D that I don't know what to google for and I hope you guys can help. Greets, Dauntless

Share this post


Link to post
Share on other sites
Advertisement
It's commonly done by tessellating an octahedron or an icosahedron (8- or 20-sided polyhedra). These base shapes are convenient because they're symmetrical and made of equilateral triangles to begin with. The way this method works is you split each triangle into four by placing vertices at the midpoint of each edge. Then you move these vertices to the same distance from the origin (center of the sphere) as the original vertices, which is what makes it round. If you started with an octahedron you'll now have a 32-sided somewhat-round object. You can repeat the routine several times depending on how perfectly round you want it. Each iteration quadruples the number of triangles while making the shape a closer approximation of a sphere.

an old thread that illustrates how the triangle is split

Share this post


Link to post
Share on other sites
Just a side note, if you want each side to be sized exactly the same, the 20-sided icosahedron is the most faces you can have.


If you are willing to have differing sizes of triangles, you can just use sine and cosine to compute each vertex rather than going through all the subdivisions. Use m rows and n columns. Divide up your sphere along m latitude lines and n longitude lines.

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!