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

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

CS 465 Program 4: Modeller

Images from 3D Creative Magazine. 3D Modelling Systems

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

CHAPTER 1 Graphics Systems and Models 3

MODELING AND HIERARCHY

Topics and things to know about them:

3D Modeling: Surfaces

CS559: Computer Graphics. Lecture 23: Shape Modeling Li Zhang Spring 2010

Modeling Objects. Modeling. Symbol-Instance Table. Instance Transformation. Each appearance of the object in the model is an instance

Modeling. Michael Kazhdan ( /657) HB FvDFH Modeling Seashells, Fowler et al. 1992

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

CS 563 Advanced Topics in Computer Graphics QSplat. by Matt Maziarz

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

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

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

Surface and Solid Geometry. 3D Polygons

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

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

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

Advanced 3D-Data Structures

9. Three Dimensional Object Representations

Using GLU/GLUT Objects

Implicit Surfaces & Solid Representations COS 426

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

Computer Graphics I Lecture 11

Curves and Surfaces 2

Computer Graphics using OpenGL, 3 rd Edition F. S. Hill, Jr. and S. Kelley

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

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

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

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

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

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

CS451Real-time Rendering Pipeline

3 Polygonal Modeling. Getting Started with Maya 103

SOME 024: Computer Aided Design. E. Rozos

CGS 3220 Lecture 17 Subdivision Surfaces

Scene Graphs. CS4620/5620: Lecture 7. Announcements. HW 1 out. PA 1 will be out on Wed

Spatial Data Structures

Collision Detection. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

CGT 581 G Geometric Modeling Surfaces (part I)

Processing 3D Surface Data

4: Polygons and pixels

Spatial Data Structures

Surface Rendering. Surface Rendering

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

Two possible ways to specify transformations. Each part of the object is transformed independently relative to the origin

Processing 3D Surface Data

Editing Polygons. Adding material/volume: Extrude. Learning objectives

CSE 167: Introduction to Computer Graphics Lecture #9: Visibility. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018

Spatial Data Structures

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

CSE 167: Lecture #17: Procedural Modeling. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Animation & Rendering

Polygon Meshes and Implicit Surfaces

Polygon Meshes and Implicit Surfaces

Performance OpenGL Programming (for whatever reason)

Ray Tracing Acceleration. CS 4620 Lecture 20

Parametric description

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

Hierarchical Modeling: Tree of Transformations, Display Lists and Functions, Matrix and Attribute Stacks,

Dave s Phenomenal Maya Cheat Sheet Polygon Modeling Menu Set By David Schneider

Filled Area Primitives. CEng 477 Introduction to Computer Graphics METU, 2007

Point based Rendering

CMSC427 Final Practice v2 Fall 2017

The Traditional Graphics Pipeline

Version May 2016

3D Modeling techniques

o Represent 3D objects in a computer? o Manipulate 3D objects with a computer? o CAD programs o Subdivision surface editors :)

Constructive Solid Geometry and Procedural Modeling. Stelian Coros

Chapter 4-3D Modeling

The Traditional Graphics Pipeline

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

03 Vector Graphics. Multimedia Systems. 2D and 3D Graphics, Transformations

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves

Modeling 3D Objects: Part 2

Introduction to Geometry. Computer Graphics CMU /15-662

CSE 167: Introduction to Computer Graphics Lecture #11: Visibility Culling

3D Modeling. Visualization Chapter 4. Exercises

Modeling. Simulating the Everyday World

Google SketchUp. and SketchUp Pro 7. The book you need to succeed! CD-ROM Included! Kelly L. Murdock. Master SketchUp Pro 7 s tools and features

Computer Graphics Introduction. Taku Komura

Outline. Introduction Surface of Revolution Hierarchical Modeling Blinn-Phong Shader Custom Shader(s)

COMP 175: Computer Graphics April 11, 2018

Overview of 3D Object Representations

