Trig in 3D Rotations?

This is a discussion on Trig in 3D Rotations? within the Game Programming forums, part of the General Programming Boards category; Say I was going to rotate a 3D field...like a fighting arena, on its y axis. I know that the ...

  1. #1
    People Love Me
    Join Date
    Jan 2003
    Posts
    412

    Question Trig in 3D Rotations?

    Say I was going to rotate a 3D field...like a fighting arena, on its y axis. I know that the matrix for y rotations involves trigonomic functions...but for that to happen, you need a right triangle and a reference angle.

    My question is: if it's not clearly a triangle...and it's something like a character, or an entire level....how you do determine its reference angle, and the size and location of the triangle?

  2. #2
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    Actually you've got a little mis conception, and the source of the error is considering things on too grand a scheme. You see you are thinking you are rotating a triangle, or a character--rest assured you are not! Actually you are rotating the VERTICES of the triangle of the character. Rotations all come down to the rotation of a point in space (2d, in cartesian xy; 3d in cartesian xyz). Which also means infact, you do have the trig identies. Because of the way the points of space are depicted. X and Y (possibly Z). The x y and z components of a point are what form a right angle with the axis of reference and presumably the origin. I find it hard to explain with out a chalk board, or white board (which makes me kinda laugh when I think about how theres always a chalk/white board in math).

    Any ways the key is: You dont move/rotate/scale an object, you move/rotate/scale verticies that make up an object.

    HOpe that helps.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    Look into matrix math and matrix concatenation. You use 4x4 homogneous matrices to represent the rotations either in euler angles or in quaternion form. Impossible to explain it all here.

    Get a book.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using a matrix for rotations in 3D space
    By MK27 in forum C Programming
    Replies: 6
    Last Post: 02-25-2009, 08:02 PM
  2. A 3D Program for my 3D models...?
    By Rune Hunter in forum C++ Programming
    Replies: 26
    Last Post: 08-19-2004, 11:04 AM
  3. 3D starfield
    By VirtualAce in forum Game Programming
    Replies: 6
    Last Post: 06-26-2003, 01:40 PM
  4. 3D SDK for C++ programmers
    By chand in forum Game Programming
    Replies: 2
    Last Post: 05-20-2003, 08:38 AM
  5. 3d engines
    By Unregistered in forum Game Programming
    Replies: 7
    Last Post: 12-17-2001, 11:19 AM

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