1cs533d-term1-2005 Notes  Assignment 1 due today.

Slides:



Advertisements
Similar presentations
CSG and Raytracing CPSC 407.
Advertisements

Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Collision Detection CSCE /60 What is Collision Detection?  Given two geometric objects, determine if they overlap.  Typically, at least one of.
Two Methods for Fast Ray-Cast Ambient Occlusion Samuli Laine and Tero Karras NVIDIA Research.
Computational Geometry & Collision detection
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Chapter 23 Mirrors and Lenses.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
Notes Assignment questions… cs533d-winter-2005.
1cs533d-term Notes  Assignment 2 is up. 2cs533d-term Modern FEM  Galerkin framework (the most common)  Find vector space of functions that.
1Notes. 2Heightfields  Especially good for terrain - just need a 2d array of heights (maybe stored as an image)  Displacement map from a plane  Split.
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.
Asst. Prof. Yusuf Sahillioğlu
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.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 12: Spline Curves (review) Ravi Ramamoorthi Most material.
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
2003 by Jim X. Chen: Introduction to Modeling Jim X. Chen George Mason University.
Representing Geometry in Computer Graphics Rick Skarbez, Instructor COMP 575 September 18, 2007.
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.
Implicit Surfaces Tom Ouyang January 29, Outline Properties of Implicit Surfaces Polygonization Ways of generating implicit surfaces Applications.
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.
Feature Sensitive Surface Extraction from Volume Data Leif P. Kobbelt Mario Botsch Ulrich Schwanecke Hans-Peter Seidel Computer Graphics Group, RWTH-Aachen.
1cs533d-term Notes  list Even if you’re just auditing!
Adaptively Sampled Distance Fields (ADFs) A General Representation of Shape for Computer Graphics S. Frisken, R. Perry, A. Rockwood, T. Jones Richard Keiser.
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.
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)
Chapter 23 Mirrors and Lenses.
Notes, part 4 Arclength, sequences, and improper integrals.
1 Numerical geometry of non-rigid shapes Non-Euclidean Embedding Non-Euclidean Embedding Lecture 6 © Alexander & Michael Bronstein tosca.cs.technion.ac.il/book.
1Notes. 2 Time integration for particles  Back to the ODE problem, either  Accuracy, stability, and ease-of- implementation are main issues  Obviously.
CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”
Week 13 - Wednesday CS361.
Computer Graphics Lecture 13 Curves and Surfaces I.
A b c Gauss' Law.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
COMP 175: Computer Graphics March 24, 2015
Ch. 10 Vector Integral Calculus.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Spline curves 1/23 Curves and Surfaces.
GEOMETRY PRETEST REVIEW Reviewing skills needed to succeed in Geometry. Day 1.
COMPUTER AIDED DESIGN -(CAD)-3
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
Week 13 - Monday.  What did we talk about last time?  Exam 2!  Before that…  Polygonal techniques ▪ Tessellation and triangulation  Triangle strips,
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Course 13 Curves and Surfaces. Course 13 Curves and Surface Surface Representation Representation Interpolation Approximation Surface Segmentation.
12/4/2001CS 638, Fall 2001 Today Managing large numbers of objects Some special cases.
Chapter 36 Image Formation.
Real-time Graphics for VR Chapter 23. What is it about? In this part of the course we will look at how to render images given the constrains of VR: –we.
Copyright © Curt Hill Visualization of 3D Worlds How are these images described?
1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 6, 2002 Day 10.
A Computationally Efficient Framework for Modeling Soft Body Impact Sarah F. Frisken and Ronald N. Perry Mitsubishi Electric Research Laboratories.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
1 Visiblity: Culling and Clipping Computer Graphics COMP 770 (236) Spring 2009 January 21 & 26: 2009.
Controlling a Virtual Camera Ross Ptacek University of Alabama Birmingham.
In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings.
Volume and Solid Modeling
3D Object Representations 2011, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
INTEGRALS We saw in Section 5.1 that a limit of the form arises when we compute an area. We also saw that it arises when we try to find the distance traveled.
Solid Modeling Dr. Scott Schaefer.
3D Object Representations 2009, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
3D Object Representations
Chapter 4.2 Collision Detection and Resolution
GPAT – Chapter 7 Physics.
Presentation transcript:

