easy z axis?
Blitz3D Forums/Blitz3D Programming/easy z axis?
| ||
I'm writiing a code segment where I need the direction that the mesh's Z axis is pointed. is there an easier way to do it than this? PositionX = entityX(mesh) PositionY = entityY(mesh) PositionZ = entityZ(mesh) moveentity mesh, 0, 0, 1 ;components of z axis vector VectorX = entityX(mesh) - PositionX VectorY = entityY(mesh) - PositionY VectorZ = entityZ(mesh) - PositionZ positionentity mesh, PositionX, PositionY, PositionZ, true -this would work(or at least something like it), but it buugs me. Is there a way to do it without moving the mesh? |
| ||
TForm-commands are good for this TFormPoint 0, 0, 1, mesh, 0 VectorX# = TFormedX() VectorY#... If you want to know the heading of an entity, try something like TFormVector 0, 0, 1, mesh, 0 MeshYaw = VectorYaw(TFormedX(), TFormedY(), TFormedZ()) MeshPitch = VectorPitch(TFormedX(), TFormedY(), TFormedZ()) |
| ||
I've never used those commands before, but they look promising. I will investigate these TForm commands. Thanks a bundle. |
| ||
I've never used those commands before, but they look promising. I will investigate these TForm commands. Thanks a bundle. |
| ||
wth? ok never mind the second post. |