cs_dafi
Messages postés17Date d'inscriptionvendredi 19 décembre 2003StatutMembreDernière intervention19 mai 2004
-
27 avril 2004 à 14:39
cs_dafi
Messages postés17Date d'inscriptionvendredi 19 décembre 2003StatutMembreDernière intervention19 mai 2004
-
27 avril 2004 à 14:41
Bonjour,
J'arrive à mettre en rotation un torus sur l'axe Y à un certain endroit dans l'espace mais impossible de le faire tourner sur un autre axe.
qq1 à une idée ?
J'ai consulté plusieurs aides et forums. Toujours le même pb mais peu de solutions vraiment fonctionnelles.
PolygonAttributes pa = new PolygonAttributes();
pa.setPolygonMode(pa.POLYGON_LINE);
pa.setCullFace(pa.CULL_NONE);
ringApp.setPolygonAttributes(pa);
Transform3D t3d = new Transform3D();
Vector3f RingPosition = new Vector3f(ringX, ringY, ringZ);
t3d.setTranslation(RingPosition);
TransformGroup trans = new TransformGroup (t3d);
TransformGroup rotZGrp = new TransformGroup ();
rotZGrp.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
rotZGrp.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
Transform3D zAxis = new Transform3D();
//zAxis.rotX(90.0*3.14159/180.0);
zAxis.setRotation(new AxisAngle4f (ringX,ringY, ringZ,(float)Math.toRadians(360)));
Alpha rotationAlpha = new Alpha(-1, speedRing);
RotationInterpolator rotatorZ = new RotationInterpolator (rotationAlpha, rotZGrp, zAxis, 0.0f, (float) Math.PI*2.0f);
BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 1000.0);
rotatorZ.setSchedulingBounds(bounds);
//rotatorZ.setTransformAxis(t3d);
rotZGrp.addChild(rotatorZ);
Torus torus = new Torus (radiusRing, thicknessRing);
torus.setAppearance(ringApp);