Modeling So far in class: –We’ve looked at images and image manipulation –We’ve looked at rendering from polygons Next major section: –Modeling You may.

Slides:



Advertisements
Similar presentations
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
Advertisements

1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Building Models modified by Ray Wisman Ed Angel Professor of Computer Science,
1 Building Models. 2 Objectives Introduce simple data structures for building polygonal models ­Vertex lists ­Edge lists OpenGL vertex arrays.
Extended Gaussian Images
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
3D Skeletons Using Graphics Hardware Jonathan Bilodeau Chris Niski.
Shape from Contours and Multiple Stereo A Hierarchical, Mesh-Based Approach Hendrik Kück, Wolfgang Heidrich, Christian Vogelgsang.
HCI 530 : Seminar (HCI) Damian Schofield.
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
Content Subdivision First some basics (control point polygon, mesh)
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
Introduction to Modeling. What is CG Modeling? Combination of Sculpting, Architecture, Drafting, and Painting. The core component of computer animation.
04/09/02(c) University of Wisconsin, CS559 Last Time Texturing in OpenGL Texturing Options Project 2 is now available. Start as soon as you can. Homework.
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
11/30/04© University of Wisconsin, CS559 Fall 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
In the name of God Computer Graphics Modeling1. Today Introduction Modeling Polygon.
Basics of Rendering Pipeline Based Rendering –Objects in the scene are rendered in a sequence of steps that form the Rendering Pipeline. Ray-Tracing –A.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
COMP 175: Computer Graphics March 24, 2015
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
Polygon Lists & 3-D File Formats Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Monday, February 18, 2002.
3D Object Representations 2005, Fall. Course Syllabus Image Processing Modeling Rendering Animation.
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
Graphics Graphics Korea University cgvr.korea.ac.kr Creating Virtual World I 김 창 헌 Department of Computer Science Korea University
11/11/04© University of Wisconsin, CS559 Fall 2004 Last Time Shading Interpolation Texture mapping –Barycentric coordinates for triangles.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Week 11 - Thursday.  What did we talk about last time?  Image processing  Blurring  Edge detection  Color correction  Tone mapping  Lens flare.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga Office: South.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
Object Representation Rama C Hoetzlein, 2010 Univ. of California Santa Barbara Lecture Notes.
Image Synthesis Rabie A. Ramadan, PhD 1. 2 About my self Rabie A. Ramadan My website and publications
CS559: Computer Graphics Lecture 24: Shape Modeling Li Zhang Spring 2010.
Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces for rendering –We have seen how subdivision may be used.
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
Geometric Modeling using Polygonal Meshes Lecture 3: Discrete Differential Geometry and its Application to Mesh Processing Office: South B-C Global.
GPH 338 Computer Animation Survey
11/23/04© University of Wisconsin, CS559 Fall 2004 Last Time Modeling considerations Polygonal modeling techniques Homework 6.
Image Synthesis Rabie A. Ramadan, PhD 4. 2 Review Questions Q1: What are the two principal tasks required to create an image of a three-dimensional scene?
Emerging Technologies for Games Deferred Rendering CO3303 Week 22.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Vertices, Edges and Faces By Jordan Diamond. Vertices In geometry, a vertices is a special kind of point which describes the corners or intersections.
CHAPTER 5 CONTOURING. 5.3 CONTOURING Fig 5.7. Relationship between color banding and contouring Contour line (isoline): the same scalar value, or isovalue.
In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
Rendering Large Models (in real time)
11/16/04© University of Wisconsin, CS559 Fall 2004 Last Time Texture Anti-Aliasing Texture boundaries Modeling introduction.
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
11/12/02(c) University of Wisconsin, CS559 Last Time Texturing Details Homework 5.
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
Introduction to Parametric Curve and Surface Modeling.
Week 12 - Thursday CS361.
Constructing Objects in Computer Graphics
POLYGON MESH Advance Computer Graphics
Lecture 33: Shape Modeling Li Zhang Spring 2008
Introduction to Graphics Modeling
Constructing Objects in Computer Graphics By Andries van Dam©
© University of Wisconsin, CS559 Spring 2004
© University of Wisconsin, CS559 Fall 2004
Chapter III Modeling.
(c) University of Wisconsin, CS 559
Introduction to Parametric Curve and Surface Modeling
Computed Tomography (C.T)
Presentation transcript:

Modeling So far in class: –We’ve looked at images and image manipulation –We’ve looked at rendering from polygons Next major section: –Modeling You may have noticed, we’re working backwards through the pipeline –Note that the textbook goes forward!

Modeling Overview Modeling is the process of describing an object Sometimes the description is an end in itself –eg: Computer aided design (CAD), Computer Aided Manufacturing (CAM) –The model is an exact description More typically in graphics, the model is then used for rendering (we will work on this assumption) –The model only exists to produce a picture –It can be an approximation, as long as the visual result is good The computer graphics motto: “If it looks right it is right” –Doesn’t work for CAD

Issues in Modeling There are many ways to represent the shape of an object There are many possible reasons to prefer one representation over another –How well it represents the objects of interest –How easy it is to render (or convert to polygons) –How compact it is (how cheap to store and transmit) –How easy it is to create By hand, procedurally, by fitting to measurements, … –How easy it is to interact with Modifying it, animating it –How easy it is to perform geometric computations on it Distance, intersection, normal vectors, curvature, …

Categorizing Modeling Techniques Surface vs. Volume –Sometimes we only care about the surface Rendering and geometric computations –Sometimes we want to know about the volume Medical data with information attached to the space Some representations are best thought of defining the space filled, rather than the surface around the space Parametric vs Implicit –Parametric generates all the points on a surface (volume) by “plugging in a parameter” eg (cos , sin  ) –Implicit models tell you if a point in on (in) the surface (volume) eg x 2 + y = 0

Techniques We Will Examine Polygon meshes –Surface, Parametric Prototype instancing and hierarchical modeling –Surface or Volume, Parametric Volume enumeration schemes –Volume, Parametric or Implicit Parametric curves and surfaces –Surface, Parametric Subdivision curves and surfaces Procedural models

Issues in Polygon Modeling Polygons are the dominant force in modeling for graphics –Everything can be turned into polygons (almost everything) –We know how to render polygons quickly –Many operations are easy to do with polygons –Memory and disk space is cheap –Simplicity and inertia Disadvantages –A low level representation that throws away information, such as true surface normals –Inherently approximate for most real objects - may need lots of polygons –Difficult to interact with

Properties of Polygon Meshes Convex/Concave –Convexity makes many operations easier: Clipping, intersection, collision detection, rendering, volume computations, … Closed/Open –Closed if the polygons as a group contain a closed space Can’t have “dangling edges” or “dangling faces” Every edge lies between two faces –Closed also referred to as watertight Simple –Faces intersect each other only at edges and vertices –Edges only intersect at vertices

Data Structures for Polygon Models There are many ways to store a model made up of polygons –Choice affects ease of particular operations –There is no one best way of doing things, so choice depends on application There are typically three components to a polygonal model: –The location of the vertices –The connectivity - which vertices make up which faces –Associated data: normals, texture coordinates, plane equations, … Typically associated with either faces or vertices

Polygon Soup Many polygon models are just lists of polygons - polygon soup –Each polygon stores its vertices and associated data Advantage: It’s as simple as it gets –A common output format from CAD modelers –The format required for OpenGL BIG disadvantage: No higher order information –No information about neighbors –No open/closed information –No guarantees on degeneracies

OpenGL and Soup struct Vertex { float coords[3]; } struct Triangle { struct Vertex verts[3]; } struct Triangle mesh[n]; glBegin(GL_TRIANGLES) for ( i = 0 ; i < n ; i++ ) { glVertex3fv(mesh[i].verts[0]); glVertex3fv(mesh[i].verts[1]); glVertex3fv(mesh[i].verts[2]); } glEnd(); Important Point: OpenGL, and almost everything else, assumes a constant vertex ordering: clockwise or counter-clockwise. Default, and slightly more standard, is counter-clockwise

