I've been working on adding ROTSTEP support to the 1.6 version.
But I have never used the meta myself so I would appreciate some feedback / info about it.
This is what I got so far:
screenshot
I find the angle properties very limiting, (especially the z control as shown in the picture).
Maybe I'm using it wrong, so what values are used often / in normal situations?
Also does anyone know the best/easiest way to extract the angles from an existing rotation matrix?
This is what i use for setting up the matrix (as described in the MLCAD spec doc).
Code:
void TLDStepMetaLine::getRotStepRotationMatrix(const double xAngle, const double yAngle, const double zAngle, TGLMatrixd &matrix) {
//Uit rotstep spec doc
const double wx=deg2Rad(xAngle);
const double wy=deg2Rad(yAngle);
const double wz=deg2Rad(zAngle);
const double s1=sin(wx);
const double s2=sin(wy);
const double s3=sin(wz);
const double c1=cos(wx);
const double c2=cos(wy);
const double c3=cos(wz);
matrix.initFromLDraw(
0.0, 0.0, 0.0, //xyz
c2*c3, //a
-c2*s3, //b
s2, //c
c1*s3+s1*s2*c3, //d
c1*c3-s1*s2*s3, //e
-s1*c2, //f
s1*s3-c1*s2*c3, //g
s1*c3+c1*s2*s3, //h
c1*c2); //i
};
Any feedback / help is welcome.