Vectors

Blitz3D Forums/Blitz3D Programming/Vectors

LostCargo(Posted 2003) [#1]
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?


Bot Builder(Posted 2003) [#2]
you meant
 
AlignToVector 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.


LostCargo(Posted 2003) [#3]
ahh... there we go
thanks bot builder. i must be getting tired. when i worked it out on paper it didnt seem to work.


big10p(Posted 2003) [#4]
...any reason why you cant use PointEntity or am I completely missing the point?


(tu) sinu(Posted 2003) [#5]
so you can specify a turn rate, pointentity is instant


LostCargo(Posted 2003) [#6]
exactly. its nice to have a slow roll rather than a jerky transition