Does anyone know of a way of creating the realistic motion of an object? Say I have a sphere in my scene and I apply a positionInterpolator to it so that it rises and falls is there any way I can make it decellerate and accelerate according to the law gravity as it would naturally?
If it were possible to apply different increasing alpha ramp durations to the Alpha object it may be possible, but this is not the case.
private float physicsMath(float val)
//Standard cubic function on [0 1]
return ((-2f * val) + 3) * val * val;
The above interpolator should (I've not debugged it) start with your object at rest, accelerate it to it's top speed when alpha is at .5, and slow it to a stop again at alpha = 1. The key here is to override physicsMath() with whatever physics function best represents the behaviour you want to model. It helps to think that the alpha will change at a constant rate from 0 to 1 and that your math must mould this into something with the slow downs and speed ups you need.
You could also avoid Alphas all together and implement animation in a seperate thread. That's what I do.
hello....i have to develop prototype of simple dynamic animation system using java3d for my project. I am pretty new to java3d. till now in few days i hav been able to translate n rotate a sphere. but now m trying to apply principles of physics dynamics to simulate the sphere so tht it can show realistic behaviour..In other words i want to apply force to the sphere manually thru user interaction and want the sphere ball to move according to the laws of physics... can anyone help me in this regard...how can i achieve this...Is this possible by using ode solvers...if anyone has any sort of solution plz reply...it wud realy help me to move ahead in my project....thnks....
I have been working on an application like that for relativistic physics. It also does Newtonian physics and might be of interest to you. The user can insert any number of different shapes into the scene, change their dimensions and rotations, give them differen locations and velocities, switch reference frames and watch what happens. It does not yet do acceleration or forces. Things don't bounce off each other yet.
If you have a decent PC you can run it as an applet:
The following html page gives instructions for a simple Relativity problem but, if you check the box marked "Newtonian", it will run in Newtonian physics.