Developing An Educational Rigid Body Dynamics Physics Engine By Neal Milstein.

Slides:



Advertisements
Similar presentations
AP Physics C Mechanics Review.
Advertisements

Lectures D25-D26 : 3D Rigid Body Dynamics
Review Chap. 8 Momentum, Impulse, and Collisions
R2-1 Physics I Review 2 Review Notes Exam 2. R2-2 Work.
Chapter 12: Momentum 12.1 Momentum
Manipulator Dynamics Amirkabir University of Technology Computer Engineering & Information Technology Department.
Summer School 2007B. Rossetto1 5. Kinematics  Piecewise constant velocity t0t0 tntn titi t i+1 x(t) x(t i ) h t x i = v(t i ). h Distance runned during.
Rotational Equilibrium and Rotational Dynamics
Momentum Impulse, Linear Momentum, Collisions Linear Momentum Product of mass and linear velocity Symbol is p; units are kgm/s p = mv Vector whose direction.
Physics 111: Mechanics Lecture 10 Dale Gary NJIT Physics Department.
Rotational Equilibrium and Rotational Dynamics
Rotational Dynamics and Static Equilibrium. Torque From experience, we know that the same force will be much more effective at rotating an object such.
Chapter 8 Rotational Equilibrium and Rotational Dynamics.
© 2005 Pearson Prentice Hall This work is protected by United States copyright laws and is provided solely for the use of instructors in teaching their.
Dynamics of Articulated Robots Kris Hauser CS B659: Principles of Intelligent Robot Motion Spring 2013.
1Notes  Demetri Terzopoulos talk: Thursday, 4pm Dempster 310.
Game Physics Chris Miles. The Goal To learn how to create game objects with realistic physics models To learn how to simulate aspects of reality in order.
Chapter 6 Momentum and Collisions. Momentum The linear momentum of an object of mass m moving with a velocity v is defined as the product of the mass.
Rigid Bodies Rigid Body = Extended body that moves as a unit Internal forces maintain body shape Mass Shape (Internal forces keep constant) Volume Center.
Manipulator Dynamics Amirkabir University of Technology Computer Engineering & Information Technology Department.
Physics 106: Mechanics Lecture 02
1 Class #6 Center of Mass Defined Relation to momentum Worked problems DVD Demonstration on momentum cons. and CM motion Angular Momentum And moment of.
Computer-Based Animation. ● To animate something – to bring it to life ● Animation covers all changes that have visual effects – Positon (motion dynamic)
Computer graphics & visualization Rigid Body Simulation.
Linear Momentum and Collisions
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Physically Based Animation.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Newton’s 1 st Law of Mechanics A particle will continue is a straight line at constant speed unless acted upon by a net push or pull (i.e. force). The.
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
Chapter 9: Rotational Dynamics
Copyright © 2010 Pearson Education, Inc. Lecture Outline Chapter 11 Physics, 4 th Edition James S. Walker.
© 2007 Pearson Prentice Hall This work is protected by United States copyright laws and is provided solely for the use of instructors in teaching their.
Review for Test #3  Responsible for: - Chapters 9 (except 9.8), 10, and 11 (except 11.9) - The spring (6.2, 7.3, ) - Problems worked in class,
STATICS AND DYNAMICS 4TH ESO Chemistry and Physics IES AMES.
Equations for Projectile Motion
Lecture Fall 2001 Physically Based Animation Ordinary Differential Equations Particle Dynamics Rigid-Body Dynamics Collisions.
Chapter 8 Rotational Motion.
Momentum The linear momentum of an object of mass m moving with a velocity is defined as the product of the mass and the velocity SI Units are kg m / s.
Chapter 17 PLANE MOTION OF RIGID BODIES: ENERGY AND MOMENTUM METHODS
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Physics for Games Spring 2012.
Chapter 6 Momentum and Collisions. Momentum The linear momentum of an object of mass m moving with a velocity is defined as the product of the mass and.
Two-Dimensional Rotational Dynamics
Chapter 6 Momentum and Collisions. Momentum The linear momentum of an object of mass m moving with a velocity is defined as the product of the mass and.
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
Chapter 6 Momentum and Collisions. Momentum The linear momentum of an object of mass m moving with a velocity v is defined as the product of the mass.
Developing An Educational Rigid Body Dynamics Physics Engine By Neal Milstein.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Rigid Body Dynamics CSE169: Computer Animation
Linear Momentum and Collisions
Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’
Particle Kinematics Direction of velocity vector is parallel to path Magnitude of velocity vector is distance traveled / time Inertial frame – non accelerating,
MEC 0011 Statics Lecture 4 Prof. Sanghee Kim Fall_ 2012.
Plane Dynamics of Rigid Bodies
PHY 151: Lecture 9B 9.5 Collisions in Two Dimensions 9.6 The Center of Mass 9.7 Systems of Many Particles 9.8 Deformable Systems 9.9 Rocket Propulsion.
Advanced Computer Graphics Rigid Body Simulation
Physically Based Simulations For Games
Manipulator Dynamics 1 Instructor: Jacob Rosen
Mechanics Review – SEMESTER 1
Lecture Rigid Body Dynamics.
College Physics, 7th Edition
Rigid Body Dynamics Simulation
Honors Physics 1 Class 12 Fall 2013
Manipulator Dynamics 2 Instructor: Jacob Rosen
Lecture Outline Chapter 11 Physics, 4th Edition James S. Walker
Lecture Outline Chapter 11 Physics, 4th Edition James S. Walker
Computer Animation Algorithms and Techniques
GPAT – Chapter 7 Physics.
Presentation transcript:

