TFormVector basically takes the direction something is moving, and transforms these values into another entity's space. For instance, say you wanted to do do a linepick straight down from a mesh, taking into account it's rotation, then TFormVector would be useful.
Say,
This will do a linepick -5 on the Y axis. Linepick is a global command, it means it will use the World Axis's. So, if you rotated the mesh, and tried to do a linepick straight down from the meshes point of view, you would need to know the distances to send the line pick. So, the 0,-5,0 of the linepick, is a vector. So, you would need to transform that into the meshes axis.
So, from the docs:
So, you would need to do this
The last two parameters there are the SOURCE and DESTINATION entities. 0 means use the WORLD co-ords. So, you transforming from the WORLD to the MESHES co-ords. And your transforming (0,-5,0)
Now, once you have called that command, the results get put in the following...
Those would be your new vectors. So, your line pick would be:
Which would properly send a linepick straight down from the entities rotations. The actual use of LinePick here isn't too important, just the point of what TFormVector does. I hope that helps :o)
Say,
LinePick EntityX(mesh), EntityY(mesh), EntityZ(mesh), 0, -5, 0
This will do a linepick -5 on the Y axis. Linepick is a global command, it means it will use the World Axis's. So, if you rotated the mesh, and tried to do a linepick straight down from the meshes point of view, you would need to know the distances to send the line pick. So, the 0,-5,0 of the linepick, is a vector. So, you would need to transform that into the meshes axis.
So, from the docs:
TFormVector x#, y#, z#, source_entity, dest_entity Parameters x#, y#, z# = components of a vector in 3d space source_entity = handle of source entity, or 0 for 3d world dest_entity = handle of destination entity, or 0 for 3d world
So, you would need to do this
TFormVector 0,-5,0 , 0, mesh
The last two parameters there are the SOURCE and DESTINATION entities. 0 means use the WORLD co-ords. So, you transforming from the WORLD to the MESHES co-ords. And your transforming (0,-5,0)
Now, once you have called that command, the results get put in the following...
TFormedX() TFormedY() TFormedZ()
Those would be your new vectors. So, your line pick would be:
LinePick EntityX(mesh), EntityY(mesh), EntityZ(mesh), TFormedX(), TFormedY(), TFormedZ()
Which would properly send a linepick straight down from the entities rotations. The actual use of LinePick here isn't too important, just the point of what TFormVector does. I hope that helps :o)