COMP 175 COMPUTER GRAPHICS. Lecture 07: Scene Graph. COMP 175: Computer Graphics March 10, Remco Chang 07 Scene Graph

Character Modeling COPYRIGHTED MATERIAL

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Announcements. Written Assignment 2 is out see the web page. Computer Graphics

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

CS 354R: Computer Game Technology

Adaptive Point Cloud Rendering

Introduction to Solid Modeling Parametric Modeling. Mechanical Engineering Dept.

The Traditional Graphics Pipeline

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

Lecture 13: Reyes Architecture and Implementation. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011)

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

Modeling Technology Group

Spring 2009 Prof. Hyesoon Kim

Transcription:

Computer Graphics Prof. Feng Liu Fall 2016 http://www.cs.pdx.edu/~fliu/courses/cs447/ 11/21/2016

Last time Polygon Mesh and Modeling 2

Today Modeling Technologies Final Exam: 12:30-2:00, December 7, 2016 3

Modeling Techniques Obtaining polygonal meshes Hierarchical modeling Instancing and Parametric Instancing Constructive Solid Geometry Sweep Objects Subdivision

So you need a mesh Buy it (or find a free one) Free meshes typically are not very good quality User defined: A user builds the mesh Tools help with specifying many vertices and faces quickly Take any user-friendly modeling technique, and extract a mesh representation from it Scan a real object 3D probe-based systems Range finders Image based reconstruction Take a bunch of pictures, and infer the object s shape

Scanning in Action http://www-graphics.stanford.edu/projects/mich/

Meshes from Scanning Laser scanners sample 3D positions One method uses triangulation Another method uses time of flight Some take images also for use as textures Famous example: Scanning the David Software then takes thousands of points and builds a polygon mesh out of them Research topics: Reduce the number of points in the mesh Reconstruction and re-sampling!

Consumer Depth Cameras Microsoft Kinect I Stereo triangulation Image source: https://fabrizio89.wordpress.com/kinect-1-generation/ 8

Consumer Depth Cameras Microsoft Kinect I Stereo triangulation Intel creative depth camera (early version) Time of flight 9 http://futuristicnews.com/will-intels-creative-camera-enable-computer-read-the-users-intentions/

Level Of Detail There is no point in having more than 1 polygon per pixel Or a few, if anti-aliasing Level of detail strategies attempt to balance the resolution of the mesh against the viewing conditions Must have a way to reduce the complexity of meshes Must have a way to switch from one mesh to another An ongoing research topic, made even more important as laser scanning becomes popular Also called mesh decimation, multi-resolution modeling and other things

Level of Detail http://www.cs.unc.edu/~geom/succ_map/

Problems with Polygons They are inherently an approximation Things like silhouettes can never be perfect without very large numbers of polygons, and corresponding expense Normal vectors are not specified everywhere Interaction is a problem Dragging points around is time consuming Maintaining things like smoothness is difficult Low level representation Eg: Hard to increase, or decrease, the resolution Hard to extract information like curvature

More Object Representations Hierarchical modeling Instancing and Parametric Instancing Constructive Solid Geometry Sweep Objects Subdivision

Hierarchical Modeling Hierarchical model: Group of meshes related by a tree (or graph) structure Properties of children are derived from their parents Most useful for animating polygonal meshes Consider a walking (humanoid, classic) robot: How would you move the robot around? Does the entire robot move in the same way? Does the position of one part of the robot depend on other parts?

Hierarchical Model Example l left arm Move body Draw body Rotate about shoulder Draw upper arm Translate (l,0,0) Rotate about origin of lower arm Draw lower arm Important Point: Every node has its own local coordinate system. This makes specifying transformations much much easier.

Hierarchical Details Generally represented as a tree, with transformations and instances at any node Can use a general graph, but resolving inheritance conflicts is a problem Rendered by traversing the tree, applying the transformations, and rendering the instances Particularly useful for animation Human is a hierarchy of body, head, upper arm, lower arm, etc Animate by changing the transformations at the nodes Other things can be inherited (colors, surface properties)

