Bom dia.
Temos duvida em como reduzir a velocidade de um cilindro. Ele tem que percorrer um caminho e para isso temos coordenadas que definem o seu percurso. Como se apresenta em seguida:
Cylinder c1 = new Cylinder (0.5f, 0.5f);
Point3f[] positions = {new Point3f(3.17f,0.48f,0), new Point3f(2.75f,0.48f,0.0f),
new Point3f(2.33f,0.48f,0.0f), new Point3f(1.91f,0.48f,0.0f), new Point3f(1.49f,0.48f,0.0f),new Point3f(1.07f,0.48f,0.0f),
new Point3f(0.65f,0.48f,0.0f),new Point3f(0.23f,0.48f,0.0f),
new Point3f(0.48f,1.18f,0.0f),
new Point3f(0.48f,1.92f,0.0f), new Point3f(0.48f,2.68f,0.0f), new Point3f(1.22f,2.68f,0.0f),
new Point3f(1.98f,2.68f,0.0f)};
Em seguida temos isto para defenir a velocidade e repartimos o intervalo de knots pelo numero de pontos que temos, o resultado é que o cilindro anda muito rápido, como podemos fazer para reduzir a velocidade?
float[] knots = {0f, 0.083f, 0.166f, 0.249f, 0.332f, 0.415f, 0.498f, 0.581f, 0.664f, 0.747f, 0.831f, 0.913f,1f};
Alpha alpha = new Alpha();
TransformGroup target = new TransformGroup();
target.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
target.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
target.addChild(c1);
Transform3D axis = new Transform3D();
PositionPathInterpolator interpolator = new PositionPathInterpolator(alpha, target, axis, knots, positions);
interpolator.setSchedulingBounds(bounds);
tgTransl.addChild(target);
root.addChild(interpolator);
Os melhores cumprimentos e desde já agradecemos a ajuda