Direction to vector?
Blitz3D Forums/Blitz3D Programming/Direction to vector?
| ||
Hi there, Please help me with the following question: I have the "roll, pitch and yaw" of objectA, and I want objectB to be translated in the direction, without changing orientation of objectB (translateEntity objectB,?,?,?). Is there a simple "direction" to vector (i guess) command? Best regards, Jesper Colding - Jørgensen |
| ||
Assuming Z+ is forward for objectA, and you want to move objectB along the direction vector objectA is pointing: TFormVector(0,0,1,objectA,0) vx#=TFormedX#() * distancetomove# vy#=TFormedY#() * distancetomove# vz#=TFormedZ#() * distancetomove# PositionEntity objectB,vx,vy,vz,True Multiply vx,vy,vz by the distance you want to move it. Someone correct me if I'm wrong :) Tom p.s what's the freakin tag for CODE? |
| ||
Hi Tom, Thanks maan, Got it to work! I'll continue with my platformgame then. :-) Best regards, Jesper |