1 / 65

General Triangle Models: Representations and Collision

General Triangle Models: Representations and Collision. David Johnson. Triangle Models. Boundary-representation (B-rep) Collection of surfaces to represent a volume Manifold Closed model Every edge has two triangles. Polygon Modeling.

galya
Download Presentation

General Triangle Models: Representations and Collision

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. General Triangle Models:Representations and Collision David Johnson

  2. Triangle Models • Boundary-representation (B-rep) • Collection of surfaces to represent a volume • Manifold • Closed model • Every edge has two triangles

  3. Polygon Modeling • Polygons are the dominant force in modeling for real-time graphics • Why?

  4. Polygons Dominate • Everything can be turned into polygons (almost everything) • Normally an error associated with the conversion, but with time and space it may be possible to reduce this error • We know how to render polygons quickly • Many operations are easy to do with polygons • Memory and disk space is cheap • Simplicity and inertia

  5. What’s Bad About Polygons? • What are some disadvantages of polygonal representations?

  6. Polygons Aren’t Great • They are always an approximation to curved surfaces • But can be as good as you want, if you are willing to pay in size • Normal vectors are approximate • They throw away information • They can be very unstructured • They are hard to globally parameterize • How do we parameterize them for texture mapping? • It is difficult to perform many geometric operations

  7. Polygon Meshes • A mesh is a set of polygons connected to form an object • A mesh has several components, or geometric entities: • Faces • Edges, the boundary between faces • Vertices, the boundaries between edges, or where three or more faces meet • Normals, Texture coordinates, colors, shading coefficients, etc • Some components are implicit, given the others • For instance, given faces and vertices can determine edges

  8. Polygonal Data Structures • Polygon mesh data structures are application dependent • Different applications require different operations to be fast • Find the neighbor of a given face • Find the faces that surround a vertex • You typically choose: • Which features to store explicitly (vertices, faces, normals, etc) • Which relationships you want to be explicit (vertices belonging to faces, neighbors, faces at a vertex, etc)

  9. Triangle Meshes • We will look at triangle mesh data structures • Can triangulate general polygon

  10. Triangle Soup • Many models are just lists of triangles • What does the model below look like in a floating point computer? T4 T1: v1, v2, v3 T2: v4, v5, v6 T3: v7, v8, v9 T4: v10, v11, v12 etc… T6 T1 T5 T2 T3

  11. Triangle Soup • No connection between triangles • Some models are produced like this, so may have to work with it T4 T1: v1, v2, v3 T2: v4, v5, v6 T3: v7, v8, v9 T4: v10, v11, v12 etc… T6 T1 T5 T2 T3

  12. Triangle Soup Evaluation • What are the advantages? • It’s very simple to read, write, transmit, etc. • A common output format from CAD modelers • BIG disadvantage: No higher order information • No information about neighbors • No open/closed information • No guarantees on degeneracies/manifoldness

  13. Vertex-Face Mesh v0 v4 • There are reasons not to store the vertices explicitly at each polygon • Wastes memory - each vertex repeated many times • Very messy to find neighboring polygons • Difficult to ensure that polygons meet correctly • Solution: Indirection • Put all the vertices in a list • Each face stores the list indices of its vertices • Advantages? Disadvantages? vertices v0 v1 v2 v3 v4 v1 faces 0 2 1 0 1 4 1 2 3 1 3 4 v2 v3

  14. Vertex-Face Evaluation • Advantages: • Saving in storage: • Vertex index might be only 2 bytes, and a vertex is probably 12 bytes • Each vertex gets used at least 3 and generally 4-6 times, but is only stored once • Normals, texture coordinates, colors etc. can all be stored the same way • Disadvantages: • Connectivity information is not explicit • How would you find a neighbor face/shared vertex?

  15. Add more data • Face data structure • Face: • Neighbors = [find1, find2, find3] • Vertices = [vind1, vind2, vind3] • Vertex: • Coords = [x,y,z] • Neighborfaces = [find1,..,findn];

  16. Some problems • Edges are implicit • Number of neighbors to vertex is variable • Use vertex-edge-face structures • Winged edge • Half-edge

  17. Half-edge • Half-edge • leading vertex • Face on left • Edge ahead • Flipped Edge • Everything points to one thing

  18. Collision Methods for Triangle Models • Models may have millions of triangles • For two models with m and n triangles • Brute force: m*n triangle-triangle intersections • > 1012 intersection computations for two objects • Need an acceleration structure

  19. Bounding Volumes • Objects are often not colliding • Need fast reject for this case • Surround with some bounding object • Like a sphere • Why stop with one layer of rejection testing? • Build a bounding volume hierarchy (BVH) • A tree

  20. Bounding Volume Hierarchies • Model Hierarchy: • each node has a simple volume that bounds a set of triangles • children contain volumes that each bound a different portion of the parent’s triangles • The leaves of the hierarchy usually contain individual triangles • A binary bounding volume hierarchy:

  21. BVH-Based Collision Detection

  22. Type of Bounding Volumes • Spheres • Ellipsoids • Axis-Aligned Bounding Boxes (AABB) • Oriented Bounding Boxes (OBBs) • Convex Hulls • k-Discrete Orientation Polytopes (k-dop) • Spherical Shells • Swept-Sphere Volumes (SSVs) • Point Swetp Spheres (PSS) • Line Swept Spheres (LSS) • Rectangle Swept Spheres (RSS) • Triangle Swept Spheres (TSS)

  23. Observations • Simple primitives (spheres, AABBs, etc.) do very well with respect to the overlap cost. But they cannot fit some long skinny primitives tightly. • More complex primitives (minimal ellipsoids, OBBs, etc.) provide tight fits, but checking for overlap between them is relatively expensive. • Cost of BV updates needs to be considered.

  24. Convex Hull AABB OBB Sphere 6-dop Trade-off in Choosing BV’s increasing complexity & tightness of fit decreasing cost of (overlap tests + BV update)

  25. Bounding Volume Hierarchies (Example: Spheres, PSS)

  26. Bounding Volume Hierarchies (Example: AABB)

  27. Bounding Volume Hierarchies (Example: k-DOPs, k=6,14,18,26) Level 0 Note: k=6 is a AABB.

  28. Bounding Volume Hierarchies (Example: k-DOPs, k=6,14,18,26) Level 1

  29. Bounding Volume Hierarchies (Example: k-DOPs, k=6,14,18,26) Level 2

  30. Bounding Volume Hierarchies (Example: k-DOPs, k=6,14,18,26) Level 5

  31. Bounding Volume Hierarchies (Example: k-DOPs, k=6,14,18,26) Level 8

  32. Building Hierarchies • Choices of Bounding Volumes • cost function & constraints • Top-Down vs. Bottom-up • speed vs. fitting • Depth vs. breadth • branching factors • Splitting factors • where & how

  33. Sphere-Trees • A sphere-tree is a hierarchy of sets of spheres, used to approximate an object • Advantages: • Simplicity in checking overlaps between two bounding spheres • Invariant to rotations and can apply the same transformation to the centers, if objects are rigid • Shortcomings: • Not always the best approximation (esp bad for long, skinny objects) • Lack of good methods on building sphere-trees

  34. Methods for Building Sphere-Trees • “Tile” the triangles and build the tree bottom-up • Covering each vertex with a sphere and group them together • Compute the medial axis and use it as a skeleton for multi-res sphere-covering • Others……

  35. Recursive top-down construction: partition and refit Building an OBBTree

  36. Given some polygons, consider their vertices... Building an OBB Tree

  37. … and an arbitrary line Building an OBB Tree

  38. Building an OBB Tree Project onto the line Consider variance of distribution on the line

  39. Building an OBB Tree Different line, different variance

  40. Maximum Variance Building an OBB Tree

  41. Minimal Variance Building an OBB Tree

  42. Given by eigenvectors of covariance matrix of coordinates of original points Building an OBB Tree

  43. Choose bounding box oriented this way Building an OBB Tree

  44. Building an OBB Tree: Fitting Covariance matrix of point coordinates describes statistical spread of cloud. OBB is aligned with directions of greatest and least spread (which are guaranteed to be orthogonal).

  45. Good Box Building an OBB Tree

  46. Add points: worse Box Building an OBB Tree

  47. More points: terrible box Building an OBB Tree

  48. Compute with extremal points only Building an OBB Tree

  49. Building an OBB Tree “Even” distribution: good box

  50. “Uneven” distribution: bad box Building an OBB Tree

More Related