Vertex Indirection 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 Works for normals, texture coordinates, colors… v0 v2 v1 v4 v3 v0v2v3v4v1vertices faces

OpenGL and Vertex Indirection struct Vertex { float coords[3]; } struct Triangle { GLuint verts[3]; } struct Mesh { struct Vertex vertices[m]; struct Triangle triangles[n]; } Continued…

OpenGL and Vertex Indirection (v1) glEnableClientState(GL_VERTEX_ARRAY) glVertexPointer(3, GL_FLOAT, sizeof(struct Vertex), mesh.vertices); glBegin(GL_TRIANGLES) for ( i = 0 ; i < n ; i++ ) { glArrayElement(mesh.triangles[i].verts[0]); glArrayElement(mesh.triangles[i].verts[1]); glArrayElement(mesh.triangles[i].verts[2]); } glEnd();

OpenGL and Vertex Indirection (v2) glEnableClientState(GL_VERTEX_ARRAY) glVertexPointer(3, GL_FLOAT, sizeof(struct Vertex), mesh.vertices); for ( i = 0 ; i < n ; i++ ) glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, mesh.triangles[i].verts); Minimizes amount of data sent to the renderer Fewer function calls Faster! Another variant restricts the range of indices that can be used - even faster because vertices may be cached Can even interleave arrays to pack more data in a smaller space

Yet More Variants Many algorithms can take advantage of neighbor information –Faces store pointers to their neighbors –Edges may be explicitly stored –Helpful for: Building strips and fans for rendering Collision detection Mesh decimation (combines faces) Slicing and chopping Many other things –Information can be extracted or explicitly saved/loaded

Normal Vectors Normal vectors give information about the true surface shape Per-Face normals: –One normal vector for each face, stored as part of face –Flat shading Per-Vertex normals: –A normal specified for every vertex (smooth shading) –Can keep an array of normals analogous to array of vertices –Faces store vertex indices and normal indices separately –Allows for normal sharing independent of vertex sharing

Computing Normal Vectors Many models do not come with normals –Models from laser scans are one example Per-Face normals are easy to compute: –Get the vectors along two edges, cross them and normalize For per-vertex normals: –Compute per-face normals –Average normals of faces surrounding vertex A case where neighbor information is useful –Question of whether to use area-weighted samples - generally not –Can define crease angle to avoid smoothing over edges Do not average if angle between faces is greater than crease angle

Storing Other Information Colors, Texture coordinates and so on can all be treated like vertices or normals Lighting/Shading coefficients may be per-face or per-object, rarely per vertex Key idea is sub-structuring: –Faces are sub-structure of objects –Vertices are sub-structure of faces –May have sub-objects –Associate data with appropriate level of substructure

Indexed Lists vs. Pointers Previous example have faces storing indices of vertices –Access a face vertex with: mesh.vertices[mesh.faces[i].vertices[j]] –Lots of address computations –Works with OpenGL’s vertex arrays Can store pointers directly –Access a face vertex with: *(mesh.faces[i].vertices[j]) –Probably faster because it requires fewer address computations –Easier to write –Doesn’t work directly with OpenGL –Messy to save/load (pointer arithmetic) –Messy to copy (more pointer arithmetic)

Vertex Pointers struct Vertex { float coords[3]; } struct Triangle { struct Vertex *verts[3]; } struct Mesh { struct Vertex vertices[m]; struct Triangle faces[n]; } glBegin(GL_TRIANGLES) for ( i = 0 ; i < n ; i++ ) { glVertex3fv(*(mesh.gaces[i].verts[0])); glVertex3fv(*(mesh.gaces[i].verts[1])); glVertex3fv(*(mesh.gaces[i].verts[2])); } glEnd();

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!

Picture

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

Problems with Polygons They are inherently an approximation –Things like silhouettes can never be prefect 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 information –Eg: Hard to increase, or decrease, the resolution –Hard to extract information like curvature