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

Started by
3 comments, last by hughiecoles 15 years, 5 months ago
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.
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
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.
--------------------------------------------[size="1"]Ratings are Opinion, not Fact
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
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
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.
wow, thats a great idea, it'll probobly take me a while to map it out in my head, but i'm gonna give it a shot, thanks
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried

This topic is closed to new replies.

Advertisement