OpenGL Support OpenGL defines glpushmatrix()and glpopmatrix() Takes the current matrix and pushes it onto a stack, or pops the matrix off the top of the stack and makes it the current matrix Note: Pushing does not change the current matrix Rendering a hierarchy (recursive): RenderNode(tree) glpushmatrix() Apply node transformation Draw node contents RenderNode(children) glpopmatrix()

Instancing Sometimes you need many copies of the same object Like chairs in a room Define one chair, the base or the prototype Create many instances (copies) of it, and apply a different transformation to each Appears in scene description languages (Renderman, Inventor) as defining a label for an object Advantages?

OpenGL Support OpenGL defines display lists for encapsulating commands that are executed frequently list_id = glgenlists(1); glnewlist(list_id, GL_COMPILE); glbegin(gl_triangles); draw some stuff glend(); glendlist(); And later glcalllist(list_id);

More Display Lists Almost any command can go in a display list Viewing transformation set-up Lighting set-up Surface property set-up But some things can t Causes strange bugs always check that a command can go in a display list The list can be: GL_COMPILE: things don t get drawn, just stored GL_COMPILE_AND_EXECUTE: things are drawn, and also stored

Display Lists Good/Bad You should use display lists when: You do the same thing over and over again The commands are supported Nothing changes about the way you do it Advantages: Can t be much slower than the original way Can be much faster Disadvantages: Can t use various commands that would offer other speedups For example, can t use glvertexpointer()

Parametric Instancing Many things, called primitives, are conveniently described by a label and a few parameters Cylinder: Radius, length, does it have end-caps, Bolts: length, diameter, thread pitch, Other examples? This is a modeling format: Provide software that knows how to draw the object given the parameters, or knows how to produce a polygonal mesh How you manage the model depends on the rendering style Can be an exact representation

Rendering Instances Generally, provide a routine that takes the parameters and produces a polygonal representation Conveniently brings parametric instancing into the rendering pipeline May include texture maps, normal vectors, colors, etc OpenGL utility library (glu) defines routines for cubes, cylinders, disks, and other common shapes Renderman does similar things, so does POVray, The procedure may be dynamic For example, adjust the polygon resolution according to distance from the viewer

Constructive Solid Geometry (CSG) Based on a tree structure, like hierarchical modeling, but now: The internal nodes are set operations: union, intersection or difference (sometimes complement) The edges of the tree have transformations associated with them The leaves contain only geometry Allows complex shapes with only a few primitives Common primitives are cylinders, cubes, etc, or quadric surfaces Motivated by computer aided design and manufacture Difference is like drilling or milling A common format in CAD products

CSG Example - - scale translate cube scale translate cylinder scale translate cylinder

Sweep Objects Define a polygon by its edges Sweep it along a path The path taken by the edges form a surface - the sweep surface Special cases Surface of revolution: Rotate edges about an axis Extrusion: Sweep along a straight line

Rendering Sweeps Convert to polygons Break path into short segments Create a copy of the sweep polygon at each segment Join the corresponding vertices between the polygons May need things like end-caps on surfaces of revolution and extrusions Normals come from sweep polygon and path orientation Sweep polygon defines one texture parameter, sweep path defines the other

