Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JAVA 3D: How to animate "on-the-fly"?

843799Sep 8 2003 — edited Sep 11 2003
Hi guys,
I'm new to Java 3D and I've read a whole bunch of tutorials as well as Selman's book.

However, as great as Java 3D seems, it seems like I can't get Interpolators to work the way I want them to! Here is my goal:

Create a simulation where the View is FIXED and the main ANIMATED character (comibnation of objects) MOVE AROUND the universe through the user's keyboard commands.

I've managed the above by creating all my objects, adding them to a branchgroup, adding that branchgroup to a transformgroup, adding a few interpolator animations to the transformgroup and finally adding a cutom keyboard navigator behavior to the transformgroup.

The following problem has occurred:

I can't NICELY move the transformgroup around because I use Transform3D objects to calculate the next position of the transformgroup and I then apply it to the transformgroup by calling the "setTransform" method on that group with the Transform3D object. The result is an instantaneous leap x locale units away with no animation in between the original and final position. :o( This is the only way I got this working. The Java runtime keeps yelling at me that I can't add or remove Interpolators or transformgroups from other transformgroups or branchgroups, so I can't change interpolators on-the-fly (say, when the user wants to move in a different direction)... Can it possibly be that we can only declare and use interpolators at prior to executing a universe?!

The IDEAL solution I'm looking for (!INSERT YOUR HELP HERE! ;o) ):

Replace the ugly "setTransform" call by adding a PositionInterpolator or something to the transformgroup object in order to generate a SMOOTH ANIMATION from the original position to the final position. The end result will be must nicer and more professional.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2003
Added on Sep 8 2003
12 comments
582 views