/** * Applies a rotation to a given transform object. * @param t3d the transform object to rotate * @param rot the rotation as axis-angle (x,y,z,angle) * */ public static void rotate(Transform3D t3d, AxisAngle4d rot) { Transform3D rotT3d = new Transform3D(); rotT3d.setRotation(rot); t3d.mul(rotT3d); }
/** * Rotates a given point around the origin. * @param p the point to rotate * @param rot the rotation as axis-angle (x,y,z,angle) */ public static void rotate(Point3d p, AxisAngle4d rot) { Transform3D t3d = new Transform3D(); t3d.setRotation(rot); t3d.transform(p); }
private void setQuaternion (Quat4d quat) { Transform3D t = getTransform(); t.setRotation(quat); setTransform(t); }
private void setQuaternion (Quat4d quat) { Transform3D t = getTransform(); t.setRotation(quat); setTransform(t); }
private void orientAxis (Vector3D axis, double angle) { Transform3D t = getTransform(); AxisAngle4d aa = new AxisAngle4d(axis.x, axis.y, axis.z, Math.toRadians(angle)); t.setRotation(aa); setTransform(t); }
private void orientAxis (Vector3D axis, double angle) { Transform3D t = getTransform(); AxisAngle4d aa = new AxisAngle4d(axis.x, axis.y, axis.z, Math.toRadians(angle)); t.setRotation(aa); setTransform(t); }
private void rotateQuat (Quat4d quat) { Transform3D t = getTransform(); Transform3D t1 = new Transform3D(); t1.setRotation(quat); t.mul(t1); setTransform(t); }
private void rotateQuat (Quat4d quat) { Transform3D t = getTransform(); Transform3D t1 = new Transform3D(); t1.setRotation(quat); t.mul(t1); setTransform(t); }
public void rotateRelative (Vector3D angles) { Transform3D t = getTransform(); Transform3D tX = new Transform3D(); Transform3D tY = new Transform3D(); Transform3D tZ = new Transform3D(); Vector3D radians = angles.times(Math.PI / 180.); tX.setRotation(new AxisAngle4d(1, 0, 0, radians.x)); tY.setRotation(new AxisAngle4d(0, 1, 0, radians.y)); tZ.setRotation(new AxisAngle4d(0, 0, 1, radians.z)); t.mul(tX); t.mul(tY); t.mul(tZ); setTransform(t); }
public void rotateAxis (Vector3D axis, double angle) { if(angle == 0) return; Transform3D t = getTransform(); Vector3D aRel = absToRel(axis); AxisAngle4d aa = new AxisAngle4d(aRel.x, aRel.y, aRel.z, Math.toRadians(angle)); Transform3D t1 = new Transform3D(); t1.setRotation(aa); t.mul(t1); setTransform(t); }
public void rotateAxis (Vector3D axis, double angle) { if(angle == 0) return; Transform3D t = getTransform(); Vector3D aRel = absToRel(axis); AxisAngle4d aa = new AxisAngle4d(aRel.x, aRel.y, aRel.z, Math.toRadians(angle)); Transform3D t1 = new Transform3D(); t1.setRotation(aa); t.mul(t1); setTransform(t); }
public void rotateRelative (Vector3D angles) { Transform3D t = getTransform(); Transform3D tX = new Transform3D(); Transform3D tY = new Transform3D(); Transform3D tZ = new Transform3D(); Vector3D radians = angles.times(Math.PI / 180.); tX.setRotation(new AxisAngle4d(1, 0, 0, radians.x)); tY.setRotation(new AxisAngle4d(0, 1, 0, radians.y)); tZ.setRotation(new AxisAngle4d(0, 0, 1, radians.z)); t.mul(tX); t.mul(tY); t.mul(tZ); setTransform(t); }
public void rotate (Vector3D angles) { Transform3D t = getTransform(); Transform3D tX = new Transform3D(); Transform3D tY = new Transform3D(); Transform3D tZ = new Transform3D(); Vector3D xR = absToRel(xAxis); Vector3D yR = absToRel(yAxis); Vector3D zR = absToRel(zAxis); Vector3D radians = angles.times(Math.PI / 180.); tX.setRotation(new AxisAngle4d(xR.x, xR.y, xR.z, radians.x)); tY.setRotation(new AxisAngle4d(yR.x, yR.y, yR.z, radians.y)); tZ.setRotation(new AxisAngle4d(zR.x, zR.y, zR.z, radians.z)); t.mul(tX); t.mul(tY); t.mul(tZ); setTransform(t); }
public void rotate (Vector3D angles) { Transform3D t = getTransform(); Transform3D tX = new Transform3D(); Transform3D tY = new Transform3D(); Transform3D tZ = new Transform3D(); Vector3D xR = absToRel(xAxis); Vector3D yR = absToRel(yAxis); Vector3D zR = absToRel(zAxis); Vector3D radians = angles.times(Math.PI / 180.); tX.setRotation(new AxisAngle4d(xR.x, xR.y, xR.z, radians.x)); tY.setRotation(new AxisAngle4d(yR.x, yR.y, yR.z, radians.y)); tZ.setRotation(new AxisAngle4d(zR.x, zR.y, zR.z, radians.z)); t.mul(tX); t.mul(tY); t.mul(tZ); setTransform(t); }
vues_[SUD].setRotation(new AxisAngle4d(1, 0, 0, alphaCam)); vues_[NORD].setRotation(new AxisAngle4d(1, 0, 0, -alphaCam)); t3d2 = new Transform3D(); t3d2.setRotation(new AxisAngle4d(0, 0, 1, Math.PI)); vues_[NORD].mul(t3d2); alphaCam = alpha1 + angleCamera / 2; vues_[EST].setTranslation(new Vector3d(xA, midY, zA)); vues_[EST].setRotation(new AxisAngle4d(0, 0, 1, Math.PI / 2)); t3d2 = new Transform3D(); t3d2.setRotation(new AxisAngle4d(1, 0, 0, alphaCam)); vues_[EST].mul(t3d2); xA = boite.o_.x_ - yMoins; vues_[OUEST].setTranslation(new Vector3d(xA, midY, zA)); vues_[OUEST].setRotation(new AxisAngle4d(0, 0, 1, -Math.PI / 2)); t3d2 = new Transform3D(); t3d2.setRotation(new AxisAngle4d(1, 0, 0, alphaCam)); vues_[OUEST].mul(t3d2);
transGroupTransform.setRotation(rotation2);
return; t3d2.setRotation(v); t3d.mul(t3d2); transformU_.setTransform(t3d);
default: t3d2.setRotation(v);
rot.setRotation(new AxisAngle4f(cross.getX(),cross.getY(),cross.getZ(),angle)); tx.mul(rot);