1cs533d-term Notes  Assignment 1 due today

2cs533d-term Geometry  The plane is easy Interference: y<0 Collision: y became negative Normal: constant (0,1,0)  Can work out other analytic cases (e.g. sphere)  More generally: triangle meshes and level sets Heightfields sometimes useful - permit a few simplifications in speeding up tests - but special case Splines and subdivision surfaces generally too complicated, and not worth the effort Blobbies, metaballs, and other implicits are usually not as well behaved as level sets Point-set surfaces: becoming a hot topic

3cs533d-term Implicit Surfaces  Define surface as where some scalar function of x,y,z is zero: {x,y,z | F(x,y,z)=0}  Interior (can only do closed surfaces!) is where function is negative {x,y,z | F(x,y,z)<0}  Outside is where it’s positive {x,y,z | F(x,y,z)>0}  Ground is F=y  Example: F=x 2 +y 2 +z 2 -1 is the unit sphere

4cs533d-term Testing Implicit Surfaces  Interference is simple: Is F(x,y,z)<0?  Collision is a little trickier: Assume constant velocity x(t+h)=x(t)+hv Then solve for h: F(x(t+h))=0 This is the same as ray-tracing implicit surfaces… But if moving, then need to solve F(x(t+h), t+h)=0 Try to bound when collision can occur (find a sign change in F) then use secant search

5cs533d-term Implicit Surface Normals  Outward normal at surface is just  Most obvious thing to use for normal at a point inside the object (or anywhere in space) is the same formula Gradient is steepest-descent direction, so hopefully points to closest spot on surface: direction to closest surface point is parallel to normal there We really want the implicit function to be monotone as we move towards/away from the surface

6cs533d-term Building Implicit Surfaces  Planes and spheres are useful, but want to be able to represent (approximate) any object  Obviously can write down any sort of functions, but want better control Exercise: write down functions for some common shapes (e.g. cylinder?)  Constructive Solid Geometry (CSG) Look at set operations on two objects  [Complement, Union, Intersection, …] Using primitive F()’s, build up one massive F() But only sharp edges…

7cs533d-term Getting back to particles  “Metaballs”, “blobbies”, …  Take your particle system, and write an implicit function: Kernel function f is something smooth like a Gaussian Strength  and radius r of each particle (and its position x) are up to you Threshold t is also up to you (controls how thick the object is)  See make_blobbies for one choice…

8cs533d-term Problems with these  They work beautifully for some things! Some machine parts, water droplets, goo, …  But, the more complex the surface, the more expensive F() is to evaluate Need to get into more complicated data structures to speed up to acceptable  Hard to directly approximate any given geometry  Monotonicity - how reliable is the normal?

9cs533d-term Signed Distance  Note infinitely many different F represent the same surface  What’s the nicest F we can pick?  Obviously want smooth enough for gradient (almost everywhere)  It would be nice if gradient really did point to closest point on surface  Really nice (for repulsions etc.) if value indicated how far from surface  The answer: signed distance

10cs533d-term Defining Signed Distance  Generally use the letter  instead of F  Magnitude is the distance from the surface Note that function is zero only at surface  Sign of  (x) indicates inside ( 0)  [examples: plane, sphere, 1d]

11cs533d-term Closest Point Property  Gradient is steepest-ascent direction Therefore, in direction of closest point on surface (shortest distance between two points is a straight line)  The closest point is by definition distance |  | away  So closest point on surface from x is

12cs533d-term Unit Gradient Property  Look along line from closest point on surface to x  Value is distance along line  Therefore directional derivative is 1:  But plug in the formula for n [work out]  So gradient is unit length:

13cs533d-term Aside: Eikonal equation  There’s a PDE! Called the Eikonal equation Important for all sorts of things Later in the course: figure out signed distance function by solving the PDE…

14cs533d-term Aside: Spherical particles  We have been assuming our particles were just points  With signed distance, can simulate nonzero radius spheres Sphere of radius r intersects object if and only if  (x)<r i.e. if and only if  (x)-r<0 So looks just like points and an “expanded” version of the original implicit surface - normals are exactly the same, …

15cs533d-term Level Sets  Use a discretized approximation of   Instead of carrying around an exact formula store samples of  on a grid (or other structure)  Interpolate between grid points to get full definition (fast to evaluate!) Almost always use trilinear [work out]  If the grid is fine enough, can approximate any well-behaved closed surface But if the features of the geometry are the same size as the grid spacing or smaller, expect BAD behaviour  Note that properties of signed distance only hold approximately!

16cs533d-term Building Level Sets  We’ll get into level sets more later on Lots of tools for constructing them from other representations, for sculpting them directly, or simulating them…  For now: can assume given  Or CSG: union and intersection with min and max [show 1d] Just do it grid point by grid point Note that weird stuff could happen at sub-grid resolution (with trilinear interpolation)  Or evaluate from analytical formula

17cs533d-term Normals  We do have a function F defined everywhere (with interpolation) Could take its gradient and normalize But (with trilinear) it’s not smooth enough  Instead use numerical approximation for gradient: Then, use trilinear interpolation to get (continuous) approximate gradient anywhere Or instead apply finite difference formula to 6 trilinearly interpolated points (mathematically equivalent) Normalize to get unit-length normal

18cs533d-term Evaluating outside the grid  Check if evaluation point x is outside the grid  If outside - that’s enough for interference test  But repulsion forces etc. may need an actual value  Most reasonable extrapolation: A = distance to closest point on grid B =  at that point Lower bound on distance, correct asymptotically and continuous (if level set doesn’t come to boundary of grid): Or upper bound on distance:

19cs533d-term Triangles  Given x 1, x 2, x 3 the plane normal is  Interference with a closed mesh Cast a ray to infinity, parity of number of intersections gives inside/outside  So intersection is more fundamental The same problem as in ray-tracing

20cs533d-term Triangle intersection  The best approach: reduce to simple predicates Spend the effort making them exact, accurate, or at least consistent Then it’s just some logic on top Common idea in computational geometry  In this case, predicate is sign of signed volume (is a tetrahedra inside-out?)

21cs533d-term Using orient()  Line-triangle If line includes x 4 and x 5 then intersection if orient(1,2,4,5)=orient(2,3,4,5)=orient(3,1,4,5) I.e. does the line pass to the left (right) of each directed triangle edge? If normalized, the values of the determinants give the barycentric coordinates of plane intersection point  Segment-triangle Before checking line as above, also check if orient(1,2,3,4) != orient(1,2,3,5) I.e. are the two endpoints on different sides of the triangle?

22cs533d-term Other Standard Approach  Find where line intersects plane of triangle  Check if it’s on the segment  Find if that point is inside the triangle Use barycentric coordinates  Slightly slower, but worse: less robust round-off error in intermediate result: the intersection point What happens for a triangle mesh?  Note the predicate approach, even with floating- point, can handle meshes well Consistent evaluation of predicates for neighbouring triangles

23cs533d-term Distance to Triangle  If surface is open, define interference in terms of distance to mesh  Typical approach: find closest point on triangle, then distance to that point Direction to closest point also parallel to natural normal  First step: barycentric coordinates Normalized signed volume determinants equivalent to solving least squares problem of closest point in plane  If coordinates all in [0,1] we’re done  Otherwise negative coords identify possible closest edges  Find closest points on edges

24cs533d-term Testing Against Meshes  Can check every triangle if only a few, but too slow usually  Use an acceleration structure: Spatial decomposition: background grid, hash grid, octree, kd-tree, BSP-tree, … Bounding volume hierarchy: axis-aligned boxes, spheres, oriented boxes, …

25cs533d-term Moving Triangles  Collision detection: find a time at which particle lies inside triangle  Need a model for what triangle looks like at intermediate times Simplest: vertices move with constant velocity, triangle always just connects them up  Solve for intermediate time when four points are coplanar (determinant is zero) Gives a cubic equation to solve  Then check barycentric coordinates at that time See e.g. X. Provot, “Collision and self-collision handling in cloth model dedicated to design garment", Graphics Interface’97

26cs533d-term For Later…  We now can do all the basic particle vs. object tests for repulsions and collisions  Once we get into simulating solid objects, we’ll need to do object vs. object instead of just particle vs. object  Core ideas remain the same