|
 |
Hi Deaken,
first of all, good work so far.
>// Bugs: The math is slightly off on both the Dodecahedron and the
>// Icosahedron. I am still tracking this down, I'm afraid.
As i read this i thought my source could be helpful to you, feel free
to use it in your include-file if you like it.
Some explanations:
r is the radius of the outer bounding sphere of the icosahedron
h,a,b,c,d are some precalculated constants.
P1 - P12 are the vertexes of the Icosahedron
P1 is the top vertex
P2-P6 is the upper pentagon-shaped layer
P7 is the bottom vertex
P8-P12 is the lower pentagon-shaped layer
I hope you find it useful.
Greetings
Thies Heidecke
// Icosahedron - Vertex - Definitions :
#declare r = 1.0;
#declare sqrt5 = sqrt(5.0);
#declare h = 1.0/sqrt5;
#declare a = 2.0*sqrt((5.0+sqrt5)/40.0);
#declare b = 2.0*sqrt((5.0-sqrt5)/40.0);
#declare c = (5.0-sqrt5)/10.0;
#declare d = (5.0+sqrt5)/10.0;
#declare P0 = < 0.0, 0.0, 0.0>;
#declare P1 = < 0.0, r, 0.0>;
#declare P2 = < 0.0, h*r, 2.0*h*r>;
#declare P3 = < a*r, h*r, c*r>;
#declare P4 = < b*r, h*r, -d*r>;
#declare P5 = <-b*r, h*r, -d*r>;
#declare P6 = <-a*r, h*r, c*r>;
#declare P7 = < 0.0, -r, 0.0>;
#declare P8 = < b*r, -h*r, d*r>;
#declare P9 = < a*r, -h*r, -c*r>;
#declare P10 = < 0.0, -h*r, -2.0*h*r>;
#declare P11 = <-a*r, -h*r, -c*r>;
#declare P12 = <-b*r, -h*r, d*r>;
Post a reply to this message
|
 |