Public Group

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

## 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 on other sites
Quote:
 Original post by godsenddeathi'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 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 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 on other sites
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

1. 1
Rutin
35
2. 2
3. 3
4. 4
5. 5

• 12
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633340
• Total Posts
3011421
• ### Who's Online (See full list)

There are no registered users currently online

×