Java Reference
In-Depth Information
rotMat.m11 = Math.cos(angle);
rotMat.m22 = rotMat.m11;
rotMat.m12 = Math.sin(angle);
rotMat.m21 = -rotMat.m12;
rt3d.setRotation(rotMat);
this.setTransform(rt3d);
}
public void setRotationY(float angle)
{
Matrix3d rotMat = new Matrix3d();
Transform3D rt3d = new Transform3D();
this.getTransform(rt3d);
rt3d.getRotationScale(rotMat);
rotMat.m00 = Math.cos(angle);
rotMat.m22 = rotMat.m00;
rotMat.m02 = Math.sin(angle);
rotMat.m20 = -rotMat.m02;
rt3d.setRotation(rotMat);
this.setTransform(rt3d);
}
public void setRotationZ(float angle)
{
Matrix3d rotMat = new Matrix3d();
Transform3D rt3d = new Transform3D();
this.getTransform(rt3d);
rt3d.getRotationScale(rotMat);
rotMat.m00 = Math.cos(angle);
rotMat.m11 = rotMat.m00;
rotMat.m10 = Math.sin(angle);
rotMat.m01 = -rotMat.m10;
rt3d.setRotation(rotMat);
this.setTransform(rt3d);
}
f.4 functIon for chanGInG posItIon of knob
public void setPosition(Point3f point)
{
Transform3D t3d = new Transform3D();
this.getTransform(t3d);
t3d.setTranslation(new Vector3d(point));
this.setTransform(t3d);
this.setTransform(t3d);
}
}
Search WWH ::




Custom Search