Vectors
Blitz3D Forums/Blitz3D Programming/Vectors
| ||
I have a bit of a problem and was wondering if the Blitz Community can help out once again. Currently i am trying to use align to vector to get an object to point at another object.... and things are not going so well. let me set the stage here. We have obj_A and obj_B Obj_A uses the following code to point at B: <CODE> AlignToVector OBJ_A,EntityX(OBJ_A,1),EntityY(OBJ_A,1),EntityZ(OBJ_A,1),1,1 </CODE> the problem with using this method is that align to vector assumes the vector it is being fed is actually relative to OBJ_A. So how do i find the appropriate vector to pass to my function? |
| ||
you meantAlignToVector OBJ_A,EntityX(OBJ_B,1),EntityY(OBJ_B,1),EntityZ(OBJ_B,1),1,1 right? well,here's how you would do it: AlignToVector OBJ_A,EntityX(OBJ_B,1)-EntityX(OBJ_A,1),EntityY(OBJ_B,1)-EntityY(OBJ_A,1),EntityZ(OBJ_B,1)-EntityY(OBJ_A,1),1,1 just subtract to get the relative coords. |
| ||
ahh... there we go thanks bot builder. i must be getting tired. when i worked it out on paper it didnt seem to work. |
| ||
...any reason why you cant use PointEntity or am I completely missing the point? |
| ||
so you can specify a turn rate, pointentity is instant |
| ||
exactly. its nice to have a slow roll rather than a jerky transition |