Results 1 to 3 of 3

Thread: Translates and Rotations on Mac OS X vs. PC

  1. #1
    Guest

    Translates and Rotations on Mac OS X vs. PC

    Hello all.
    (I have posted this message in the mac forum as well. But i thought maby some one here know's a possible answer as well.)

    I am coding a OpenGL based 3d Engine for the mac in my spare time. I have run into some problem with translations and Rotations.
    I have for example some variables for the positions of a object let's say objposx objposy and objposz. To always move in the ahead direction i use following forumla:

    objposx += sin(direction * 3.14 / 180) * velocity;
    objposz += cos(direction * 3.14 / 180) * velocity;

    after that i tranlate:
    glTranslatef(objposx, objposy, objposz)
    and offcours rotate:
    glRotate(direction, 0.0f, 1.0f, 0.0f);

    i also set the gluLookAt to the coordinates to have a 3rd person view. which also works fine.
    now on my pc the object always stays in the middle of the screen (or center of rotation).
    on the mac the object alway translates by the factor of velocity from the center.

    What could be the reson for that ? are the Translation and rotation matrixes differen on the mac than on the pc ?

    Thanx for any suggestions.

    fagery

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Translates and Rotations on Mac OS X vs. PC

    No the openGL matrix functions are the same, it is most likly the math functions.

    I on windows sin/cos return double values, could be in the conversion between you sin/cos and objposx.

    I have had similar problem between diffrent compilers on windows and going between windows and linux.
    Sometimes code has to be adjusted to run correctly.

    Originally posted by fagery:
    Hello all.
    (I have posted this message in the mac forum as well. But i thought maby some one here know's a possible answer as well.)

    I am coding a OpenGL based 3d Engine for the mac in my spare time. I have run into some problem with translations and Rotations.
    I have for example some variables for the positions of a object let's say objposx objposy and objposz. To always move in the ahead direction i use following forumla:

    objposx += sin(direction * 3.14 / 180) * velocity;
    objposz += cos(direction * 3.14 / 180) * velocity;

    after that i tranlate:
    glTranslatef(objposx, objposy, objposz)
    and offcours rotate:
    glRotate(direction, 0.0f, 1.0f, 0.0f);

    i also set the gluLookAt to the coordinates to have a 3rd person view. which also works fine.
    now on my pc the object always stays in the middle of the screen (or center of rotation).
    on the mac the object alway translates by the factor of velocity from the center.

    What could be the reson for that ? are the Translation and rotation matrixes differen on the mac than on the pc ?

    Thanx for any suggestions.

    fagery

  3. #3
    Guest

    Re: Translates and Rotations on Mac OS X vs. PC

    Hi,
    Thanx for the help.
    The problem was effectivly just some bugs in my mac source. after fixing them it works great .

    Regards

    fagery

Similar Threads

  1. VP rotations
    By MojoMagic in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 02-25-2004, 07:12 PM
  2. Replies: 4
    Last Post: 05-20-2003, 03:19 PM
  3. Rotations
    By imported_Scott in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-09-2000, 12:59 PM
  4. Rotations again !
    By Eric in forum OpenGL: Advanced Coding
    Replies: 17
    Last Post: 03-02-2000, 12:21 AM
  5. Rotations
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-14-2000, 02:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean