neue rotationsfunktion

This commit is contained in:
seba 2008-06-21 20:31:11 +02:00
parent c65e215a5a
commit e8de360ed9
2 changed files with 22 additions and 0 deletions

View File

@ -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);
}

View File

@ -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