Game Movement (Opengl) moving an object in this direction it is pointing
Posted on 2004-04-03
Ok im making a 3d spaceship game . I have come to the problem of how do i get my "spaceship" to move in the direction that it has been rotated to . I think I need to use trignometry or maybe matrices but im not sure how. Here are the variables that I am using (if you need to add any tell me) Im thinking at the moment to acheive this by changing the diffrent directional speed (xspeed , yspeed and zspeed) These speeds being added to the translation values these are what i need to figure out from the angles.
player.pxangle , player.pyangle , player.pzangle
[player.px = player.px + player.pxspeed ,
player.py = player.py + player.pyspeed ,
player.pz = player.pz + player.pyspeed ;]
if you do submit an answer I would be very thankful if you could include the actual code of how to do it (as well as any variables you might add)
Please help me (this is not homework because im still in y10 of secondary school :) :p)
PS. My understanding of matrices is very small so if you submit an answer to do with matrices and wot not it would be increadbly handy to have the actual code.
Thanks in advance Paladin
----------(Points will be boosted as soon as my refund goes through on another question)----------