Sign in to follow this  

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

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

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

This topic is 3313 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this