Results 1 to 2 of 2

Thread: 3D movement

  1. #1
    Dead_Meat
    Guest

    3D movement

    Hi,

    I'm trying to write a flight simulator but I'm having a problem with the code. Basically I'm taking the input from a joystick(hence only 2 axis for movement). I've been looking into quaternions but not 100% sure how to use them. Has anyone else got an algorithm, or see a major fault in my code.

    Thanks.

    Alasdair.

    Joy Z and Y are taken from a joystick
    RotateScene is a constant.
    ZAngle = (RotateScene * JoyZ)
    XAngle =(RotateScene * joyY);
    ....
    glPushMatrix();
    glRotated(XAngle,-1.0, 0.0,0.0);
    glRotated(ZAngle,0.0,0.0,1.0);
    glTranslated(XTrans, YTrans, ZTrans);
    glCallList(thePoints);
    glPopMatrix();

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Dec 2007
    Posts
    1,077

    Re: 3D movement

    The major fault is that you always rotate the world around the same axes, while the real local axes would be rotated as well. You can't represent a flight simulator movement with just two angles. Well, at least I found no way.

Similar Threads

  1. Movement
    By Katocan in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-19-2006, 01:59 PM
  2. Help in movement please
    By hellox in forum OpenGL: Linux
    Replies: 7
    Last Post: 04-29-2003, 04:27 AM
  3. Help in movement please
    By hellox in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-24-2003, 07:25 PM
  4. Movement
    By the_ether in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-07-2001, 03:59 PM
  5. Need a little help with 3D movement.
    By Ace_Man in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-30-2000, 04:46 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