We encountered this exact problem a while ago, when we wanted to have the mouse control viewpoint, and as we moved the viewpoint we wanted to move an avatar at the same speed relative to the viewpoint. We had no luck with behaviors. What we ended up doing was taking the code from the SimpleUniverse class (found in the com.sun part of the package) and making the TransformGroup attached to the View (or the ViewPlatform, I'd have to check which), publicly accessible. Then, we attached the BranchGroup *underneath* this TransformGroup. Voila! Very, very smooth movement, no behavior necessary. I know this probably isn't recommended usage, but I have yet to find anything else that works so well. I can send you some sample code if you like. George >Imagine you intend to drive a spaceship through a J3D scene, lets say with >constant speed. The camera is fixed at the ship. What would be the best way >to do that really smooth? Esp. on Win32? >I tried to create a Behavior that works on the >getViewingPlatform().getViewPlatformTransform(). The behavior wakes up every >frame and the code is very intuitive. I tried to measure time with >System.currentTimeMillis() or with an own clock, that averages a couple of >frames depending on timer resolution (50ms on Win32). This clock is >triggered within Canvas3D.preRender(). >But the movement is far from being smooth! >Another way could be to synchronize the renderer with a update cycle. Could >that be better? >When I change a transformgroup within an behavior, when can I expect the >change to be valid? Next frame? >I append my FrameClock and TimerAccuracy classes for convenience. And my >TestBehavior to show how to use them. >Any thoughts on smooth animation?? >- J Joerg 'Herkules' Plewe HARDCODE Development http://www.hardcode.de =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
