Sign in to follow this  
ishkabible

OpenGL ill regular polyhedrons in OpenGL

Recommended Posts

OK so i'm doing a school project and want to present information in a particular way and the idea i came up with was to make 3D shape that would be within another 3D shape that would be the same shape but regular. each vertices would be a different statistic or point relevant in numbers. so say that vertices X corresponds with the percentage 50% then that vertices would only extend out toward the regular polyhedron half the way. i am going to accomplish this with Spherical coordinate so in this case r would be mulityplyed by 0.5. now the problem is i don't know how to make a shape thats not a GLUT shape yet i am going to be using things like dodecahedron and icosahedron and truncated icosahedron and (here come's the weird one) icosadodecahedron. i have the vertices that i believe should be used. here are some of them: note: x=(1+sqrt(5))/2 (0,+-1,+-x) (+-1,+-x,0) (+-x,0,+-1) and that is for an icosahedron if i am correct (found on Wikipedia and one other math site) so i want to know how to use this list of vertices (obviously i would write out the whole thing when coding, no shorthand) to make and icosahedron.

Share this post


Link to post
Share on other sites
Once you have a list of vertices what you need to do is to define the triangles that are composed from those vertices. Once you define your triangles you should be able to draw them any number of ways.

Look up any "first triangle" opengl tutorial to understand how to draw triangles to the screen.

Share this post


Link to post
Share on other sites
If some of your shapes involve flat faces that have more than three sides, you can use other primitives as well to make your life a little bit easier (GL_QUAD, GL_TRIANGLE_FAN, etc).

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