1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| //----------------------début de la création de la rotation--------------------------------
TransformGroup WinRSpin=new TransformGroup();
// permet de modifier l'objet pendant l'execution
WinRSpin.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
// on crée un fonction de rotation au cours du temps
Alpha rotationAlphaWinRSpin=new Alpha(-1,2000);
Transform3D rot = new Transform3D();
// rot.rotX((float)Math.PI/- 2.0f);
//rot.rotX(-45);
//rot.rotX((-Math.PI / 4.0)+30);
rot.rotY(0);
//rot.rotX(-Math.PI / 4.0);
//rot.rotY(-Math.PI / 4.0);
// rot.rotZ(-Math.PI / 4.0);
// rot.rotY(00);
//rot.rotZ(45);
// on crée un comportement qui va appliquer la rotation à l'objet voulu
RotationInterpolator rotatorWinRSpin=new RotationInterpolator(rotationAlphaWinRSpin,WinRSpin, rot, 0.50f,(float)(2.0*Math.PI));
// on définit la zone sur laquelle va s'appliquer la rotation
BoundingSphere boundsWinRSpin=new BoundingSphere(new Point3d((Math.PI / 4.0), 0.0, 0.0), 0.5);
boundsWinRSpin.setCenter(new Point3d((Math.PI / 4.0),0,0));
//boundsWinRSpin.setCenter();
//test put a t3d to a boundingsphere??
//Transform3D T3Dbounding = new Transform3D();
// T3Dbounding.set(new Vector3f(5.00f,0.0f,0.00f));
//WinRSpin.setTransform(T3Dbounding);
//end test put a t3d to a boundingsphere, not working
rotatorWinRSpin.setSchedulingBounds(boundsWinRSpin);
WinRSpin.addChild(rotatorWinRSpin);
//----------------------fin de la création de la rotation-------------------------------- |
Partager