1Notes. 2Heightfields  Especially good for terrain - just need a 2d array of heights (maybe stored as an image)  Displacement map from a plane  Split.

Slides:



Advertisements
Similar presentations
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Advertisements

Chapter 15 Oscillations Who breaks the glass?! (credit: metaist.com)
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
1cs533d-winter-2005 Notes  Please read O'Brien and Hodgins, "Graphical modeling and animation of brittle fracture", SIGGRAPH '99 O'Brien, Bargteil and.
1cs533d-term Notes  Assignment 1 due today.
1cs533d-term Notes  For using Pixie (the renderer) make sure you type “use pixie” first  Assignment 1 questions?
1Notes. 2 Building implicit surfaces  Simplest examples: a plane, a sphere  Can do unions and intersections with min and max  This works great for.
1cs533d-term Notes  Required reading: Baraff & Witkin, “Large steps in cloth animation”, SIGGRAPH’98 Grinspun et al., “Discrete shells”, SCA’03.
1cs533d-winter-2005 Notes. 2 Numerical Implementation 1  Get candidate x(t+∆t)  Check to see if x(t+∆t) is inside object (interference)  If so Get.
1Notes. 2 Triangle intersection  Many, many ways to do this  Most robust (and one of the fastest) is to do it based on determinants  For vectors a,b,c.
1Notes  Text:  Motion Blur A.3  Particle systems 4.5 (and 4.4.1, 6.6.2…)  Implicit Surfaces  Classic particle system papers  W. Reeves, “Particle.
1Notes  Reference  Witkin and Baraff, “Physically Based Modelling” course, SIGGRAPH 2001  Link on the course website.
Asst. Prof. Yusuf Sahillioğlu
Particle Systems 1 Adapted from: E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012.
Collision Detection CSE 191A: Seminar on Video Game Programming Lecture 3: Collision Detection UCSD, Spring, 2003 Instructor: Steve Rotenberg.
1cs533d-winter-2005 Notes  More optional reading on web for collision detection.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
1 Geometry A line in 3D space is represented by  S is a point on the line, and V is the direction along which the line runs  Any point P on the line.
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
1cs426-winter-2008 Notes  Course project: Will be due at the end of the term You can do it in pairs Create an animation that combines an algorithm for.
1cs533d-term Notes  list Even if you’re just auditing!
1cs533d-winter-2005 Notes  Some example values for common materials: (VERY approximate) Aluminum: E=70 GPa =0.34 Concrete:E=23 GPa =0.2 Diamond:E=950.
Ray Tracing Outline For each pixel { Shoot ray r from eye to center of pixel with trace( r ) } function trace( r ) For each object { Find object with closest.
1cs533d-term Notes. 2 Poisson Ratio  Real materials are essentially incompressible (for large deformation - neglecting foams and other weird composites…)
1cs533d-term Notes  Typo in test.rib --- fixed on the web now (PointsPolygon --> PointsPolygons)
Particle Systems Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
1cs533d-winter-2005 Notes  Assignment 2 instability - don’t worry about it right now  Please read D. Baraff, “Fast contact force computation for nonpenetrating.
Collision Detection CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
1Notes. 2 Time integration for particles  Back to the ODE problem, either  Accuracy, stability, and ease-of- implementation are main issues  Obviously.
And Oscillations. Objectives Oscillations Typical example - a simple pendulum (a mass attached to a vertical string). When the mass is displaced to one.
Mechanical Energy and Simple Harmonic Oscillator 8.01 Week 09D
Computer graphics & visualization Collision Detection – Narrow Phase.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
COMP 175: Computer Graphics March 24, 2015
Collision handling: detection and response
CS 325 Introduction to Computer Graphics 04 / 26 / 2010 Instructor: Michael Eckmann.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Collisions & Contact.
Week 13 - Monday.  What did we talk about last time?  Exam 2!  Before that…  Polygonal techniques ▪ Tessellation and triangulation  Triangle strips,
Collision/Acceleration University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Oscillations About Equilibrium. 7.1 Periodic Motion.
Example How far from the earth's surface must an astronaut in space be if she is to feel a gravitational acceleration that is half what she would feel.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Particle Systems.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Physics for Games Spring 2012.
Ray Tracer Spring 2008 Help Session. Outline Project Web Resources What do you have to do for this project? Ray Class Isect Class Requirements Tricks.
Basic Ray Tracing CMSC 435/634.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Modeling Transient Response So far our analysis has been purely kinematic: The transient response has been ignored The inertia, damping, and elasticity.
Game Technology Animation V Generate motion of objects using numerical simulation methods Physically Based Animation.
Physics 1D03 - Lecture 26 Collisions Conservation of Momentum Elastic and inelastic collisions.
Physics Chapter 7 Forces and Motion in Two Dimensions.
Motion in Two and Three Dimensions Chapter 4. Position and Displacement A position vector locates a particle in space o Extends from a reference point.
Particle Systems Ed Angel Professor Emeritus of Computer Science
Classical Mechanics Lagrangian Mechanics.
2. Motion 2.1. Position and path Motion or rest is relative.
Chapter 4.2 Collision Detection and Resolution
Collision handling: detection and response
Representing Motion Chapter 2.
Motion in Real and Virtual Worlds
Particle Systems Ed Angel
Collision Detection CSE169: Computer Animation
Computer Animation Algorithms and Techniques
Further Mechanics 1 : Elastic Collisions in Two Dimensions
Energy Problems.
Further Mechanics 1 : Elastic Collisions in Two Dimensions
GPAT – Chapter 7 Physics.
Presentation transcript:

1Notes

2Heightfields  Especially good for terrain - just need a 2d array of heights (maybe stored as an image)  Displacement map from a plane  Split up plane into triangles  Particle inside:  Figure out which triangle (x,y) belongs to, check z against equation of triangle’s plane  Trajectory cross (stationary heightfield):  Check all triangles along path (use 2d line-drawing algorithm to figure out which cells to check)  Object normal: get from triangle  Distance etc.: not so easy, but vertical distance easy for shallow heightfields

3 Triangle mesh  For any decent size, need to use an acceleration structure  Could use background (hash-)grid, octree, kd-tree  Also can use bounding volume (BV) hierarchy  Spheres, axis-aligned bounding boxes, oriented bounding boxes, polytopes, …  More exotic structures exist…  Particle inside (closed mesh):  Shoot a ray out to infinity, count the number of crossings  Trajectory cross (stationary mesh):  For each candidate triangle (from acceleration) check a sequence of determinants

4 Triangle intersection  Many, many ways to do this  Most robust (and one of the fastest) is to do it based on determinants  For vectors a,b,c define  Det(a,b,c)=±6 volume(tet(a,b,c)), the signed volume of the tetrahedron spanned by edges a,b,c from a common point  Sign flips when tetrahedron reflected, or alternatively from right-hand-rule on a  bc  Triangle intersection boils down to  2 sign checks: segment crosses plane  3 sign checks: line goes through triangle

5 Triangle Mesh (more)  Object normal  Normalize cross-product of two sides of the triangle  Distance from single triangle  Find barycentric coordinates -- solve a least- squares problem  Need to clip to sides of triangle  Compute distance from that point  Note: also gives direction to closest point  Distance (and direction) from mesh  Compute for all possible triangles, take minimum  Trick is to find small list of possible triangles with acceleration structure

6 Implicit Surface  Simple function, metaballs, or interpolated from 3d grid (“level set”)  Recall - for metaballs need acceleration  Particle inside: f(x)<0  Trajectory cross:  Just like ray-tracing - use secant method  Object normal:  f/|  f |  Distance from surface:  If f() is signed distance, then trivial  Otherwise, painful, but f() might be good enough for application

7 Back to particle collisions  So now we can represent other geometry, how do we do a repulsion velocity field?  v(x)=f(distance(x)) * n(x)  n(x) is the outward direction (=normal on surface)  f is some decreasing function that drops towards zero far away  Exponential f(d)=e -k*d  Or linear drop, truncated to zero: f(d)=max(0,m-k*d)  Or more complicated  Outward direction is plus/minus direction to closest point  Aside: useful for more than just collisions - e.g. fire particles streaming out of an object

8 Force-based repulsions  Can do exactly the same trick for force- based motion  Add repulsion field to F(x)  Simple, often works, but there are sometimes problems  What are you trying to model?  Robustness - high velocity impacts can penetrate arbitrarily far  High velocity impacts may go straight through thin objects  How much of a rebound do you want?

9 Damped repulsions  Think of repulsion force as a generalized spring  Add spring damping:  D is some parameter you set  n(x) is the outward direction again

10 Aside: springs and damping  How do you come up with reasonable values for spring constants and damping constants?  And how do you pick good step sizes for differential equation solver (Forward Euler etc.)  Look at 1D simplified model  Ma=F=-Kx-Dv  M is the mass, K is like a spring stiffness, D is the damping parameter  Solve it analytically

11 Critical Damping  Three cases:  Underdamped (D 2 -4MK<0)  Oscillation with frequency  Characteristic time:  Exponentially decays at rate  Characteristic time:  Overdamped (D 2 -4MK>0)  No continued oscillation  Exponentially decays at rates  Characteristic times:  Critically damped (D 2 -4MK=0)  No continued oscillation  Fastest decay possible at rate  Characteristic time:

12 Numerical time steps  Should be proportional to minimum characteristic time  Implicit methods like Backwards Euler actually let you take larger steps with stability, but wipe out all hope of accuracy for things with small characteristic time  For nonlinear multi-dimensional forces, what are K and D?  Estimate them by figuring out what is the fastest |F| can change if you modify x or v respectively  This is all very approximate, so don’t get hung up on getting the “right” answer  Will ultimately need a fudge factor anyhow (from experiments)

13 True Collisions  Turn attention from repulsions for a while  Model collision as a discrete event - a bounce  Input: incoming velocity, object normal  Output: outgoing velocity  Need some idea of how “elastic” the collision  Fully elastic - reflection  Fully inelastic - sticks (or slides)  Let’s ignore friction for now  Let’s also ignore how to incorporate it into algorithm for moving particles for now

14 Newtonian Collisions  Say object is stationary, normal at point of impact is n  Incoming particle velocity is v  Split v into normal and tangential components:  Newtonian model for outgoing velocity  Unchanged tangential component v T  New normal component is  The “coefficient of restitution” is , ranging from 0 (inelastic) to 1 (perfectly elastic)  The final outgoing velocity is

15 Relative velocity in collisions  What if particle hits a moving object?  Now process collision in terms of relative velocity  v rel =v particle -v object  Take normal and tangential components of relative velocity  Reflect normal part appropriately to get new v rel  Then new v particle =v object +(new v rel )