Polygon Meshes and Implicit Surfaces

Similar documents
Polygon Meshes and Implicit Surfaces

11/1/13. Polygon Meshes and Implicit Surfaces. Shape Representations. Polygon Models in OpenGL. Modeling Complex Shapes

Curves and Surfaces Computer Graphics I Lecture 10

Geometric Queries for Ray Tracing

Spatial Data Structures

Curves and Surfaces Computer Graphics I Lecture 9

Spatial Data Structures

Spatial Data Structures

11/1/13. Visualization. Scientific Visualization. Types of Data. Height Field. Contour Curves. Meshes

Visualization. CSCI 420 Computer Graphics Lecture 26

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

Solid Modeling. Ron Goldman Department of Computer Science Rice University

Curves and Surface I. Angel Ch.10

3D Modeling: Surfaces

Implicit Surfaces & Solid Representations COS 426

Intro to Modeling Modeling in 3D

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

From curves to surfaces. Parametric surfaces and solid modeling. Extrusions. Surfaces of revolution. So far have discussed spline curves in 2D

9. Three Dimensional Object Representations

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

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

Modeling 3D Objects: Part 2

Geometric Modeling Mortenson Chapter 11. Complex Model Construction

Surface Modeling. Polygon Tables. Types: Generating models: Polygon Surfaces. Polygon surfaces Curved surfaces Volumes. Interactive Procedural

CS354 Computer Graphics Surface Representation IV. Qixing Huang March 7th 2018

Surface and Solid Geometry. 3D Polygons

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

Geometric Representations. Stelian Coros

Computer Graphics Ray Casting. Matthias Teschner

Introduction to Geometry. Computer Graphics CMU /15-662

Visualization Computer Graphics I Lecture 20

Height Fields and Contours Scalar Fields Volume Rendering Vector Fields [Angel Ch. 12] April 23, 2002 Frank Pfenning Carnegie Mellon University

2. Give an example of a non-constant function f(x, y) such that the average value of f over is 0.

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

CSCI 4620/8626. Coordinate Reference Frames

CS770/870 Spring 2017 Ray Tracing Implementation

Visualization. Images are used to aid in understanding of data. Height Fields and Contours Scalar Fields Volume Rendering Vector Fields [chapter 26]

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

Introduction to Computer Graphics. Modeling (3) April 27, 2017 Kenshi Takayama

Contours & Implicit Modelling 1

Spatial Data Structures

Curves & Surfaces. Last Time? Progressive Meshes. Selective Refinement. Adjacency Data Structures. Mesh Simplification. Mesh Simplification

Curve and Surface Basics

Constructive Solid Geometry and Procedural Modeling. Stelian Coros

Spatial Data Structures

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

Central issues in modelling

Chapter 4-3D Modeling

Contours & Implicit Modelling 4

3D Modeling: Solid Models

3.2 THREE DIMENSIONAL OBJECT REPRESENTATIONS

Visualization Computer Graphics I Lecture 20

Lecture notes: Object modeling

INF3320 Computer Graphics and Discrete Geometry

Until now we have worked with flat entities such as lines and flat polygons. Fit well with graphics hardware Mathematically simple

8.1 Geometric Queries for Ray Tracing

3D Modeling & Sketchup

Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001

Engineering Drawing II

Triangle meshes I. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2017

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Images from 3D Creative Magazine. 3D Modelling Systems

Triangle meshes I. CS 4620 Lecture 2

CPSC / Texture Mapping

3D Modeling I. CG08b Lior Shapira Lecture 8. Based on: Thomas Funkhouser,Princeton University. Thomas Funkhouser 2000

TNM079 Modeling & Animation Lecture 6 (Implicit surfaces)

Sung-Eui Yoon ( 윤성의 )

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics 1/15

3D Modeling Parametric Curves & Surfaces. Shandong University Spring 2013

Geometric Modeling Systems

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 24 Solid Modelling

Scalar Algorithms: Contouring

Curves and Surfaces. Chapter 7. Curves. ACIS supports these general types of curves:

Math 366 Lecture Notes Section 11.4 Geometry in Three Dimensions

3D Modeling Parametric Curves & Surfaces

SolidWorks 2013 and Engineering Graphics

MATH 2023 Multivariable Calculus

Curves D.A. Forsyth, with slides from John Hart

Curves, Surfaces and Recursive Subdivision

Triangle meshes I. CS 4620 Lecture Kavita Bala (with previous instructor Marschner) Cornell CS4620 Fall 2015 Lecture 2

Lesson Polygons

CS337 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics. Bin Sheng Representing Shape 9/20/16 1/15

Computergrafik. Matthias Zwicker. Herbst 2010

Overview of 3D Object Representations

Polygonal Meshes. 3D Object Representations. 3D Object Representations. 3D Polygonal Mesh. 3D Polygonal Mesh. Geometry background

Ray scene intersections

Solid models and fractals

GL9: Engineering Communications. GL9: CAD techniques. Curves Surfaces Solids Techniques

Ray Tracing I. History

Polygons and Convexity

Ray Casting of Trimmed NURBS Surfaces on the GPU

Autodesk Inventor 2019 and Engineering Graphics

Introduction to Solid Modeling

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

Solutions to the Second Midterm Exam, Math 170, Section 002 Spring 2012

CPSC GLOBAL ILLUMINATION

Lesson 2 Constructive Solid Geometry Concept. Parametric Modeling with I-DEAS 2-1

Geometry Vocabulary. acute angle-an angle measuring less than 90 degrees

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

Transcription:

CSCI 420 Computer Graphics Lecture 9 Polygon Meshes and Implicit Surfaces Polygon Meshes Implicit Surfaces Constructive Solid Geometry [Angel Ch. 10] Jernej Barbic University of Southern California 1

Modeling Complex Shapes An equation for a sphere is possible, but how about an equation for a telephone, or a face? Complexity is achieved using simple pieces polygons, parametric surfaces, or implicit surfaces Goals Model anything with arbitrary precision (in principle) Easy to build and modify Efficient computations (for rendering, collisions, etc.) Easy to implement (a minor consideration...) Source: Wikipedia 2

What do we need from shapes in Computer Graphics? Local control of shape for modeling Ability to model what we need Smoothness and continuity Ability to evaluate derivatives Ability to do collision detection Ease of rendering No single technique solves all problems! 3

Shape Representations Polygon Meshes Parametric Surfaces Implicit Surfaces 4

Polygon Meshes Any shape can be modeled out of polygons if you use enough of them Polygons with how many sides? Can use triangles, quadrilaterals, pentagons, n-gons Triangles are most common. When > 3 sides are used, ambiguity about what to do when polygon nonplanar, or concave, or selfintersecting. Polygon meshes are built out of vertices (points) edges (line segments between vertices) faces (polygons bounded by edges) faces edges vertices 5

Normals 6

Where Meshes Come From Specify manually Write out all polygons Write some code to generate them Interactive editing: move vertices in space Acquisition from real objects Laser scanners, vision systems Generate set of points on the surface Need to convert to polygons 7

Data Structures for Polygon Meshes Simplest (but dumb) float triangle[n][3][3]; (each triangle stores 3 (x,y,z) points) redundant: each vertex stored multiple times Vertex List, Face List List of vertices, each vertex consists of (x,y,z) geometric (shape) info only List of triangles, each a triple of vertex id s (or pointers) topological (connectivity, adjacency) info only Fine for many purposes, but finding the faces adjacent to a vertex takes O(F) time for a model with F faces. Such queries are important for topological editing. Fancier schemes: Store more topological info so adjacency queries can be answered in O(1) time. Winged-edge data structure edge structures contain all topological info (pointers to adjacent vertices, edges, and faces). 8

A File Format for Polygon Models: OBJ # OBJ file for a 2x2x2 cube v -1.0 1.0 1.0 - vertex 1 v -1.0-1.0 1.0 - vertex 2 v 1.0-1.0 1.0 - vertex 3 v 1.0 1.0 1.0 - v -1.0 1.0-1.0 v -1.0-1.0-1.0 v 1.0-1.0-1.0 v 1.0 1.0-1.0 Syntax: f 1 2 3 4 f 8 7 6 5 v x y z f 4 3 7 8 f 5 1 4 8 f 5 6 2 1 f 2 6 7 3 f v 1 v 2 v n - a vertex at (x,y,z) # anything - comment - a face with vertices v 1, v 2, v n 9

How Many Polygons to Use? 10

Why Level of Detail? Different models for near and far objects Different models for rendering and collision detection Compression of data recorded from the real world We need automatic algorithms for reducing the polygon count without losing key features getting artifacts in the silhouette popping 11

Problems with Triangular Meshes? Need a lot of polygons to represent smooth shapes Need a lot of polygons to represent detailed shapes Hard to edit Need to move individual vertices Intersection test? Inside/outside test? 12

Shape Representations Polygon Meshes Parametric Surfaces Implicit Surfaces 13

