physics parabola tool?

Discuss ideas for new features with other users. To submit feature requests to Smith Micro, please visit support.smithmicro.com

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
lwaxana
Posts: 1295
Joined: Wed Jan 06, 2010 6:50 pm

physics parabola tool?

Post by lwaxana »

It would be great to have a tool that draws parabolas. It could be used for gravity/projectile animation (like bouncing ball animation) when coupled with the follow path tool. This would allow for automatic interpolation following an accurate arc. Currently we can just draw an approximate parabola, but parabolas are so useful in animation, it would be great if it was built in and accurate. I suppose while we're at it, the parabola tool could also place marks along the parabola at even time intervals like the graph here:
http://babek.info/libertybasicfiles/lbn ... cnally.htm The physics tool must already use something like this, but I think a parabola tool would give the animator more control.
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: physics parabola tool?

Post by hayasidist »

viewtopic.php?f=12&t=25299 ... hope that's what you need -- it had been on my "to do" list for a while.
User avatar
lwaxana
Posts: 1295
Joined: Wed Jan 06, 2010 6:50 pm

Re: physics parabola tool?

Post by lwaxana »

This is amazing! I wasn't expecting any kind of response let alone the tool itself! Thank you so much!

Regarding the points, my thought was that the X axis could represent horizontal distance with Y axis representing vertical distance. I wanted the points to represent time intervals. So they wouldn't be evenly spaced along the X axis. It has been a long time since I studied physics or calculus, so I don't have an equation ready to go. If I can come up with an equation could that be used to space the points?
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: physics parabola tool?

Post by hayasidist »

I **think** that follow curve doesn't care about intermediate points. So, e.g., if you have a 5 point system (drawn by any tool), and the first 4 points are "tightly packed" in the first 10% of the curve, if you "just" said 'follow curve from start to end' it would still take 90% of the time to get from 4 to 5. Contrast that to a timing chart where the idea would be that the last 90% distance takes 25% of the time.

The point spacing along the curve that you have *is* time based: the path length along the line of the curve is the distance travelled in a time unit: there's a long distance between points at each end (fast movement) and the points are closer to each other at the apex (slow movement). What's "missing" is the set of (timed) keyframes for the follow curve function. In other words, for a 5 point system to take 4 seconds with level start and end points you'd need keys for 0, 50 and 100% along at start (t=0) , mid (t=2) and end (t=4); then keys at t=1 and 3 for (say) 40% and 60% [numbers only for example - not rigorously calculated] (or, of course, keys for 25% and 75% at the "right" time).

so, I don't think that redistributing points along the curve will help - rather, what I think is needed is something that will generate keys for the "follow curve" function - give it a curve and "total time on track" then it will take each point as a timing point and calculate and create the set of "n% along" keys. And, of course, this isn't just for parabolas - it'll use any curve as a timing chart...
User avatar
lwaxana
Posts: 1295
Joined: Wed Jan 06, 2010 6:50 pm

Re: physics parabola tool?

Post by lwaxana »

This is the part I'm having a hard time wrapping my brain around; parabolas can be used to model two separate (but semi-related?) relationships involved in projectile motion: (1) the relationship between the time and vertical position of a projectile and (2) the relationship between the horizontal position and vertical position of a projectile. So the latter doesn't show the relationship with time, just spatial location. However, time is involved (in the case of projectile motion) because each point on the graph shows the horizontal position and vertical position at a particular instance, but time is neither the x nor y axis. I think once those marks are added at consistent time interval, it becomes a timing chart for projectile motion. The location on the parabola tells you the horizontal and vertical positions and the time interval marks tell you when it is in each position. Meanwhile, the vertical position vs. time parabola (which I think you are describing) could be used to time the vertical component of projectile motion because the horizontal position's data is absent.
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: physics parabola tool?

Post by hayasidist »

I'll try to keep this short (ish), so I'll skip stuff you probably know.
A projectile leaves its origin with a velocity and then moves only influenced by gravity. To keep things manageable, we'll ignore any aerodynamics, wind, drag etc, and focus on the ++ quadrant.
The horizontal component of the velocity remains constant (no forces are acting horizontally) - so the x axis is both distance and time as they are related in a linear fashion - any point on the x axis is a measure of either - so (e.g.) a point at x = 35% of the length is both 35% of the time and 35% of the horizontal distance covered.
The vertical velocity component is affected by gravity. The projectile slows to zero then accelerates downwards. There's a quadratic relationship y = ut + 0.5at^2. The y axis plots vertical displacement from origin. The first differential wrt time dy/dt is velocity and this is a straight line that starts "high", crosses the x axis at the apex of the parabola then carries on down. The second differential wrt time d^2y/dt^2 is a constant that is the acceleration.
The curve can be plotted using 3 or more points. Imagine that you just observe the projectile at the start and end of its flight. You'll have two points to plot, (0,0) and (distance,0) - not very useful. Add a third point at half time and you'll add a point at (0.5*distance, max height). These three points are the minimum requirement for solving a quadratic where none of the constants y=ax^2+bx+c are known. Then you can add as many more points as you like at any point either in time or when a certain height is reached - after a short while the curve shape becomes very clear and no matter how many more points you add you don't see any change in shape. if you didn't know the formula, you could use this curve and its derivatives graphically to predict any of the variables: t, x, y, distance travelled, velocity, force.

Because the drawing tool (as it stands) doesn't know about the starting velocity vector, what you get is a shape controlled by the "curvature" number and the relative positions of your mouse movement when you click and drag to draw - and this information is used in the quadratics to calculate the curve; and you get to choose the number of points you want to plot to visualise the curve: as long as you have "enough" points the curve will always look right.

It's perfectly feasible to change the UI to ask for initial velocity vector as well as the "terrain" information and then plot the curve using control points every chosen time interval. But this would just change the UI and not the shape of the curve - and in either case, if you wanted to use follow path, all the careful choice of control point spacing is ignored as follow path gets x% of the way along the path at x% of the time (assuming linear interpolation).

Bottom line. Whatever approach used to create the curve, AS uses the control points as drawing points, not timing points. You can set key frames manually to translate the projectile along the curve (e.g. use follow curve - set linear interpolation, add the keys for 0% and 100% then "add keyframe" at (say) the 25%, 50% and 75% timing points, then drag these keys along the timeline so the projectile is in the right place along the curve at the right time) or automate this as previously suggested.

Hope this helps!
[edit: typo corrected]
Last edited by hayasidist on Fri Jan 24, 2014 10:35 pm, edited 1 time in total.
User avatar
lwaxana
Posts: 1295
Joined: Wed Jan 06, 2010 6:50 pm

Re: physics parabola tool?

Post by lwaxana »

Thank you for taking the time to explain this. The information I was missing was that the horizontal component of the velocity remains constant. Now it makes sense! Thank you so much for all of your help! :D
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: physics parabola tool?

Post by hayasidist »

viewtopic.php?f=12&t=25384 has the "missing tool" that I referred to ... hope this is helpful for you.
User avatar
lwaxana
Posts: 1295
Joined: Wed Jan 06, 2010 6:50 pm

Re: physics parabola tool?

Post by lwaxana »

You are amazing! Thanks for all your help. I can't wait to try it out.
Post Reply