Hi check in GLVectorGeometry unit you'll find what you search i think
cf :
function IsColinear(const V1, V2: TVector): Boolean;
function VectorAbs(const V: TVector): TVector;
function VectorRotateAroundX,Y,Z(const V: TAffineVector; alpha: Single) : TAffineVector;
function VectorPerpendicular(const V, n: TAffineVector): TAffineVector;
function VectorReflect(const V, n: TAffineVector): TAffineVector;
function AngleBetweenVectors(const a, b, ACenterPoint: TVector): Single;
ect ....
I think it exist a solution for calculating angle with the up and direction values but don't remember how to do and where i saw something similar.
Last edit: Jerome.D (BeanzMaster) 2017-02-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Stupid question.
I can not calculate the angle.
I have 4 xyz points (A, B, C, D).
I create 3 object:
Obj1 = Point AB.
Obj2 = Point CD.
Obj3 = Сrossing Obj1, Obj2.
I need set Roll, Turn, Pitch angle to Obj3.
If Obj / Onj2 rotated one axis then works.
If Obj / Onj2 rotated two or three axes then not works.
http://i.imgur.com/ZyWnDyD.jpg
Help me please..
My very bad / stupid / wrong code:
Last edit: Roman 2017-02-12
Hi check in GLVectorGeometry unit you'll find what you search i think
cf :
function IsColinear(const V1, V2: TVector): Boolean;
function VectorAbs(const V: TVector): TVector;
function VectorRotateAroundX,Y,Z(const V: TAffineVector; alpha: Single) : TAffineVector;
function VectorPerpendicular(const V, n: TAffineVector): TAffineVector;
function VectorReflect(const V, n: TAffineVector): TAffineVector;
function AngleBetweenVectors(const a, b, ACenterPoint: TVector): Single;
ect ....
I think it exist a solution for calculating angle with the up and direction values but don't remember how to do and where i saw something similar.
Last edit: Jerome.D (BeanzMaster) 2017-02-12
I still can not with Vector functions :[
i set Obj3 parent := Obj1;
Then search TurnAngle.
This work:
BUT this crazy method :[
How to do the right thing?
Last edit: Roman 2017-02-13