Parametric Surfaces p(u,v) = [x(u,v), y(u,v), z(u,v)] e.g. plane, cylinder, bicubic surface, swept surface Bezier patch 14

Parametric Surfaces p(u,v) = [x(u,v), y(u,v), z(u,v)] e.g. plane, cylinder, bicubic surface, swept surface the Utah teapot 15

Parametric Surfaces Why better than polygon meshes? Much more compact More convenient to control --- just edit control points Easy to construct from control points What are the problems? Work well for smooth surfaces Must still split surfaces into discrete number of patches Rendering times are higher than for polygons Intersection test? Inside/outside test? 16

Shape Representations Polygon Meshes Parametric Surfaces Implicit Surfaces 17

Two Ways to Define a Circle Parametric Implicit F>0 F=0 u F<0 x = f(u) = r cos (u) y = g(u) = r sin (u) F(x,y) = x² + y² - r² 18

Implicit Surfaces well defined inside/outside polygons and parametric surfaces do not have this information Computing is hard: implicit functions for a cube? telephone? Implicit surface: F(x,y,z) = 0 e.g. plane, sphere, cylinder, quadric, torus, blobby models sphere with radius r : F(x,y,z) = x 2 +y 2 +z 2 -r 2 = 0 terrible for iterating over the surface great for intersections, inside/outside test 19

Quadric Surfaces F(x,y,z) = ax 2 +by 2 +cz 2 +2fyz+2gzx+2hxy+2px+2qy+2rz+d = 0 ellipsoid parabolic hyperboloids cone cylinder 20

What Implicit Functions are Good For X + kv F<0? F=0? F>0? X F(X + kv) = 0 Ray - Surface Intersection Test Inside/Outside Test 21

Surfaces from Implicit Functions Constant Value Surfaces are called (depending on whom you ask): constant value surfaces level sets isosurfaces Nice Feature: you can add them! (and other tricks) this merges the shapes When you use this with spherical exponential potentials, it s called Blobs, Metaballs, or Soft Objects. Great for modeling animals. 22

Blobby Models 23

How to draw implicit surfaces? It s easy to ray trace implicit surfaces because of that easy intersection test Volume Rendering can display them Convert to polygons: the Marching Cubes algorithm Divide space into cubes Evaluate implicit function at each cube vertex Do root finding or linear interpolation along each edge Polygonize on a cube-by-cube basis 24

Constructive Solid Geometry (CSG) Generate complex shapes with basic building blocks Machine an object - saw parts off, drill holes, glue pieces together 25

Constructive Solid Geometry (CSG) union difference intersection the merger of two objects into one the subtraction of one object from another Source: Wikipedia the portion common to both objects 26

Constructive Solid Geometry (CSG) Generate complex shapes with basic building blocks Machine an object - saw parts off, drill holes, glue pieces together This is sensible for objects that are actually made that way (human-made, particularly machined objects) 27

A CSG Train Brian Wyvill & students, Univ. of Calgary 28

Negative Objects Use point-by-point boolean functions remove a volume by using a negative object e.g. drill a hole by subtracting a cylinder Subtract From To get Inside(BLOCK-CYL) = Inside(BLOCK) And Not(Inside(CYL)) 29

Set Operations UNION: Inside(A) Inside(B)! Join A and B INTERSECTION: Inside(A) && Inside(B)! Chop off any part of A that sticks out of B SUBTRACTION: Inside(A) && (! Inside(B))! Use B to Cut A Examples: Use cylinders to drill holes Use rectangular blocks to cut slots Use half-spaces to cut planar faces Use surfaces swept from curves as jigsaws, etc. 30

Implicit Functions for Booleans Recall the implicit function for a solid: F(x,y,z)<0 Boolean operations are replaced by arithmetic: MAX MIN MINUS Thus replaces AND (intersection) replaces OR (union) replaces NOT(unary subtraction) F(Intersect(A,B)) = MAX(F(A),F(B)) F(Union(A,B)) = MIN(F(A),F(B)) F(Subtract(A,B)) = MAX(F(A), -F(B)) A F1<0 B F2<0 F1<0 F2<0 31

CSG Trees Set operations yield tree-based representation Source: Wikipedia 32

Implicit Surfaces Good for smoothly blending multiple components Clearly defined solid along with its boundary Intersection test and Inside/outside test are easy Need to polygonize to render --- expensive Interactive control is not easy Fitting to real world data is not easy Always smooth 33

Summary Polygonal Meshes Parametric Surfaces Implicit Surfaces Constructive Solid Geometry 34