Modeling. Simulating the Everyday World

Similar documents
Mesh Representations & Geometry Processing

Lecture 3 Mesh. Dr. Shuang LIANG. School of Software Engineering Tongji University Spring 2013

Using Semi-Regular 4 8 Meshes for Subdivision Surfaces

Curve Corner Cutting

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

Subdivision Curves and Surfaces: An Introduction

Subdivision overview

Example: Loop Scheme. Example: Loop Scheme. What makes a good scheme? recursive application leads to a smooth surface.

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

Curves and Surfaces 2

Efficient GPU Rendering of Subdivision Surfaces. Tim Foley,

Subdivision Surfaces

INF3320 Computer Graphics and Discrete Geometry

Parametric description

Subdivision Surfaces

Subdivision Surfaces

Building Models. Objectives. Introduce simple data structures for building polygonal models. OpenGL vertex arrays. Vertex lists Edge lists

Approximate Catmull-Clark Patches. Scott Schaefer Charles Loop

Geometric modeling 1

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Building Models. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

MA 323 Geometric Modelling Course Notes: Day 36 Subdivision Surfaces

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

Curves, Surfaces and Recursive Subdivision

Subdivision Surfaces. Homework 1: Questions on Homework? Last Time? Today. Tensor Product. What s an illegal edge collapse?

Subdivision curves and surfaces. Brian Curless CSE 557 Fall 2015

Information Coding / Computer Graphics, ISY, LiTH. Splines

Rendering Subdivision Surfaces Efficiently on the GPU

Joe Warren, Scott Schaefer Rice University

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

Building Models. Objectives Introduce simple data structures for building polygonal models. Vertex lists Edge lists

Display Lists. Conceptually similar to a graphics file. In client-server environment, display list is placed on server

Computer Graphics. Prof. Feng Liu. Fall /14/2016

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

An Efficient Data Structure for Representing Trilateral/Quadrilateral Subdivision Surfaces

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

Subdivision Surfaces. Homework 1: Questions/Comments?

Advanced Computer Graphics

Generalizing the C 4 Four-directional Box Spline to Surfaces of Arbitrary Topology Luiz Velho Abstract. In this paper we introduce a new scheme that g

Spline Surfaces, Subdivision Surfaces

Intro to Modeling Modeling in 3D

Computergrafik. Matthias Zwicker. Herbst 2010

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

Local Mesh Operators: Extrusions Revisited

2D Drawing Primitives

Recursive Subdivision Surfaces for Geometric Modeling

Polar Embedded Catmull-Clark Subdivision Surface

CS 4731/543: Computer Graphics Lecture 3 (Part III): 3D Modeling: Polygonal Meshes. Emmanuel Agu

Surface and Solid Geometry. 3D Polygons

Key 3D Modeling Terms Beginners Need To Master

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

Outline. Visualization Discretization Sampling Quantization Representation Continuous Discrete. Noise

CS 465 Program 4: Modeller

Geometry Processing & Geometric Queries. Computer Graphics CMU /15-662

Technical Report. Removing polar rendering artifacts in subdivision surfaces. Ursula H. Augsdörfer, Neil A. Dodgson, Malcolm A. Sabin.

Approximating Subdivision Surfaces with Gregory Patches for Hardware Tessellation

Subdivision. Outline. Key Questions. Subdivision Surfaces. Advanced Computer Graphics (Spring 2013) Video: Geri s Game (outside link)

Local Modification of Subdivision Surfaces Based on Curved Mesh

Subdivision Curves and Surfaces

CS Object Representation. Aditi Majumder, CS 112 Slide 1

Ray Casting of Trimmed NURBS Surfaces on the GPU

Subdivision Surfaces. Homework 1: Last Time? Today. Bilinear Patch. Tensor Product. Spline Surfaces / Patches

Volume Enclosed by Example Subdivision Surfaces

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

u 0+u 2 new boundary vertex

Name: SID: LAB Section: Lab 6 - Part 1: Pixels and Triangle Rasterization

Computer Graphics. Prof. Feng Liu. Fall /21/2016

Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches

Outline. The de Casteljau Algorithm. Properties of Piecewise Linear Interpolations. Recall: Linear Interpolation

Outline. Properties of Piecewise Linear Interpolations. The de Casteljau Algorithm. Recall: Linear Interpolation

Interpolatory 3-Subdivision

THE HALF-EDGE DATA STRUCTURE MODELING AND ANIMATION

UNIVERSITY OF CALGARY. Subdivision Surfaces. Advanced Geometric Modeling Faramarz Samavati

CS 543: Computer Graphics Lecture 04 Part III: 3D Modeling: Polygonal Meshes. Emmanuel Agu

