|
|
I used gravity ;
#declare Vel=Vel+dt*Gravity;
#declare Pos=Pos+dt*Vel;
#if ( Pos.z<-10)
#declare dtp=((-10-Pos.z)*dt)/(oPos.z-Pos.z);
#declare Vel=-Elas*Vel; // when the ball bounce
#declare Pos=<Pos.x,Pos.y,-10+Vel.z*(dt-dtp)>;
#end
// the variable dt represent the time between two frames
but especially a text-file to memorize the position and the speed of the
balls between each image. A significant point I believe, I created a random
difference in elasticity of the balls to avoid too perfect rebounds. Codes
can be downloaded at :
http://perso.wanadoo.fr/mops/atelier.htm
--
My Own Private Square.
http://perso.wanadoo.fr/mops/
Sorry this an automatically translated text, be lenient please.
Post a reply to this message
|
|