|
![](/i/fill.gif) |
Tim: thanks for the help, it's certainly helping, but I still can't get it
to work. *sigh* Here is my code so far:
///===================
//#declare Time = clock;
#declare Time = 3.6;
#declare groundheight = 0;
#declare Gravity = 9.8; // 1.6
#declare elastic = 0.5;
#declare Actual_Position = <0,0,0>;
#declare Start_Position = <0,20,0>;
#declare Direct_Speed = <1.5,0,0>;
#declare Hit_time = 0;
#declare Actual_Direct_Speed = 0;
#declare Hit_time= -((Direct_Speed.y/Gravity)-sqrt(
pow(Direct_Speed.y/Gravity,2)+((2*Start_Position.y)/Gravity) ));
#debug "hit time="
#debug str(Hit_time,8,0)
#declare counter = 0;
#while (counter < Time)
#declare Hit_time= -((Direct_Speed.y/Gravity)-sqrt(
pow(Direct_Speed.y/Gravity,2)+((2*Start_Position.y)/Gravity) ));
#declare Actual_Direct_Speed = Direct_Speed - Time*Gravity*y;
#if (counter > Hit_time)
#declare Direct_Speed = Actual_Direct_Speed*<1,-1,1>*elastic;
#else
#declare Direct_Speed = Actual_Direct_Speed;
#end
#declare counter = counter + 0.1;
#end
#declare
Actual_Position=Start_Position+Direct_Speed*Time-y*.5*Gravity*pow(Time,2);
object{rock translate Actual_Position} // okay, it's actually just a
sphere, for now
///=================
The two Time lines are for running the animation generation, and testing
certain points.
This is a lot harder I thought it would be. :-(
Rohan _e_ii
Post a reply to this message
|
![](/i/fill.gif) |