This topic is 3183 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello everyone i am currently working on a 2d project... my object falls from a particular height then the speed gradually accelerates then on key press the parachute opens and the object starts to de-accelerate upto a point and then keep falling again with a continuos speed... i have been able to achieve the acceleration and deacceleration with my function which returns me the distance int CalculateSpeed (float speed, float time ) { time += 0.1; dist = dist + (speed * time); return dist; } the problem i am facing is that after deaccelerating to a point i am not able to get the object falling with a continous speed.... please can anyone suggest some solution or a better/different way of doing it... any advice would be of great help... Thanks Anup Gupta

##### Share on other sites
Perhaps you can set the speed something like:
if( parachute_open && speed <= parachute_open_speed && not_on_ground )   speed = parachute_open_speed

##### Share on other sites
Here's something somewhere in-between real C/C++ code and pseudocode:

struct particleState{   vector2d pos;   vector2d vel;};//...particleState nextState(particleState x, bool parachuteOpen, double dt)// Given the current state x, the timestep dt, and whether the parachute// is open, returns the next state.{  particleState x2; // This will store our return value  double a;  if(parachuteOpen)     a = mu*square(x.vel) - g; // g,mu constants  else     a = -g;  // Take a symplectic Euler step  x2.vel = x.vel + Vector2d(0, a*dt);  x2.pos = x.pos + x2.vel*dt;    return x2;}

To find terminal velocity with parachute open, solve

a = mu*square(x.vel) - g = 0

for x.vel. You get that the terminal velocity will be sqrt(g/mu). So pick mu accordingly.

[Edited by - Emergent on February 25, 2010 12:43:14 PM]

##### Share on other sites
hello Emergent

I just want to say thank you a million times...

I just got the parachute acceleration , deacceleration and continuous falling after deacceleration in perfect sync..just as i wanted...

thanks for your pseudocode it worked like a charm...

Regards

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633299
• Total Posts
3011259
• ### Who's Online (See full list)

There are no registered users currently online

×