Sign in to follow this  
ArchangelMorph

[java] Changing angles with alpha..

Recommended Posts

Ok in my Java3D program I have a 3D model with which I'd like to animate.. I wanna use the alpha class to specify the time frame for the animation (i.e. the number of frames in the animation loop) And I want to specify the angles for every frame of animation in the loop, for every joint on the model I want to move.. I was looking at the rotationInterpolator class but the problem with this is it calls the processStimulus method every frame to calculate the angle from the alpha rather than retrieve these angles from an array (which is what I want to do in my program).. (hope i'm making sense thus far..) So I'm keen to find out if I should just create a new class which extends the RotationInterpolator class but overrides the processStimulus method, or do something else entirely to achieve my goals? I hope someone can help me resolve this issue since my program is very near to completion and I don't have too long left until the deadline.. Thankyou for your time

Share this post


Link to post
Share on other sites
The Alpha class in Java3d is merely a class that provides you with a time parameter (ie. form 0 to 1). It has nothing to do with changing angles etc.

Your right about the processStimulus() method. This is where all the action happens, so you should override this method.

The thing is i'm not exactly sure what you are trying to do. If you want to explicity change the angles at each time frame, then just extend the Interpolater class and overwrite the processStimulus() method. In the processStimulus() method call getAlpha().value(), which will return the time parameter and then just change the angles of the particular object at this time parameter.

Hope that helps!

Share this post


Link to post
Share on other sites
Quote:
Original post by jimmy1
The Alpha class in Java3d is merely a class that provides you with a time parameter (ie. form 0 to 1). It has nothing to do with changing angles etc.

Your right about the processStimulus() method. This is where all the action happens, so you should override this method.

The thing is i'm not exactly sure what you are trying to do. If you want to explicity change the angles at each time frame, then just extend the Interpolater class and overwrite the processStimulus() method. In the processStimulus() method call getAlpha().value(), which will return the time parameter and then just change the angles of the particular object at this time parameter.

Hope that helps!


Thanx alot!

Thats all I needed to kno!
This is what I was thinking about doing but I wasn't sure how the ProcessStimulus method worked or how I would go about overriding it (or even whether this would be an advisable thing to do.. Someone else told me to write a new interpolator but that would just be overkill I think)

I'll give it a shot and see how it goes..

Oh and I kno that the Alpha class doesn't have anythnig to do with angles, thats why I was going to use the RotationInterpolator class to do the angle processing.. (sorry maybe I didn't word my original post very well)

Thanks alot you've really helped!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this