movment

I'm making a car game in direct 3d. The game will be a bird eyes view game like Grand Theft Auto. What i need is some code for the movement of the car.

The car rotates when left or right is pressed on the keyboard. And accelerates when up is pressed and decaccelerates when down is pressed. So if i press the right button the cars moves to the right and if i it 45degs to the right and press up it will move right and if i press down it will move left.

Can some help me out on the code. I am very stuck :-(

P.S There doesn't even have to be any code just tell me how to do it in english.

P.P.S I also posted this on the other forums so ppl will read it. hope it isn't a problem.

Comments

  • take the forward facing vector ( z vector usualy ) from the cars rotation matrix. Normalise it. Multiply it by the speed you want the car to move. Then add it onto the cars co-ordinates. This will move the car in the direction its facing.

  • : I'm making a car game in direct 3d. The game will be a bird eyes view game like Grand Theft Auto. What i need is some code for the movement of the car.
    :
    : The car rotates when left or right is pressed on the keyboard. And accelerates when up is pressed and decaccelerates when down is pressed. So if i press the right button the cars moves to the right and if i it 45degs to the right and press up it will move right and if i press down it will move left.
    :
    : Can some help me out on the code. I am very stuck :-(
    :
    : P.S There doesn't even have to be any code just tell me how to do it in english.
    :
    : P.P.S I also posted this on the other forums so ppl will read it. hope it isn't a problem.
    :


    I'm just wondering how you make that happy face show up as a happy face. Whenever I try that it doesn't work, it just shows up as letters and symbols. Sorry for bugging you with this but I just wanted to know. Thanks alot.

    --Ben


  • Wudan how do I get the forward facing vector from the rotation matrix.

    PlanetBen I do my smiley faces by putting the following ": - )" but without the spaces.:-)


  • Wudan how do I get the forward facing vector from the rotation matrix.

    PlanetBen I do my smiley faces by putting the following ": - )" but without the spaces.:-)

  • A rotation matirx (3x3)is in effect, 3 vectors, facing up(y), right(x) and forward(z). Usualy the bottom row is the z.

  • :
    : Wudan how do I get the forward facing vector from the rotation matrix.
    :
    : PlanetBen I do my smiley faces by putting the following ": - )" but without the spaces.:-)
    :

    Thanks

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories