1 / 54

Phun with Physics

Phun with Physics. The basic ideas Vector calculus Mass, acceleration, position, …. Some defs…. Kinematics The status of an object Position, orientation, acceleration, speed Describes the motion of objects without considering factors that cause or affect the motion Dynamics

mariam-luna
Download Presentation

Phun with Physics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Phun with Physics • The basic ideas • Vector calculus • Mass, acceleration, position, …

  2. Some defs… • Kinematics • The status of an object • Position, orientation, acceleration, speed • Describes the motion of objects without considering factors that cause or affect the motion • Dynamics • The effects of forces on the motion of objects.

  3. The basics • Let p(t) be the position in time. • We’ll drop the (t) and just say p • Other values: • v – velocity • a - acceleration Velocity is the derivative of position Acceleration is the derivative of velocity

  4. Vector calculus • Really, p(t) is a triple, right? • Think of these equations as three equations, one for each dimension • This is vector calculus

  5. Newton’s law and Momentum • We know this one… • Momentum Note: Force is the derivative of momentum

  6. What about real objects? • Think of a real object as a bunch of points, each with a momentum • We can find a “center of mass” for the object and treat the object as a point with the total mass • We have: • Mass, position vector, acceleration vector, velocity vector

  7. Example: Air Resistance • The resistance of air is proportional to the velocity • F = -kv • We know F = ma, so: ma = -kv So, how can we solve?

  8. Euler’s method

  9. What about orientation? • We’ll start in 2D… • Let W be the orientation (angle) • Easy in 2D, not so easy in 3D we’ll be back • w is the angular velocity around center of gravity • a is the angular acceleration • Then…

  10. What’s the velocity at a point? Radians are important, here Perpendicular to cp Same length! Perpendicularized radius vector p Chasles’ Theorem: Velocity at any point is the sum of linear and rotational components.

  11. Angular momentum • Angular momentum • At a point? • For the whole thing? • M=mv • Momentum equals mass times velocity • What does this mean?

  12. We want to know how much of the momentum is “around” the center Angular Momentum of a point around c rcp

  13. Torque – Angular force Torque at a point

  14. Total angular momentum and moment of inertia I is the moment of inertia for the object.

  15. Moment of inertia What are the characteristics? What does large vs. small mean? How to we get this value?

  16. Relation of torque and moment of inertia

  17. Simple dynamics • Calculate/define center of mass (CM) and moment of inertia (I) • Set initial position, orientation, linear, and angular velocities • Determine all forces on the body • Linear acceleration is sum of forces divided by mass • Angular acceleration is sum of torques divided by I • Numerically integrate to update position, orientation, and velocities

  18. Object collisions • Imagine objects A and B colliding B Assume collision is point on plane A n

  19. What happens? • ??? B A n

  20. Our pal Newton… • Newton’s law of restitution for instantaneous collisions with no friction • e is a coefficient of restitution • 0 is total plastic condition, all energy absorbed • 1 is total elastic condition, all energy reflected What’s the consequence of “no friction”?

  21. Impulse felt by each object • Newton’s third law: equal and opposite forces • Force on A is jn (n is normal, j is amount of force) • Force on B is –jn • So… B We’ll need to know j A No rotation for now… n

  22. Solving for j… Then plug j into…

  23. What about rotation?

  24. How to determine the time of collision? • What do I mean? • Ideas? • Avoid “tunneling”: objects that move through each other in a time step

  25. Euler’s method We can write…

  26. The problem with Euler’s method Taylor series: We’re throwing this away! Error is O(Dt2) Half step size cuts error to ¼!

  27. Improving accuracy • Supposed we know the second derivative? But, we would like to achieve this error without computing the second derivative. We can do this using the Midpoint Method

  28. Midpoint Method • 1. Compute an Euler step • 2. Evaluate f at the midpoint • 3. Take a step using the midpoint value.

  29. Example Step 1 Step 2 Step 3

  30. Moving to 3D • Some things remain the same • Position, velocity, acceleration • Just make them 3D instead of 2D • The killer: Orientation • “It’s possible to prove that no three-scaler parameterization of 3D orientation exists that doesn’t ‘suck’, forsome suitably mathematically rigorous definition of ‘suck’.” Chris Hecker

  31. Orientation options • Quaternions • We’ll use later • Matricies • We’ll use this here.

  32. Variables • x(t) • Spatial position in time (3D) • Center of mass at time t • Assume object has center of mass at (0,0,0) • v(t) • Velocity in space • q(t) • Orientation in time (quaternion)

  33. Angular velocity • w(t) • Angular velocity at any point in time • This is a rotation rate times a rotation vector Strange, huh?

  34. Note • Angular velocity is instantaneous • We’ll compute it later in equations, but we won’t keep it around. • Angular velocity is not necessarily constant for a spinning object! • Interesting! Can you visualize why?

  35. Angular velocity and vectors • Rate of change of a vector is: • This is why they like that notation • Change is orthogonal to the normal and vector • Magnitude of change is vector length times magnitude of w

  36. Derivative of the rotation quaternion • Woa… Normalize this sucker and we can take a Newton step. Be sure to scale w(t) by Dt.

  37. Velocity of a point (think vertex) • Not just v(t), must include rotation!!! Position of point at time t: Just a reminder: Velocity of point at time t: And the magic: Angular part Linear part

  38. Force and torque • Fi(t) • Force on particle i at time t • Vector, of course Torque on point i: Total Force: Total Torque:

  39. Linear Momentum Momentum: And, the derivative of momentum is force:

  40. Angular Momentum • Angular momentum is preserved if no torque is applied. • L(t) is the angular momentum

  41. Inertia Tensor All that work typing this sucker in and it’s pretty much useless. Orientation dependent!

  42. Inertia Tensor for a base orientation

  43. Base inertia tensor to current inertia tensor Relation of angular momentum and inertia tensor:

  44. Bringing it all together • Current state: Position Orientation Linear momentum Angular momentum Velocity (may itself be updated)

  45. 3D Collisions • There are now two possible types of collisions • Not just vertex to face

  46. 3D collisions • Vertex to face • Edge to edge

  47. We need… • 3D collision detection • We’ll do that later • Determine when the collision occurred • Binary search for the time • Bisection technique

  48. Velocity at a point Position (center of gravity) Position of point Angular velocity Velocity (linear)

  49. Relative velocity Normal to object b Vertex to face: normal for face Edge to edge: cross product of edge directions Positive vrel means moving apart, ignore it Negative vrel means interpenetrating, process it What does zero vrel mean?

  50. New velocities for a and b Vector from center of mass to point Let: Normal Velocity (linear) update Mass Angular velocity update Inertia tensor inverse Equivalent equations for b

More Related