Java Reference
In-Depth Information
private void setRotation(TransformGroup Trans, float angle, Matrix3f rotMat, int mode)
{
Transform3D rt3d = new Transform3D();
Trans.getTransform(rt3d);
rotMat.transpose();
rotMat.invert();
rotMat.mul(rotMat, coMatrix(mode, angle));
rt3d.setRotation(rotMat);
Trans.setTransform(rt3d);
}
G.10 functIon for ImplementatIon of translatIon
for vIeW platform
private Point3f setTranslation(Matrix3f rotMat, Point3f posi)
{
Point3f tempposi = new Point3f();
tempposi.x = rotMat.m00*posi.x + rotMat.m01*posi.y + rotMat.m02*(posi.z+0.01f);
tempposi.y = rotMat.m10*posi.x + rotMat.m11*posi.y + rotMat.m12*(posi.z+0.01f);
tempposi.z = rotMat.m20*posi.x + rotMat.m21*posi.y + rotMat.m22*(posi.z+0.01f);
return tempposi;
}
G.11 functIon for ImplementatIon of translatIon
and rotatIon for transform Group
private void setPosition(TransformGroup Trans, Point3f point)
{
Transform3D t3d = new Transform3D();
Trans.getTransform(t3d);
t3d.setTranslation(new Vector3d(point));
Trans.setTransform(t3d);
}
G.12 event InItIalIZatIon functIon
public void initialize()
{
eventsCondition[0] = new WakeupOnAWTEvent(KeyEvent.KEY_PRESSED);
eventsCondition[1] = new WakeupOnCollisionEntry(bodyshape);
eventsCondition[2] = new WakeupOnBehaviorPost(null, VIEWMOTION);
allEvents = new WakeupOr(eventsCondition);
wakeupOn(allEvents);
Search WWH ::




Custom Search