Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / March 2006

Tip: Looking for answers? Try searching our database.

Change only the height of a box (animation)

Thread view: 
Cedric.Olmanst@gmail.com - 08 Mar 2006 12:12 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.