# OpenGL ill regular polyhedrons in OpenGL

This topic is 3012 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 on other sites
OK thanks, just make them separate triangles!!! i should have thought of that o well i'm new to 3D programing.

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

1. 1
2. 2
Rutin
22
3. 3
4. 4
JoeJ
16
5. 5

• 14
• 29
• 9
• 11
• 11
• ### Forum Statistics

• Total Topics
631775
• Total Posts
3002278
×