Jump to content
• Advertisement

# libraries for regular geometric objects

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

So I'd like to play around with some different geometric shapes like 3D hexagons, octagons, and icosahedrons but my math skills are somewhat lacking when trying to realize these in 3D. I'm sure I can't be the only person that's ever tried to make these, so there is there a library somewhere (preferably in C) that I could give parameters like side length and 'depth' that will return vertex points for things like vertices, normals, and texture coordinates?

#### Share this post

##### Share on other sites
Advertisement
Quote:
 Original post by darkpegasusSo I'd like to play around with some different geometric shapes like 3D hexagons, octagons, and icosahedrons but my math skills are somewhat lacking when trying to realize these in 3D. I'm sure I can't be the only person that's ever tried to make these, so there is there a library somewhere (preferably in C) that I could give parameters like side length and 'depth' that will return vertex points for things like vertices, normals, and texture coordinates?
I wrote a pretty comprehensive procedural mesh generator at one point, but unfortunately it's in C++ and the code is a big mess.

However, a lot of these shapes are pretty easy to generate procedurally, so I wouldn't shy away from doing it yourself if I were you.

A good place to start might be Dave Eberly's site geometrictools.com. Somewhere on his site is a PDF that includes vertex and connectivity data for various Platonic solids (tetrahedron, octahedron, dodecahedron, etc.), which would probably be a good starting point. Prisms and cylinders are pretty easy to make as well.

If you have particular questions about how to make these or other shapes, you can always ask in Math & Physics.

#### Share this post

##### Share on other sites
Thanks jyk, I'll check that site out.

I guess what gets me is that I could figure out triangles if I sat down and drew things out but my ability (read lack thereof) to visualize equations doesn't help when I try to create objects programatically.

#### Share this post

##### Share on other sites

• Advertisement

### Announcements

• Advertisement
• ### Popular Tags

• Advertisement

• 40
• 12
• 10
• 10
• 9
• ### Forum Statistics

• Total Topics
631368
• Total Posts
2999596
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!