Getting the angle that a vectori is making with a plane...
Actually the plane is 0,0,0 and infinite...
So I ask is like this : I have a vector(let`s say 2D for the simplicity),and i want to know the angle it makes with the x axis ...
^
| /
|/a
-------->
|
|
^
I don`t know if my text paiting will show the case..but it`s pretty simple to understand..i`ve treyd the acos function(s) and it`s not actually working..
edit:
Well the code I use (now) is this :
CVector3 Dif=ControlPoints[nextCP]-ControlPoints[prevCP];
Dif=Dif/framesbetween;
Pos=Pos+Dif;
curentframe++;
float dst=sqrt(Dif.x*Dif.x+Dif.z*Dif.z);//y was taken... because I need the y axis rotation not on all of the, although I might try 2.(rotation axis)..hm...
float rad=acos(Dif.x/dst);//I tryed either x or z almost the same,actaully with z it works better
float degrees=rad*180.0f;//Like this right ? a radian is 180 degress...I think ?
Relative Games - My apps
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement