neue rotationsfunktion
This commit is contained in:
parent
c65e215a5a
commit
e8de360ed9
|
@ -50,3 +50,24 @@ void rotFrom2VecTo2Vec(Punkt3D a, Punkt3D b, Punkt3D c, Punkt3D d) {
|
|||
// rvec2.print("rvecdeg2");
|
||||
|
||||
}
|
||||
|
||||
void rotvec2(Punkt3D a, Punkt3D b, Punkt3D c, Punkt3D d, float *dega, Punkt3D *veca, float *degb, Punkt3D *vecb) {
|
||||
*dega = a.calcAngle(b);
|
||||
if(*dega==180.0f)
|
||||
*veca = a.getOrtographic();
|
||||
else if(*dega==0.0f)
|
||||
veca->set(1.0f, 0.0f, 0.0f);
|
||||
else
|
||||
*veca = a.kreuzprodukt(b);
|
||||
*degb = 0.0f;
|
||||
vecb->set(1.0f, 0.0f, 0.0f);
|
||||
c = Rotationsmatrix(*veca, *dega) * c;
|
||||
|
||||
*degb = c.calcAngle(d);
|
||||
if(*degb==180.0f)
|
||||
*vecb = c.getOrtographic();
|
||||
else if(*degb==0.0f)
|
||||
vecb->set(1.0f, 0.0f, 0.0f);
|
||||
else
|
||||
*vecb = c.kreuzprodukt(d);
|
||||
}
|
||||
|
|
|
@ -9,4 +9,5 @@
|
|||
|
||||
void rotFrom2VecTo2Vec(Punkt3D a, Punkt3D b, Punkt3D c, Punkt3D d, Punkt3D *, float *, Punkt3D *, float *);
|
||||
void rotFrom2VecTo2Vec(Punkt3D a, Punkt3D b, Punkt3D c, Punkt3D d);
|
||||
void rotvec2(Punkt3D a, Punkt3D b, Punkt3D c, Punkt3D d, float *dega, Punkt3D *veca, float *degb, Punkt3D *vecb);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue