Sign in to follow this  
darkpegasus

libraries for regular geometric objects

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


Link to post
Share on other sites
Quote:
Original post by darkpegasus
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?
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


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


Link to post
Share on other sites

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