Results 1 to 2 of 2

Thread: quake movement problems

  1. #1
    Senior Member Regular Contributor
    Join Date
    Apr 2000
    Location
    Portugal
    Posts
    237

    quake movement problems

    HelloI have a problem
    I' tryng to implement a movement similar to quake, half-life and family,
    but i need help.
    In this case, when the player press forward or back, i make a translation
    of 10 or -10 while the key is pressed, and it's all fine.
    When i press the left or right key to rotate, the camera also rotates
    in the direction that i wan't, but she rotates as if the camera was
    still in the origin(0,0,0).

    typedef struct{
    float x;
    float y;
    float z;
    float xrot;
    float yrot;
    float zrot;
    }camera;

    camera look;

    when i press forward, i add the look.x 10 units
    when i press back i subtract look.x 10 units
    when i press left, i add the angle +10;
    when i press right i subtract the angle -10;

    glLoadIdentity();
    glTranslatef(look.x,look.y,look.z);
    glRotatef(angle,0,look.yrot,0);


    If i make the translation first and then the rotation, the rotation
    works fine, but only if i still hadn't pressed the forward button
    If i press the forward button first, and then the left or right, the
    rotation is not correct, he rotates as if the rotation was being made
    at the origin.

    Please advice

    Thanks
    Bruno

  2. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2000
    Location
    Portugal
    Posts
    237

    Re: quake movement problems

    I fix it
    thanks anyway

Similar Threads

  1. Perspective problems, FoV and movement
    By Zawarudo in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-28-2015, 09:42 AM
  2. Problems with (newtonian) movement
    By Skalli in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-03-2013, 01:28 PM
  3. head follows mouse movement like quake?
    By boing in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-22-2002, 03:34 AM
  4. Problems with camera movement
    By J0ey4 in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 11-02-2000, 09:49 AM
  5. quake 3 problems
    By in forum OpenGL: User Software
    Replies: 0
    Last Post: 05-08-2000, 02:23 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