Advanced 3D-Data Structures

Similar documents
Spatial Data Structures

Spatial Data Structures

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Spatial Data Structures

Spatial Data Structures

Spatial Data Structures

Ray Tracing: Intersection

Computer Graphics. Bing-Yu Chen National Taiwan University

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Solid Modeling. Ron Goldman Department of Computer Science Rice University

Solid Modeling. Thomas Funkhouser Princeton University C0S 426, Fall Represent solid interiors of objects

Hidden Surface Elimination: BSP trees

Ray Tracing Acceleration Data Structures

VIII. Visibility algorithms (II)

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

CSG obj. oper3. obj1 obj2 obj3. obj5. obj4

Lecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13

L1 - Introduction. Contents. Introduction of CAD/CAM system Components of CAD/CAM systems Basic concepts of graphics programming

Drawing the Visible Objects

MODELING AND HIERARCHY

9. Visible-Surface Detection Methods

Identifying those parts of a scene that are visible from a chosen viewing position, and only process (scan convert) those parts

CS 352: Computer Graphics. Hierarchical Graphics, Modeling, And Animation

Implicit Surfaces & Solid Representations COS 426

Lecture 25 of 41. Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees

Binary Space Partition Trees. Overview. Binary Space Partitioning Trees (Fuchs, Kedem and Naylor `80)

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

Speeding up your game

Visible-Surface Detection Methods. Chapter? Intro. to Computer Graphics Spring 2008, Y. G. Shin

Clipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling

Computer Graphics II

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Lecture 11: Ray tracing (cont.)

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

9. Three Dimensional Object Representations

CEng 477 Introduction to Computer Graphics Fall 2007

Intersection Acceleration

Accelerated Raytracing

Introduction to 2D and 3D Computer Graphics. Realistic Rendering. -- Solids Modeling --

Lecture notes: Object modeling

Second degree equations - quadratics. nonparametric: x 2 + y 2 + z 2 = r 2

CSE528 Computer Graphics: Theory, Algorithms, and Applications

3D Modeling: Solid Models

3D Representation and Solid Modeling

Visible Surface Detection Methods

Computer Graphics Ray Casting. Matthias Teschner

CSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications

CPSC GLOBAL ILLUMINATION

Homework 1: Implicit Surfaces, Collision Detection, & Volumetric Data Structures. Loop Subdivision. Loop Subdivision. Questions/Comments?

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics

Shape Representation Basic problem We make pictures of things How do we describe those things? Many of those things are shapes Other things include

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

Collision Detection based on Spatial Partitioning

Hidden surface removal. Computer Graphics

Solid Modelling. Graphics Systems / Computer Graphics and Interfaces COLLEGE OF ENGINEERING UNIVERSITY OF PORTO

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

Accelerating Ray-Tracing

Acceleration Data Structures

Determination (Penentuan Permukaan Tampak)

Collision and Proximity Queries

Werner Purgathofer

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Acceleration. Welcome!

Triangle Rasterization

CS770/870 Spring 2017 Ray Tracing Implementation

Subdivision Surfaces. Course Syllabus. Course Syllabus. Modeling. Equivalence of Representations. 3D Object Representations

Real-Time Rendering (Echtzeitgraphik) Dr. Michael Wimmer

improving raytracing speed

Universiteit Leiden Computer Science

6.837 Introduction to Computer Graphics Final Exam Tuesday, December 20, :05-12pm Two hand-written sheet of notes (4 pages) allowed 1 SSD [ /17]

Overview of 3D Object Representations

Geometric Algorithms. Geometric search: overview. 1D Range Search. 1D Range Search Implementations

Computer Graphics 1. Chapter 2 (May 19th, 2011, 2-4pm): 3D Modeling. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2011

Ray Tracing with Spatial Hierarchies. Jeff Mahovsky & Brian Wyvill CSC 305

Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer

3D Modeling: Surfaces

COMP 175: Computer Graphics April 11, 2018

Point based Rendering

More Hidden Surface Removal

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

Physically-Based Modeling and Animation. University of Missouri at Columbia

Constructive Solid Geometry Using BSP Tree

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

Level of Details in Computer Rendering

Geometric Representations. Stelian Coros

Spatial Data Structures and Acceleration Algorithms

Isosurface Rendering. CSC 7443: Scientific Information Visualization

Accelerating Geometric Queries. Computer Graphics CMU /15-662, Fall 2016

Subdivision Of Triangular Terrain Mesh Breckon, Chenney, Hobbs, Hoppe, Watts

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

Accelerating Ray Tracing

Lecture 2 - Acceleration Structures

Clipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Spatial Data Structures and Speed-Up Techniques. Ulf Assarsson Department of Computer Science and Engineering Chalmers University of Technology

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

Point Cloud Filtering using Ray Casting by Eric Jensen 2012 The Basic Methodology

Transcription:

Advanced 3D-Data Structures Eduard Gröller, Martin Haidacher Institute of Computer Graphics and Algorithms Vienna University of Technology

Motivation For different data sources and applications different representations are necessary Examples: 3D scanner: produces a set of spatial points which are not connected to each other Computer game: Scenes and characters are usually represented as surface model consisting of many polygons A data structure for a certain application should be able to fulfill the necessary requirements 2

Properties Representation of general objects Exact representation of objects Combinations of objects Linear transformation Interaction Fast spatial searches Memory consumption Fast rendering 3

3D-Data Structures: Overview Point Cloud Wire-frame Model Boundary Representation Binary Space Partitioning Tree kd Tree Octree Constructive Solid Geometry Tree Bintree Grid 4

Point Cloud Object = set (list) of points e.g. from a digitizer or 3D scanner Exact representation if >=1 points/pixel More efficient than 1 pixel sized polygons 5

Application Example (1/2) 3D model of Machu Picchu (http://www.cast.uark.edu/home/research/archaeology-and-historicpreservation/archaeological-geomatics/archaeological-laserscanning/laser-scanning-at-machu-picchu.html) 6

Application Example (2/2) Team from TU Wien scanned Southern train station of Vienna http://www.tuwien.ac.at/aktuelles/news_detail/a rticle/6203/ 7

Operations with Point Clouds Transformations Multiply the points in the point list with linear transformation matrices Combinations Objects can be combined by appending the point lists to each other Rendering Project and draw the points onto the image plane 8

Properties of Point Clouds Advantages Fast rendering Exact representation & rendering possible Fast transformations Disadvantages Many points (curved obj., exact representation) High memory consumption Limited combination operations 9

Surfels (SURface ELementS) http://www.merl.com/publications/tr2000-10 Movies: cab, wasp, salamander with holes, salamander corrected 10

QSplat (1/2) http://graphics.stanford.edu /software/qsplat/ 3D scan of 2.7 meter statue of St. Matthew at 0.25 mm 102.868.637 points Preprocessing time: 1 hour Demo on laptop (PII 366, 128 MB), no 3D graphics hardware 11

QSplat (2/2) Interactive (8 frames/sec) High quality (8 sec) 12

3D-Data Structures: Overview Point Cloud Wire-frame Model Boundary Representation Binary Space Partitioning Tree kd Tree Octree Constructive Solid Geometry Tree Bintree Grid 13

Wire-Frame Model Object is simplified to 3D lines, each edge of the object is represented by a line in the model 5 B 3 A 8 D C 2 E F G 6 K H 4 J L 7 I 1 Edge list edge list x1 y1 z1 A Vertex list point list A B C... x2 x3 x4 x5 y2 y3 y4 y5... z2 z3 z4 z5 L x8 y8 z8 1 2 3 4 5 8 14

Operations with Wire-Frame Model Transformations Multiply the points in the point list with linear transformation matrices Combinations Objects can be combined by appending the point and edge lists to each other Rendering Projection of all points onto image plane and drawing of edges in between 15

Properties of Wire-Frame Models Advantages Quick rendering Easy and quick transformations Generation of models via digitization Disadvantages Inexact (no surfaces, no occlusion) Restricted combination possibilities Curves are approximated by straight lines 16

3D-Data Structures: Overview Point Cloud Wire-frame Model Boundary Representation Binary Space Partitioning Tree kd Tree Octree Constructive Solid Geometry Tree Bintree Grid 17

Boundary Representation (B-Rep) V 1 V 2 E 6 E 1 S E 1 2 S 2 E E 3 V 5 3 E 4 V 4 V 5 vertex list edge list face list V 1 : x 1 y 1 z 1 E 1 : V 1 V 2 S 1 : E 1 E 2 E 3 V 2 : x 2 y 2 z 2 E 2 : V 2 V 3 S 2 : E 2 E 4 E 5 E 6 V 3 : x 3 y 3 z 3 E 3 : V 3 V 1 V 4 : x 4 y 4 z 4 E 4 : V 3 V 4 V 5 : x 5 y 5 z 5 E 5 : V 4 V 5 E 6 : V 5 V 2 18

Lists for B-Reps (1/4) Face list S 1 S 2 19

Lists for B-Reps (2/4) Face list S 1 S 2 E 1 E 2 E 3 E 4 E 5 E 6 20

Lists for B-Reps (3/4) Face list S 1 S 2 xyz xyz xyz xyz xyz V 1 V 2 V 3 V 4 V 5 21

Lists for B-Reps (4/4) Face list S 1 S 2 Edge list Vertex list xyz xyz xyz xyz xyz V 1 V 2 V 3 V 4 V 5 22

Winged Edge Data Structure Alternative for normal hierarchical B-Rep Here the central element is the edge: face_cw succ_cw pred_cw edge Pend Pstart pred_ccw succ_ccw face_ccw edge list Pstart Pend face_cw face_ccw pred_cw succ_ cw pred_ccw succ_ccw 23 1st edge faces 1st edge points x yz

Operations with B-Reps (1/2) Transformations All points are transformed as with wire-frame model, additionally surface equations or normal vectors can be transformed Rendering Hidden surface or hidden line algorithms can be used because the surfaces of the objects are known, so that the visibility can be calculated 24

Properties of B-Reps Advantages General representation Generation of models via digitization Transformations are easy and fast Disadvantages High memory requirement Combinations are relatively costly Curved objects must be approximated 25

Partitioning of Object Surfaces Necessary to approximate curved surfaces Surfaces that can be parameterized: E.g. free form surfaces, quadrics, superquadrics partitioning of parameter space, one patch for every 2D parameter interval Surfaces that cannot be parameterized: E.g. implicit surfaces, "bent" polygons tesselation, subdivision surfaces 26

Tesselation Divide polygons in smaller polygons (triangles) until the approximation is exact enough Normal vector criterion as termination condition: N 1 2 1 Normal vectors of neighboring polygons are similar: N 1 N 2 Objekt Approximation 27

Operations with B-Reps (2/2) Combinations 1. Split the polygons of object A at the intersections with the polygons of object B 2. Split the polygons of object B at... of A 3. Classify all polygons of A as "in B", "outside B" or "on the surface of B 4. Classify all polygons of B in the same way 5. Remove the redundant polygons of A and B according to the operator and combine the remaining polygons of A and B 28

Combinations of B-Reps (1/4) Every polygon has a box enclosure simple test if polygons can intersect Use only convex polygons and produce only convex polygons as results simple intersection tests 1: 2: A B A B A B 29

Combinations of B-Reps (2/4) A ray is traced in the direction of the normal vector of the polygon to be classified: Ray hits no polygon of B "outside B" First polygon of B hit from front "outside B" First polygon of B hit from back "in B" "outside B" "in B" B A A B 30

Combinations of B-Reps (3/4) Improvement: points of A, which lie on the surface of B, are marked as border points during the dividing process (and vice versa) only very few polygons have to be classified with the complex method border point A in B B outside A border point 31

Combinations of B-Reps (4/4) Polygons can be removed according to tables: For polygons of A op. A or B A and B A sub B in B yes no yes outside B no yes no on B (coplanar) NV equal different no yes no yes yes no For polygons of B op. A or B A and B A sub B in A yes no no outside A no yes yes on A (coplanar) NV equal yes yes yes different yes yes yes 32

Requirements on B-Reps for this Alg. No open (non-closed) objects Only convex polygons No double points Additional links in the vertex list between neighbor points with equal classification x1 y1 x2 y2 x3 y3 x4 y4 x5 y5... xn yn vertex list z1 z2 z3 z4 z5 zn 33

3D-Data Structures: Overview Point Cloud Wire-frame Model Boundary Representation Binary Space Partitioning Tree kd Tree Octree Constructive Solid Geometry Tree Bintree Grid 34

Binary Space Partitioning Tree Special B-Rep for quick rendering with visibility Especially of static scenes polygon nodes with surface equation and normal vector.............................. polygon vertices..................... point list............ x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4 x5 y5 z5... xn yn zn 35

Binary Space Partitioning Tree The base plane of the polygon in a node partitions space in two halves: In front of and behind the polygon Left subtree of the node: contains only polygons that are in front of the basis plane Right subtree of the node: contains only polygons that are behind the basis plane Polygons that lie in both halves are divided by the base plane into two parts 36

Generation of BSP Trees Generate BSP Tree: 1. Find the polygon who's plane intersects the fewest other polygons and cut these in two 2. Divide the polygon list in two sets: in front of that plane / behind that plane 3. The polygon found in 1. is the root of the BSP tree, the left and the right subtrees can be generated recursively (from two "halves") 37

More BSP Examples 1 6 1 3 2 5 2 4 3 5 4 1 6 or 2 4 4 1b 1 1a 3 3 2 4 3 1b 2 1a 38

BSP Trees as Solids BSP tree 3 4 1 or 3 2 in 1 out out 2 3 out 4 1b 2 out 1a out 4 in out in out in out in Left empty trees represent outside space Right empty trees represent inside volumes 39

Generation of BSP Trees Convex objects: BSP tree is a linear list Polygon 1 Polygon 2 BSP-Tree Polygon 3 Polygon 4 2 1 4 3 Object 40

Properties of BSP Trees Advantages Fast rendering Fast transformation Combinations faster than for B-Reps General representation Generation of models via digitization Tree structure (fast search) 41

Properties of BSP Trees Disadvantages Curved objects must be approximated Only convex polygons High memory cost 42

Operations with BSP Trees (1/2) Rendering BSP trees are very good for fast rendering Painter s Algorithm: IF eye is in front of a (in A+) THEN BEGIN draw all polygons of A-; draw a; draw all polygons of A+ END ELSE BEGIN draw all polygons of A+; (draw a); draw all polygons of A- END; 43

Operations with BSP Trees (2/2) Transformations Points, plane equation and normal vector have to be transformed Combinations Perform combination with B-Rep, then generate BSP tree Combine BSP trees directly (faster) 44

Combination of BSP Trees A B The structure of one tree has to act as structure for the result one tree has to be included into the other 45

BSP Algorithm for A op B = C: A or B homogeneous (full or empty) simple rules Else: 1. Divide root polygon a of A at object B in a in, a out 2. Root node c of C: if op= and" then c:=a in else c:=a out (with its plane) 3. Divide B at plane of a in B in, B out 4. Recursive evaluation of the subtrees: C left =A out op B out C right =A in op B in 46

Combination of BSP Trees: A a B 1 B in 1 in b 2 3in B out 1 out 2 c 3 4 3 out A out A in d 4 b A c d 4 C a out 1 in B in 3 in a a out 1 out a in 2 B out B 3 out 47 A out B out ( = B out ) A in B in

Simple BSP Node Combination Rules op A B A op B or and sub inhom. inhom. full empty inhom. inhom. full empty inhom. inhom. full empty full empty inhom. inhom. full empty inhom. inhom. full empty inhom. inhom. full A full B A empty B empty empty A B empty 48

Combination of BSP Trees: A a B b c 1 d 2 3 4 C 1 out 2 a out b c b A c d 4 3 out d out 3 in 4out a 1 in a out 1 out a in 2 B in B out 3 in B 3 out 49

Combination of BSP Trees: A a B 1 B in 1 in b 2 3in B out 1 out 2 c 3 4 3 out A out A in d 4 b A c d 4 C a in 1 in B in 3 in a a out 1 out a in 2 B out B 3 out 50 A out B out ( = {} ) A in B in

Combination of BSP Trees: A a b B c 1 d 2 3 4 C a in d in 1 in 4in b a c A 1 in a out 1 out d 4 B in B a in B out 3 2 51 (b in and c in are empty)

3D-Data Structures: Overview Point Cloud Wire-frame Model Boundary Representation Binary Space Partitioning Tree kd Tree Octree Constructive Solid Geometry Tree Bintree Grid 52

kd Tree Special case of BSP Tree Only axes-aligned partitioning planes => specified by one value Partitioning direction specified either implicitly (pre-defined order) or explicitly 1D Tree binary tree 53

kd Tree Example: 2-D Tree 54

3D-Data Structures: Overview Point Cloud Wire-frame Model Boundary Representation Binary Space Partitioning Tree kd Tree Octree Constructive Solid Geometry Tree Bintree Grid 55

Octree Used to represent solid volumetric objects Each node is subdivided in 8 subspaces Each subspace is either empty, full or further divided The subdivision stops when an object can be represented accurate enough 56

Octree Example 57

Operations with Octrees Transformations Hard to implement; easy: rotations of 90 Combinations Can easily be done by logical operations; both octrees must be adapted to each other to have the same depth in each subspace Rendering The octree is rendered depending on the view direction starting with the subspace farthest away from the viewer 58

Properties of Octrees Advantages Combinations are easy to implement Spatial search is fast due to the tree structure Rendering algortihm is fast Disadvantages High storage consumption for approximated objects Transformations are not trivial in general General objects cannot be represented exactly 59

Extended Octrees Additional node types: Face nodes: contain a surface Edge nodes: contain an edge Vertex nodes: contain a corner point Edge-Node Vertex-Node 60 Face-Node

Generation of Extended Octrees 1. Generate B-Rep 2. Divide point and surface list at the subdivision planes into 8 sets 3. For each octant: Point and surface lists empty full or empty Only one vertex vertex node Only one surface face node Only two surfaces edge node Else: subdivide recursively 61

Octree as Spatial Directory Octree as search structure for objects in other representations E.g. for B-Reps: search octree object list... face list... octree of low depth is sufficient 62

3D-Data Structures: Overview Point Cloud Wire-frame Model Boundary Representation Binary Space Partitioning Tree kd Tree Octree Constructive Solid Geometry Tree Bintree Grid 63

Constructive Solid Geometry Tree A Constructive Solid Geometry (CSG) Tree consists of simple primitives, transformations and logical operations Useful to describe complex objects with a small number of primitives Examples for primitives Cube Sphere Cylinder 64

CSG Tree Example 65

Operations with CSG Trees Transformations An object is transformed by adding the transformation to the transformation of each primitive Combinations Two objects are simple combined by adding them as children in a new tree Rendering Needs to be converted into a B-Rep or it is rendered with raytracing 66

Properties of CSG Trees Advantages Minimal storage consumption Combinations and transformations are simple Objects can be represented exactly Tree structure (fast search) Disadvantages Cannot be rendered directly; slow rendering Model generation cannot be done through digitization of real objects 67

3D-Data Structures: Overview Point Cloud Wire-frame Model Boundary Representation Binary Space Partitioning Tree kd Tree Octree Constructive Solid Geometry Tree Bintree Grid 68

Bintree 3D Tree Subdivision order xyzxyz... Choose separation plane for optimized (irregular) subdivision Fewer nodes than octree 69

3D-Data Structures: Overview Point Cloud Wire-frame Model Boundary Representation Binary Space Partitioning Tree kd Tree Octree Constructive Solid Geometry Tree Bintree Grid 70

Grid Regular subdivision Directly addresses cells Simple neighborhood finding O(1) E.g. for ray traversal Problem: Too few/many cells Hierarchical grid 71