Developing An Educational Rigid Body Dynamics Physics Engine By Neal Milstein

Abstract Goal of Project: To create a rigid-body dynamics physics engine in order to allow physics students to visualize and solve physics models. Rigid-body dynamics: The study of the motion of non- deformable, free-moving bodies through space.

Abstract (continued) Engine Focus on accuracy and speed Algorithms Used: Runge-Kutta 4, Separate Axis Theorem, collision response via grids of ellipses Interface Focus on education, straightforwardness, and free flow

Introduction Proper visualization of physical models required to properly understand physics concepts. Computers are used because they replace real-life simulations and have less error margin My project: simulates rigid bodies and their interactions in two-dimensional space

Micro vs. Macro Physics engines – Present the unique problem of combining small-scale physical rigid-body oriented interactions with large-scale physics engine design Micro – Small-scale interactions, algorithms, and designs. e.g. Separate Axis Theorem, Hooke’s Law Macro – Large-scale design paradigms, architectural patterns. e.g. model-view-controller, separation of interactions from graphics.

Background - Separating Axis Theorem A line can always be drawn between two concave non- intersecting bodies What this means: objects are colliding if and only if all separating axes are colliding

Background – Runge-Kutta 4 Integration Uses weighted average of past slope measurements to estimate h, the best slope estimate for the differential equation at the given time interval. Much more accurate then Euler’s method, especially over large time step. Can be used in combination with optimization techniques to calculate differential over many objects.

Development – Model-View- Controller Separated into Model, View, and Controller (MVC design) Model - Storage structure for physical components. Includes ways components are grouped and their connections with each other. View - GUI to which components are displayed. Reads component models and outputs them to screen. Includes User Interface Controller - Manipulates Models and prepares them for the view. Includes physics engine and physical interactions between models.

Development – First step: Model Model, underlying structure of physical objects, was developed first. Made up of classes that store information, with not too many functional methods (by design)

Example of a Model Class package model; public abstract class Body extends Element implements Referenceable, Massable, Anchorable, Collideable { protected Reference reference; protected double mass; protected boolean isAnchored; private boolean colliding = false; public Body(Reference reference, double mass) { this.reference = reference; this.mass = mass; isAnchored = false; } public Body(Reference reference, double mass, boolean isAnchored) { this.reference = reference; this.mass = mass; this.isAnchored = isAnchored; } public void addForce(double forceMag, Vector direction) { double acceleration = forceMag / mass; this.getReference().addAcceleration(new Vector(acceleration, direction)); }

Development – Controller Implementation Increases time step Cycles through Interacter objects and calls their interact() method Passes the model as an argument to the Graphical User Interface Some current Interacters: CollisionInteracter (Separating Axis Theorem) SpringInteracter (Hooke’s Law) ReferenceableInteracter (Runge-Kutta 4)

Example of an Interacter Class public class SpringInteracter extends Interacter { public SpringInteracter(Model model) { super(model); } public void interact() { for (Element e : model) { if (e instanceof Spring) { Spring s = (Spring)e; double forceMag = s.getForce(); Vector direction = s.getBodyA().getReference().getPosition().minus(s.getBodyB().getReference().getPosition()); s.getBodyA().addForce(forceMag, direction); s.getBodyB().addForce(forceMag, direction.getNegative()); }

Collision Response Generally involve calculations such as rotational momentum, moment of inertia, and conservation of energy My physics engine uses “grids” of elliptical bodies to simulate the responses to these collisions

Collision Response (Continued) An example of the ellipses grids used to detect collisions. Here, a collision is simulated (programmatically) with the light blue ellipse, which then drags the rest of the shape along with it.

Collision Response (Continued) Drag forces Use drag formula to prevent objects from continuously moving When coupled with a high spring constant, collision response is quite accurate

Development - View Graphical User Interface View.render(Model model) method called every time step View draws the model to the screen Also contains interface buttons that feed commands back to the controller

Results Easily create new simulations just by drawing the objects to the GUI or programmatically defining them Demonstrated Conservation of Energy – Center of Mass always in center of screen.

Functionality Detect Collisions via the Separate Axis Theorem – collision response (dynamics) on the way Simulate tension interactions with Hooke’s Law 2-D motion accurate due to Runge- Kutta 4 Draw Bodies on screen, have them connected with springs Simulate any number of bodies in any configuration

Testing Results Online models of predefined physics problems Physics textbook problems that can be solved by hand Testing Conservation of Energy or Momentum

Conclusions If properly modularized, physics engines can be expandable and scalable. Key is in separation of programming areas (model from view from controller) Many physics formulas take new forms in computers.