Jump to content
  • Advertisement
Sign in to follow this  
godsenddeath

procedurally generating 3D shapes(DirectX/C++)

This topic is 3651 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'm wondering how i would go about procedurally generating a shape like a sphere. I circle, cube, these are pretty obvious, but a sphere, I don't know where to start.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by godsenddeath
i'm wondering how i would go about procedurally generating a shape like a sphere. I circle, cube, these are pretty obvious, but a sphere, I don't know where to start.




Ever seen a globe with its latitude/longitude markings ??? Its mostly trapazoids except near the poles where they converge to triangles.

Its basicly the same as the other shapes (points coordinates determined and line segments between them and facets created).
Its just the math deals with a circular pattern. You may need more facets than you'd like to make its curved surface as smooth as you need.

Share this post


Link to post
Share on other sites
i understand that a smoother rounded shape requires more samples, i was thinking of generating circles in a rotating fashion, but then the order would gets disorganized

Share this post


Link to post
Share on other sites
How about this, start with a tetrahedron about a center, with each point being a distance 1 from the center. For each face, subdivide it into 4 triangles by splitting each of the edges in half. Set the distance from the center to each of these points equal to 1 [normalize the deltas to the vertices]. Split all the triangles again into 4 more triangles each and set the distances from the center to the new vertices to one. Repeat over and over until you are happy with the sphere. Multiply by some value when you're done that you want to be the size of the sphere.

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!