Results 1 to 2 of 2

Thread: Creating a moving car

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2011
    Posts
    3

    Creating a moving car

    Hey, im new here so sorry if i missed some old post or something, it tried looking it up but couldn't find anything that was of any help.

    Basically what i have a is a Box (just a test box, later will model the actual car) and i need to move it in the x,y plane.

    Basically what i did was:

    glRotatef(angle, axis_x, axis_y, axis_z);
    glTranslatef(_position[0],_position[1],0);
    micro_car_draw(_size);

    _position is a vector with the x,y values stored in the first and second position respectivelly and the car is suposed to move around the z axis, placed in the back of the Box (where the back wheels are going to be placed).

    The thing is, i can only either move the car along the world x axis while rotating on itself, or to move the car along its its own x axis but centered on the world origin instead.

    Any input will be apreciated, thanks.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Nov 2010
    Location
    Brazil, Rio de Janeiro
    Posts
    147

    Re: Creating a moving car

    It's all about how you are updating the axis and position values. Can you tell a little bit about how you're doing this?

Similar Threads

  1. Creating a ChaseCamera in OGL & Creating multiple cameras
    By Nuno Miguel Silva in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 08-03-2004, 12:45 AM
  2. Moving from 2D to 3D
    By grandall in forum OpenGL: macOS
    Replies: 0
    Last Post: 04-20-2004, 11:46 AM
  3. creating up/down/left/right keys by moving the camera
    By cg-hci_novice in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 11-09-2003, 10:00 PM
  4. moving around
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-22-2002, 07:33 AM
  5. Replies: 2
    Last Post: 11-27-2000, 07: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