本文整理汇总了Java中javax.vecmath.Matrix4d.rotY方法的典型用法代码示例。如果您正苦于以下问题:Java Matrix4d.rotY方法的具体用法?Java Matrix4d.rotY怎么用?Java Matrix4d.rotY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.vecmath.Matrix4d
的用法示例。
在下文中一共展示了Matrix4d.rotY方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: combineTransformation
import javax.vecmath.Matrix4d; //导入方法依赖的package包/类
static Matrix4d combineTransformation(Matrix4d matrix, Vector3d translation, Vector3d rotation) {
Matrix4d gM = new Matrix4d(matrix);
Matrix4d m = new Matrix4d();
m.setIdentity();
m.setTranslation(translation);
gM.mul(m);
m.setIdentity();
m.rotZ(rotation.z);
gM.mul(m);
m.setIdentity();
m.rotY(rotation.y);
gM.mul(m);
m.setIdentity();
m.rotX(rotation.x);
gM.mul(m);
return gM;
}
示例2: Matrix4d
import javax.vecmath.Matrix4d; //导入方法依赖的package包/类
public void rotateY(double alpha)
{
Matrix4d rot = new Matrix4d(Espace.IDENTITY4);
rot.rotY(alpha);
for (Objet o : listeObjets)
{
o.applyTransform(rot);
o.setRotation(0.0, alpha, 0.0);
}
}
示例3: postSet
import javax.vecmath.Matrix4d; //导入方法依赖的package包/类
public void postSet() {
final Matrix4d m = getM();
if (translation != null) {
final Matrix4d t = new Matrix4d();
t.set(translation);
m.mul(t);
}
if (rotation != null) {
final Matrix4d r = new Matrix4d();
r.rotX(Math.toRadians(rotation.x));
m.mul(r);
r.rotY(Math.toRadians(rotation.y));
m.mul(r);
r.rotZ(Math.toRadians(rotation.z));
m.mul(r);
}
if (scale != null) {
final Matrix4d s = new Matrix4d();
s.setIdentity();
s.setElement(0, 0, scale.x);
s.setElement(1, 1, scale.y);
s.setElement(2, 2, scale.z);
m.mul(s);
}
final Matrix4d minv = getMinv();
minv.invert(getM());
}
示例4: getParentTransformation
import javax.vecmath.Matrix4d; //导入方法依赖的package包/类
private float[][] getParentTransformation(List<QubbleCuboid> parentCuboids)
{
Matrix4d matrix = new Matrix4d();
matrix.setIdentity();
Matrix4d transform = new Matrix4d();
for (QubbleCuboid cuboid : parentCuboids)
{
transform.setIdentity();
transform.setTranslation(new Vector3d(cuboid.getPositionX(), cuboid.getPositionY(), cuboid.getPositionZ()));
matrix.mul(transform);
transform.rotZ(cuboid.getRotationZ() / 180 * Math.PI);
matrix.mul(transform);
transform.rotY(cuboid.getRotationY() / 180 * Math.PI);
matrix.mul(transform);
transform.rotX(cuboid.getRotationX() / 180 * Math.PI);
matrix.mul(transform);
}
double sinRotationAngleY, cosRotationAngleY, sinRotationAngleX, cosRotationAngleX, sinRotationAngleZ, cosRotationAngleZ;
sinRotationAngleY = -matrix.m20;
cosRotationAngleY = Math.sqrt(1 - sinRotationAngleY * sinRotationAngleY);
if (Math.abs(cosRotationAngleY) > 0.0001)
{
sinRotationAngleX = matrix.m21 / cosRotationAngleY;
cosRotationAngleX = matrix.m22 / cosRotationAngleY;
sinRotationAngleZ = matrix.m10 / cosRotationAngleY;
cosRotationAngleZ = matrix.m00 / cosRotationAngleY;
}
else
{
sinRotationAngleX = -matrix.m12;
cosRotationAngleX = matrix.m11;
sinRotationAngleZ = 0;
cosRotationAngleZ = 1;
}
float rotationAngleX = (float) (this.epsilon((float) Math.atan2(sinRotationAngleX, cosRotationAngleX)) / Math.PI * 180);
float rotationAngleY = (float) (this.epsilon((float) Math.atan2(sinRotationAngleY, cosRotationAngleY)) / Math.PI * 180);
float rotationAngleZ = (float) (this.epsilon((float) Math.atan2(sinRotationAngleZ, cosRotationAngleZ)) / Math.PI * 180);
return new float[][] { { this.epsilon((float) matrix.m03), this.epsilon((float) matrix.m13), this.epsilon((float) matrix.m23) }, { rotationAngleX, rotationAngleY, rotationAngleZ } };
}
示例5: testOrientationMetricIncrement
import javax.vecmath.Matrix4d; //导入方法依赖的package包/类
/**
* Test {@link UnitQuaternions#orientationMetric(Point3d[], Point3d[])} on a
* real structure, which will be deviating a little bit every time.
*
* @throws StructureException
* @throws IOException
*/
@Test
public void testOrientationMetricIncrement() throws IOException,
StructureException {
// The rotation increment will be Pi/10, Pi/15 and Pi/12 degrees in X,Y
// and Z
Matrix4d transform = new Matrix4d();
transform.rotX(Math.PI / 10);
transform.rotY(Math.PI / 12);
transform.rotZ(Math.PI / 15);
// Get points from a structure.
Structure pdb = StructureIO.getStructure("4hhb.A");
Point3d[] cloud = Calc.atomsToPoints(StructureTools
.getRepresentativeAtomArray(pdb));
Point3d[] cloud2 = CalcPoint.clonePoint3dArray(cloud);
// Center the clouds at the origin
CalcPoint.center(cloud);
CalcPoint.center(cloud2);
// Their orientation is equal at this stage
double m0 = UnitQuaternions.orientationMetric(cloud, cloud2);
assertEquals(m0, 0.0, 0.001);
// Assert it keeps incrementing every time transform is applied
CalcPoint.transform(transform, cloud2);
double m1 = UnitQuaternions.orientationMetric(cloud, cloud2);
assertTrue(m1 > m0);
CalcPoint.transform(transform, cloud2);
double m2 = UnitQuaternions.orientationMetric(cloud, cloud2);
assertTrue(m2 > m1);
CalcPoint.transform(transform, cloud2);
double m3 = UnitQuaternions.orientationMetric(cloud, cloud2);
assertTrue(m3 > m2);
CalcPoint.transform(transform, cloud2);
double m4 = UnitQuaternions.orientationMetric(cloud, cloud2);
assertTrue(m4 > m3);
CalcPoint.transform(transform, cloud2);
double m5 = UnitQuaternions.orientationMetric(cloud, cloud2);
assertTrue(m5 > m4);
CalcPoint.transform(transform, cloud2);
double m6 = UnitQuaternions.orientationMetric(cloud, cloud2);
assertTrue(m6 > m5);
CalcPoint.transform(transform, cloud2);
double m7 = UnitQuaternions.orientationMetric(cloud, cloud2);
assertTrue(m7 > m6);
CalcPoint.transform(transform, cloud2);
double m8 = UnitQuaternions.orientationMetric(cloud, cloud2);
assertTrue(m8 > m7);
CalcPoint.transform(transform, cloud2);
double m9 = UnitQuaternions.orientationMetric(cloud, cloud2);
assertTrue(m9 > m8);
}