Car velocity

Blitz3D Forums/Blitz3D Beginners Area/Car velocity

RifRaf(Posted 2004) [#1]
Can anyone help \me with this. I have 3 values.
Car_velocity_X#
Car_Velocity_Y#
Car_Velocity_Z#

I want to move my car in the direction its facing with

TranslateEntity Car_Velocity_X,Car_Velocity_Y,Car_Velocity_Z

When the car is turned a certain direction, and the accelerator is hit. How do i caclulate the X and z velocity so that the car will move in the proper direction?

Thanks.


Jeppe Nielsen(Posted 2004) [#2]
Use tformvector:


acceleration#=1

TformVector 0,0,acceleration#,carentity,0

Car_velocity_X#=Car_velocity_X#+TFormedX() 
Car_Velocity_Y#=Car_velocity_Y#+TFormedY() 
Car_Velocity_Z#=Car_velocity_Z#+TFormedZ() 



Also this might be of interest:
http://www.blitzbasic.co.nz/codearcs/codearcs.php?code=778


RifRaf(Posted 2004) [#3]
excellent, worked perfectly, thanks