Do I really need to rotate?

This is a discussion on Do I really need to rotate? within the Game Programming forums, part of the General Programming Boards category; I think the most simple way of defining the 12 points of an icosahedron is to mark two points on ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    6

    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
    Last edited by JimJoyce; 02-23-2005 at 06:32 AM.

  2. #2
    Registered User
    Join Date
    Mar 2004
    Posts
    494
    12 points of an icosahedron
    tetrahedron (four sides), cube (six sides), octahedron (eight sides), dodecahedron (12 sides), and icosahedron (20 sides)
    When no one helps you out. Call google();

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    6
    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.
    Thanks for your reply.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    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.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Feb 2005
    Posts
    6
    Thanks Salem.
    Yes, I agree, but I'm afraid I won't understand a mathematician's answer!!

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    > 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
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  7. #7
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    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. #8
    Registered User
    Join Date
    Feb 2005
    Posts
    6
    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. #9
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    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. #10
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    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.
    Last edited by VirtualAce; 02-23-2005 at 11:05 PM.

  11. #11
    Registered User
    Join Date
    Feb 2005
    Posts
    6
    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!! )
    Last edited by JimJoyce; 02-24-2005 at 09:29 AM.

  12. #12
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Jim, try here.. it doesnt get much more detailed than this
    http://mathworld.wolfram.com/RotationMatrix.html

  13. #13
    Registered User
    Join Date
    Feb 2005
    Posts
    6
    Hi Perspective.
    With a username like that, you should know all the answers!
    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. #14
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    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.
    Last edited by VirtualAce; 02-24-2005 at 03:30 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Camera rotate to function
    By VirtualAce in forum Game Programming
    Replies: 0
    Last Post: 11-15-2008, 11:22 AM
  2. How to rotate child objects in 3D
    By Arianiv in forum Game Programming
    Replies: 11
    Last Post: 04-03-2008, 05:09 AM
  3. how to rotate a scene in the correct way ?
    By jabka in forum Game Programming
    Replies: 2
    Last Post: 12-18-2007, 12:59 PM
  4. Utility to rotate text
    By Yasir_Malik in forum Linux Programming
    Replies: 2
    Last Post: 10-03-2004, 03:21 PM
  5. Silvercord: Rotate around an arbitrary axis
    By jdinger in forum Game Programming
    Replies: 10
    Last Post: 08-17-2003, 09:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21