Hi,
Excuse me for my poor English, I try the best I can :)
I have to anim the height of a Box, from 1.0 (100%) to a value I stored
in a var. I'm able to change uniformly the height, width and depth of
the box with a ScaleInterpolator, but not only the height of it, even
with a setScale(Vector3d) on the Transform3D I set as TransformAxis in
my ScaleInterpolator. The setScale works fine without animation.
Is it possible with a ScaleInterpolator ?
It'd be nice if someone could help me.
================== my code ==================
BranchGroup objRoot = new BranchGroup();
<SNIP>
// create the Box
Appearance boxAppeareance = new BarAppearance();
boxAppeareance.setColoringAttributes(new ColoringAttributes(
new Color3f(0.0f, 1.0f, 0.0f),
ColoringAttributes.SHADE_GOURAUD));
Box bar = new Box(0.5f, 0.1f, 0.5f, boxAppeareance);
<SNIP>
//===== THE ANIMATION =====
// TransformGroup
TransformGroup animGroup = new TransformGroup();
animGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
// ScaleInterpolator
Alpha myAlpha = new Alpha(-1, 5000);
ScaleInterpolator interpol = new ScaleInterpolator(myAlpha, animGroup);
BoundingSphere bounds = new BoundingSphere();
interpol.setSchedulingBounds(bounds);
// Transform3D
Transform3D anim = new Transform3D();
anim.setScale(new Vector3d(1, 20, 1));
interpol.setTransformAxis(anim);
animGroup.addChild(interpol);
//===== THE RETURN =====
animGroup.addChild(bar);
objRoot.addChild(animGroup);
objRoot.compile();
================== /my code ==================
Cedric.Olmanst@gmail.com - 08 Mar 2006 14:41 GMT
Bon, j'ai écrit mon propre interpolateur... bon du coup, je dois aussi
les monter en même temps, parce qu'elles grandissent vers le haut et
vers le bas :) Un peu de chipotage, mais ça devrait aller.