1. Introduction. 2. Parametrization of General CCSSs. 3. One-Piece through Interpolation. 4. One-Piece through Boolean Operations

Review of Tuesday. ECS 175 Chapter 3: Object Representation

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

Polygonal Mesh. Geometric object made of vertices, edges and faces. Faces are polygons. Polyhedron. Triangular mesh Quad mesh. Pyramid Cube Sphere (?

3D Graphics and OpenGl. First Steps

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

G 2 Interpolation for Polar Surfaces

Computer Graphics. This Week. Meshes. Meshes. What is a Polygon Mesh? Meshes. Modelling Shapes with Polygon Meshes.

Dgp _ lecture 2. Curves

2D Spline Curves. CS 4620 Lecture 18

A Continuous 3-D Medial Shape Model with Branching

B-spline Curves. Smoother than other curve forms

Surface Quality Assessment of Subdivision Surfaces on Programmable Graphics Hardware

3D Modeling Parametric Curves & Surfaces

1st Point. 2nd Point. hold shift & drag along Y. Splines

CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling

Geometry Primitives. Computer Science Department University of Malta. Sandro Spina Computer Graphics and Simulation Group. CGSG Geometry Primitives

SEMIREGULAR PENTAGONAL SUBDIVISIONS

Graphics Programming. August 31, Programming of the Sierpinski gasket. Programming with OpenGL and C/C++

How shapes are represented in 3D Graphics. Aims and objectives By the end of the lecture you will be able to describe

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

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

Polygon Meshes and Implicit Surfaces

Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches

Polygon Meshes and Implicit Surfaces

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

Transcription:

Modeling Simulating the Everyday World Three broad areas: Modeling (Geometric) = Shape Animation = Motion/Behavior Rendering = Appearance Page 1

Geometric Modeling 1. How to represent 3d shapes Polygonal meshes Stanford Bunny 69451 triangles David, Digital Michelangelo Project 28,184,526 vertices, 56,230,343 triangles Geometric Modeling 1. How to represent 3d shapes Smooth surfaces Bicubic spline surfaces Subdivision surfaces Caltech Head Utah Teapot Page 2

Geometric Modeling 1. How to represent 3D shapes 2. How to create 3D shapes 1. CAD tools 2. Scanners 3. Procedurally 3. How to manipulate 3D shapes 1. Deform/skin/morph/animate 2. Smooth/compress 3. Set operations, OpenGL Primitives glbegin( GL_* ); glvertexfv(v1); glvertexfv(v2); glvertexfv(v3); glvertexfv(v4); glvertexfv(v5); glvertexfv(v6); glend(); Page 3

Explicit Coordinates glbegin(gl_polygon); glvertex3f(-1.0,-1.0,0.0); glvertex3f(1.0,-1.0,0.0); glvertex3f(1.0,1.0,0.0); glvertex3f(-1.0,1.0,0.0); glend(); Coordinates Stored in Arrays float v1[3] = {-1.0,-1.0,0.0}; float v2[3] = { 1.0,-1.0,0.0}; float v3[3] = { 1.0, 1.0,0.0}; float v4[3] = {-1.0, 1.0,0.0}; glbegin(gl_polygon); glvertex3fv(v1); glvertex3fv(v2); glvertex3fv(v3); glvertex3fv(v4); glend(); Page 4

Points/Polygons typedef float Point[3];! face(int a, int b, int c, int d) {!!glbegin(gl_polygon);! Point verts[8] = {!! glvertex3fv(verts[a]);! {-1.,-1.,-1.},!! glvertex3fv(verts[b]);! { 1.,-1.,-1.},!! glvertex3fv(verts[c]);! { 1., 1.,-1.},!! glvertex3fv(verts[d]);! {-1., 1.,-1.},!!glEnd();! {-1.,-1., 1.},! }! { 1.,-1., 1.},! // Note consistent ccw orientation!! v[3] v[2] { 1., 1., 1.},! cube() {! {-1., 1., 1.},!!face(0,3,2,1);! };!!face(2,3,7,6);! v[7] v[6]!face(0,4,7,3);!!face(1,2,6,5);! v[0] v[1]!face(4,5,6,7);!!face(0,1,5,4);! v[4] v[5] }! Points/Polygons typedef float Point[3];! Point verts[8] = {! {-1.,-1.,-1.},! { 1.,-1.,-1.},! { 1., 1.,-1.},! {-1., 1.,-1.},! {-1.,-1., 1.},! { 1.,-1., 1.},! { 1., 1., 1.},! {-1., 1., 1.},! };! int polys[6][4] = {! {0,3,2,1},! {2,3,7,6},! {0,4,7,3},! {1,2,6,5),! {4,5,6,7},! {0,1,5,4}! }! face(int poly[4]) {!!glbegin(gl_polygon);!! glvertex3fv(poly[0]);!! glvertex3fv(poly[1]);!! glvertex3fv(poly[2]);!! glvertex3fv(poly[3]);!!glend();! }! cube() {! for( int i = 0; i < n; i++ )!!face(polys[i]);! }! Page 5

Comparison Polygons + Simple - Redundant information Points/Polygons + Sharing vertices reduces memory requirements Additional Topological Information Requirements: Constant time access to neighbors e.g. surface normal calculation, subdivision Editing the geometry e.g. adding new vertices, new faces, etc. Maintain topological consistency Topological data structures Page 6

Calculating Normals at Vertices for f in mesh.faces(): N = 0 for v1, v2, v3 in f.consecutivevertices(): N += cross(v2-v1,v3-v1) f.n = normalize(n) for v in mesh.verts(): N = 0 for f in v.faces(): N += f.n v.n = normalize(n) Topology e9 v5 e8 f5 e5 v6 v4 e1 v1 e12 f4 e4 f1 e2 f2 e10 f6 v3 e3 v2 e7 f3 e6 v8 v7 e11 Page 7

Topological Properties An edge connects exactly two faces An edge connects exactly two vertices A face consists of a ring of edges and vertices An vertex consists of a ring of edges and faces Euler s formula #f - #e + #v = 2 (Check for a cube: 6 12 + 8 = 2) Note: These properties define a 2D manifold Triangle Meshes Mesh has V vertices, E edges, and T triangles 2E = 3T There are 3 edges per triangle Each edge is part of 2 triangles T=2V-4 T E + V = 2 => V = 3/2 T T + 2 = T/2 + 2 In the limit as the number of triangles increases There are twice as many triangles as vertices Each vertex has 6 triangles However, except for an infinite surface, all vertices cannot have exactly 6 triangles Page 8

Triangle struct Vert {!!Point pt;! v[0]!face *f;! }! f[1] f[2] struct Face {! v[2] f[0] v[1]!vert *v[3];!!face *f[3];! }! Finding CW Face Around a Vert Find the next face clockwise around a vertex v given a face f v[0] Face *fcwvf(vert *v, Face *f) { f[1] f f[2] if( v == f->v[0] ) return f[1]; if( v == f->v[1] ) return f[2]; v[2] f[0] v[1] if( v == f->v[2] ) return f[0]; } Page 9

Subdivision Surfaces Bezier Curves Midpoint Subdivision Recursively divide into two curves Left side Page 10

Bezier Curves Midpoint Subdivision Recursively divide into two curves Left side Bezier Curves Midpoint Subdivision Recursively divide into two curves Right side Page 11

Bezier Curves Midpoint Subdivision Recursively divide into two curves Right side Loop Subdivision Page 12

Loop Subdivision Surface Triangle Mesh Page 13

Subdivide Each Triangle into 4 Triangles Subdivide Each Triangle into 4 Triangles Page 14

Two Types of Vertices Even Vertices that existed in previous mesh Odd Vertices created in new mesh Even (Gray) Odd (Black) Loop Algorithm Odd (New) Vertices Page 15

Loop Algorithm Even (Old) Vertices For degree 6 vertices Semi-Regular Meshes Most of the mesh has vertices with degree 6 If the mesh is topologically equivalent to a sphere, then not all the vertices can have degree 6 Must have a few extraordinary points (degree!= 6) Extraordinary point Page 16

Weights at an Extraordinary Point Challenge: find weights that generate a smooth surface Want the surface normal to be continuous This is a hard math problem! Warren weights Loop Subdivision Surfaces Page 17

Catmull-Clark Subdivision Subdividing Regular Quadrilateral Mesh Page 18

Catmull-Clark Subdivision Allow faces with any number of vertices Catmull-Clark Subdivision For an arbitrary mesh: 1. Add a vertex at a face Place at the average of the face vertices 2. Add a vertex at an edge Place at the average of the edge vertices and the two new face vertices 3. Adjust original vertices Page 19

Quad Face Subdivision Insert Vertex 1 4 1 4 1 4 1 4 Edge Subdivision Insert Vertex 1 4 Original vertex 1 4 1 4 1 4 New face vertex Page 20

Update Vertex using Computed Vertices New edge vertex Computed face vertex β k γ k β k β = 4 k New face vertex γ k Computed edge vertex 1 β γ β k γ k γ = 1 k Old vert vertex 1 β γ Assignment Basic loop Read in mesh Repeat Recursively subdivide the mesh Calculate new positions of vertices Compute normals and draw Challenges Develop topological data structure that efficiently supports subdivision Page 21

Things to Remember Dense polygon mesh data structures Polygons Points/Polygon Subdivision surfaces Loop subdivision algorithm Catmull-Clark subdivision algorithm Page 22