Java Reference
In-Depth Information
G.8 functIon for calculatIon of rotatIon matrIx
from rotatIon anGle
private Matrix3f coMatrix(int mode, float angle)
{
Matrix3f tempMat = new Matrix3f();
switch (mode)
{
case 1:
tempMat.m00 = (float)(Math.cos(angle));
tempMat.m01 = 0.0f;
tempMat.m02 = (float)(Math.sin(angle));
tempMat.m10 = 0.0f;
tempMat.m11 = 1.0f;
tempMat.m12 = 0.0f;
tempMat.m20 = (float)(-Math.sin(angle));
tempMat.m21 = 0.0f;
tempMat.m22 = (float)(Math.cos(angle));
break;
case 2:
tempMat.m00 = 1.0f;
tempMat.m01 = 0.0f;
tempMat.m02 = 0.0f;
tempMat.m10 = 0.0f;
tempMat.m11 = (float)(Math.cos(angle));
tempMat.m12 = (float)(Math.sin(angle));
tempMat.m20 = 0.0f;
tempMat.m21 = (float)(-Math.sin(angle));
tempMat.m22 = (float)(Math.cos(angle));
break;
case 3:
tempMat.m00 = (float)(Math.cos(angle));
tempMat.m01 = (float)(-Math.sin(angle));
tempMat.m02 = 0.0f;
tempMat.m10 = (float)(Math.sin(angle));
tempMat.m11 = (float)(Math.cos(angle));
tempMat.m12 = 0.0f;
tempMat.m20 = 0.0f;
tempMat.m21 = 0.0f;
tempMat.m22 = 1.0f;
break;
default:
}
return tempMat;
}
G.9 functIon for ImplementatIon of rotatIon for
vIeW platform
Search WWH ::




Custom Search