A Circular Tube (A torus) What do we sweep, along what path? Vector3 points[2][8]; int start_i = 0; int end_i = 1; for ( int i = 0 ; i < 8 ; i++ ) points[start_i][i] = TorusPoint(7,i); for ( int j = 0 ; j < 8 ; j++ ) { glbegin(gl_triangle_strip); for ( int i = 0 ; i < 8 ; i++ ) { glvertex3fv(points[start_i][i]); points[end_i][i] = TorusPoint(j, i); glvertex3fv(points[end_i][i]); } glvertex3fv(points[start_i][0]); //close the loop glvertex3fv(points[end_i][0]); glend(); int temp = start_i; start_i = end_i; end_i = temp; }

General Sweeps The path maybe any curve The polygon that is swept may be transformed as it is moved along the path Scale, rotate with respect to path orientation, One common way to specify is: Give a poly-line (sequence of line segments) as the path Give a poly-line as the shape to sweep Give a transformation to apply at the vertex of each path segment Difficult to avoid self-intersection

Smooth versus General Polygon meshes are very general, but hard to model with In a production context (film, game), creating a dense, accurate mesh requires lots of work Biggest problem is smoothness We desire a way to smooth out a polygonal mesh We can model at a coarse level, and automatically fill in the smooth parts Subdivision surfaces are part of the answer

Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces, smoothing along the way We will see how it can be used for modeling specific objects, and as a modeling scheme in itself In this lecture: Subdivision for tessellating a sphere Subdivision for fractal surfaces

Tessellating a Sphere Spheres are frequently parameterized in polar coordinates: x y z cos 0 cos 2,, sin cos 2 2 sin Tessellation: The process of approximating a surface with a polygon mesh One option for tessellating a sphere: Step around and up the sphere in constant steps of and Problem: Polygons are of wildly different sizes, and some vertices have very high degree,

Subdivision Method Begin with a coarse approximation to the sphere, that uses only triangles Two good candidates are platonic solids with triangular faces: Octahedron, Isosahedron They have uniformly sized faces and uniform vertex degree Repeat the following process: Insert a new vertex in the middle of each edge Push the vertices out to the surface of the sphere Break each triangular face into 4 triangles using the new vertices Octahedron Isosahedron

The First Stage Each face gets split into 4: Each new vertex is degree 6, original vertices are degree 4

Sphere Subdivision Advantages All the triangles at any given level are the same size Relies on the initial mesh having equal sized faces, and properties of the sphere The new vertices all have the same degree Mesh is regular (or uniform) in newly generated areas Makes it easier to analyze what happens to the surface The location and degree of existing vertices does not change

Fractal Surfaces Fractals are objects that show self similarity The word is overloaded it can also mean other things Landscapes and coastlines are considered fractal in nature Mountains have hills on them that have rocks on them and so on Continents have gulfs that have harbors that have bays and so on Subdivision is the natural way of building fractal surfaces Start with coarse features, subdivide to finer features Different types of fractals come from different subdivision schemes and different parameters to those schemes

Fractal Terrain (1) Start with a coarse mesh Vertices on this mesh won t move, so they can be used to set mountain peaks and valleys Also defines the boundary Mesh must not have dangling edges or vertices Every edge and every vertex must be part of a face Also define an up direction Then repeatedly: Add new vertices at the midpoint of each edge, and randomly push them up or down Split each face into four, as for the sphere

Fractal Terrain Example A mountainside

Fractal Terrain Details There are options for choosing where to move the new vertices Uniform random offset Normally distributed offset small motions more likely Procedural rule eg Perlin noise Reducing the offset of new points according to the subdivision level is essential Define a scale, s, and a ratio, k, and at each level: s i+1 =ks i Colors are frequently chosen based on altitude

Fractal Terrain Algorithm The hard part is keeping track of all the indices and other data Same algorithm works for subdividing sphere Split_One_Level(struct Mesh terrain) Copy old vertices for all edges Create and store new vertex Create and store new edges for all faces Create new edges interior to face Create new faces Replace old vertices, edges and faces

Subdivision Operations Split an edge, create a new vertex and two new edges Each edge must be split exactly once Need to know endpoints of edge to create new vertex Split a face, creating new edges and new faces based on the old edges and the old and new vertices Require knowledge of which new edges to use Require knowledge of new vertex locations

Data Structure Issues We must represent a polygon mesh so that the subdivision operations are easy to perform Questions influencing the data structures: What information about faces, edges and vertices must we have, and how do we get at it? Should we store edges explicitly? Should faces know about their edges?

Next Time Implicit Surfaces 43