# Thread: Do I really need to rotate?

1. ## Do I really need to rotate?

I think the most simple way of defining the 12 points of an icosahedron is to mark two points on each face of a 2x2x2 cube.
The points at +/- 0.618 on each face, perpendicular to the adjacent faces.
These 12 points are each joined to their 5 nearest neighbours, to give the wireframe of an icosahedron.
That will give me an icosahedron standing on one Edge.

How do I code to 'rotate'?? those points by atan(.618)
to bring one of those points to 0.0, 0.0, 1.175,
so that the 'icos' is now standing on a Point?

I would also want to 'rotatee' it so that it stands on a Face.

I can compute the relevant 12 points for each of these situations.
But to do the same for a 92 point 'geodome' would be rather difficult.

All the articles on 3D Rotations mention only one angle of rotation. Surely an angle on each axis needs considering.

JimJoyce 2. 12 points of an icosahedron
tetrahedron (four sides), cube (six sides), octahedron (eight sides), dodecahedron (12 sides), and icosahedron (20 sides) 3. I'm sorry. I forgot to mention that you need to join both ends of iach of the six lines to their four nearest neighbours. That will give you the 30 Edges of an icosahedron.
I'll amend my original question, if I can. 4. I've no idea whether this is a question for C-board, or a question for mathworld.

It seems to me your problem is one of 3D geometry, not programming.

I mean, once you understand the nature of rotation (outside of programming), then the number of points (as managed by a program) is irrelevant. 5. Thanks Salem.
Yes, I agree, but I'm afraid I won't understand a mathematician's answer!! 6. > All the articles on 3D Rotations mention only one angle of rotation.
I think that's to make it easy to understand.

Hoping bubba will step in here soon  7. You would rotate this just like any other primitive made out of vertices.

Simply construct a rotation transformation matrix for the object to rotate it on x,y and z respectively. For more information do a board search on the game programming forums about 3D rotations. You should find several posts where others and myself and posted complete matrices along with code required to rotate objects on any axis. 8. Thanks Bubba,
Trouble with Games programs is they're interested only in the perspective view of the player. They do not yield the native coordinates of the object.
Thanks all the same. 9. Jim, if you multiply the native coords of the object by the rotation matrix bubba described above you will get the transformed postiion of the coordinate. regardless of perspective (no pun intended)  10. regardless of perspective (no pun intended)
LOL. Trouble with Games programs is they're interested only in the perspective view of the player. They do not yield the native coordinates of the object.
Trouble with this statement is that it is completely inaccurate. Now stop arguing with me for a second and just listen to what I have to say.

The only matrix that has to do with projection is the projection matrix. If you multiply your local vertexes by the world transformation matrix which includes rotation, translation, scaling, shearing, etc. After this you have transformed your object from local/model space to world space. If you don't need to do any translation, scaling, shearing, etc., then just multiply by a rotation transformation matrix. This will rotate your object correctly - but you might run into gimbal lock in which case you need to perform an axis angle rotation. This transformation has nothing to do with projection/perspective. Perspective is gained by division by Z or in modern API's division by homogneous W. And yes this transformation will give you native coords....whatever those are.

Like I said, do a search on the game programming forums. The matrices are there somewhere. I'm not going to re-hash the info here because it is quite detailed. 11. Thanks, for your patience, and for trying,
but I'm no wiser.

Can I explain the problem better?

The centre of the icosahedron is 0.0, 0.0, 0.0
The radius to the 'Points' is 1.175.

One Edge of the icosahedron (on top of the cube,) is at
-.618, 0.0, +1.0 +.618, 0,0, +1.0.
After Rotation ( Translation? ) it should be at
-1.051, 0,0, +.526 0.0, 0.0, 1,175

Another Edge ( on the Right face of the cube?? )
is at +1.0, -.618, 0.0 +1.0, +.618, 0.0.
should move to +.851, -.618, +.526 _.851, +.618, +.526
(I think!)

A Third Edge (at the back of the cube,)
is at 0.0 +1.0, -.618 0.0, +1.0, +.618
It should move to -.325, +1.0, -.526 +.325, +1.0, +.526

(These figures are onlyapproximations. They may be completely wrong!! ) 12. Jim, try here.. it doesnt get much more detailed than this
http://mathworld.wolfram.com/RotationMatrix.html 13. Hi Perspective.
That site looks like its giving a great description.

However the maths, especially matrix-maths, frightens me rigid.
I was good at maths at school, but I left school at 16, some 60 years ago.
I've tried to improve at night school, but without much success.

I'm sure the solution is fairly simple. But damned if I can see it.

Thasnks,
Jim 14. Look up matrix concatenations/multiplications on the board search for the game programming forum - or anything related to matrix math, multiplication, 3D rotations, 2D rotations, world transformations, coordinate transformation, coordinate spaces, rotations about an arbitrary axis, etc, etc. Popular pages Recent additions 