Presentation on theme: "Phun with Physics The basic ideas Vector calculus"— Presentation transcript:
1Phun with Physics The basic ideas Vector calculus Mass, acceleration, position, …
2Some defs… Kinematics Dynamics The status of an object Position, orientation, acceleration, speedDescribes the motion of objects without considering factors that cause or affect the motionDynamicsThe effects of forces on the motion of objects.
3The basics Let p(t) be the position in time. Other values: We’ll drop the (t) and just say pOther values:v – velocitya - accelerationVelocity is the derivative of positionAcceleration is the derivative of velocity
4Vector calculus Really, p(t) is a triple, right? Think of these equations as three equations, one for each dimensionThis is vector calculus
5Newton’s law and Momentum We know this one…MomentumNote: Force is the derivative of momentum
6What about real objects? Think of a real object as a bunch of points, each with a momentumWe can find a “center of mass” for the object and treat the object as a point with the total massWe have:Mass, position vector, acceleration vector, velocity vector
7Example: Air Resistance The resistance of air is proportional to the velocityF = -kvWe know F = ma, so: ma = -kvSo, how can we solve?
9What about orientation? We’ll start in 2D…Let W be the orientation (angle)Easy in 2D, not so easy in 3D we’ll be backw is the angular velocity around center of gravitya is the angular accelerationThen…
10What’s the velocity at a point? Radians are important, herePerpendicular to cpSame length!Perpendicularized radius vectorpChasles’ Theorem: Velocity at any point is the sum of linear and rotational components.
11Angular momentum Angular momentum At a point? For the whole thing? M=mvMomentum equals mass times velocityWhat does this mean?
12We want to know how much of the momentum is “around” the center Angular Momentumof a point around crcp
17Simple dynamicsCalculate/define center of mass (CM) and moment of inertia (I)Set initial position, orientation, linear, and angular velocitiesDetermine all forces on the bodyLinear acceleration is sum of forces divided by massAngular acceleration is sum of torques divided by INumerically integrate to update position, orientation, and velocities
18Object collisions Imagine objects A and B colliding Assume collision is point on planeAn
20Our pal Newton…Newton’s law of restitution for instantaneous collisions with no frictione is a coefficient of restitution0 is total plastic condition, all energy absorbed1 is total elastic condition, all energy reflectedWhat’s the consequence of “no friction”?
21Impulse felt by each object Newton’s third law: equal and opposite forcesForce on A is jn (n is normal, j is amount of force)Force on B is –jnSo…BWe’ll need to know jAnNo rotation for now…
30Moving to 3D Some things remain the same The killer: Orientation Position, velocity, accelerationJust make them 3D instead of 2DThe 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
31Orientation options Quaternions Matricies We’ll use later We’ll use this here.
32Variables x(t) v(t) q(t) Spatial position in time (3D) Center of mass at time tAssume object has center of mass at (0,0,0)v(t)Velocity in spaceq(t)Orientation in time (quaternion)
33Angular velocity w(t) Angular velocity at any point in time This is a rotation rate times a rotation vectorStrange, huh?
34Note 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?
35Angular velocity and vectors Rate of change of a vector is:This is why they like that notationChange is orthogonal to the normal and vectorMagnitude of change is vector length times magnitude of w
36Derivative of the rotation quaternion Woa…Normalize this sucker and we can take a Newton step.Be sure to scale w(t) by Dt.
37Velocity 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 partLinear part
38Force and torque Fi(t) Force on particle i at time t Vector, of course Torque on point i:Total Force:Total Torque:
39Linear MomentumMomentum:And, the derivative of momentum is force:
40Angular MomentumAngular momentum is preserved if no torque is applied.L(t) is the angular momentum
41Inertia TensorAll that work typing this sucker in and it’s pretty much useless. Orientation dependent!
47We need… 3D collision detection Determine when the collision occurred We’ll do that laterDetermine when the collision occurredBinary search for the timeBisection technique
48Velocity at a point Position (center of gravity) Position of point Angular velocityVelocity (linear)
49Relative velocity Normal to object b Vertex to face: normal for face Edge to edge: cross product of edge directionsPositive vrel means moving apart, ignore itNegative vrel means interpenetrating, process itWhat does zero vrel mean?
50New velocities for a and b Vector from center of mass to pointLet:NormalVelocity (linear) updateMassAngular velocity updateInertia tensor inverseEquivalent equations for b