CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.

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.
MIT EECS 6.837, Durand and Cutler Curves & Surfaces.
CSE554ContouringSlide 1 CSE 554 Lecture 4: Contouring Fall 2013.
1 Computer Graphics Chapter 7 3D Object Modeling.
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Object Representation 고려대학교 컴퓨터 그래픽스 연구실.
HCI 530 : Seminar (HCI) Damian Schofield.
Surface Reconstruction from 3D Volume Data. Problem Definition Construct polyhedral surfaces from regularly-sampled 3D digital volumes.
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
2003 by Jim X. Chen: Introduction to Modeling Jim X. Chen George Mason University.
ENDS 375 Foundations of Visualization Geometric Representation 10/5/04.
ITUppsala universitet Data representation and fundamental algorithms Filip Malmberg
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.
Curves and Surfaces (cont’) Amy Zhang. Conversion between Representations  Example: Convert a curve from a cubic B-spline curve to the Bézier form:
Volumetric and Blobby Objects Lecture 8 (Modelling)
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-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
In the name of God Computer Graphics Modeling1. Today Introduction Modeling Polygon.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
Graphics Graphics Korea University cgvr.korea.ac.kr Creating Virtual World I 김 창 헌 Department of Computer Science Korea University
4/13/04© University of Wisconsin, CS559 Spring 2004 Last Time Modeling intro Polygonal modeling –Ways of representing polygonal meshes –Indexing schemes.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
CS559: Computer Graphics Lecture 24: Shape Modeling Li Zhang Spring 2010.
Geometric Objects and Transformation
Copyright © Curt Hill Visualization of 3D Worlds How are these images described?
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
Game Programming 06 The Rendering Engine
Solid Modeling. Solid Modeling - Polyhedron A polyhedron is a connected mesh of simple planar polygons that encloses a finite amount of space. A polyhedron.
3D Object Representations
CSE554ContouringSlide 1 CSE 554 Lecture 4: Contouring Fall 2015.
11/23/04© University of Wisconsin, CS559 Fall 2004 Last Time Modeling considerations Polygonal modeling techniques Homework 6.
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.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
Parametric Curves & Surfaces
In the name of God Computer Graphics. Introduction Modeling techniques modeling techniques managements Some renderings.
3D Object Representations 2011, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
More Object Representations
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 15 Creating 3D Models.
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.
Computer Graphics I, Fall 2010 Building Models.
1 대상물체의 형상화를 위해 사용되는 기술  인공물체 : 기하학적 Primitive ( 선, 면, 구, 육면체 ) 등을 이 용하여 형상화. 입력물 : 형상화 물체의 3 차원 좌표값 출력물 : 선구조형상 (Wire framed objects) Technique:Geometric.
11/16/04© University of Wisconsin, CS559 Fall 2004 Last Time Texture Anti-Aliasing Texture boundaries Modeling introduction.
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
11/12/02(c) University of Wisconsin, CS559 Last Time Texturing Details Homework 5.
Slide 1Lecture Fall ‘00 Surface Modeling Types: Polygon surfaces Curved surfaces Volumes Generating models: Interactive Procedural.
3D Object Representations 2009, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
Introduction to Parametric Curve and Surface Modeling.
CS552: Computer Graphics Lecture 28: Solid Modeling.
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Lecture 33: Shape Modeling Li Zhang Spring 2008
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
3D Object Representations
© University of Wisconsin, CS559 Spring 2004
© University of Wisconsin, CS559 Fall 2004
Domain-Modeling Techniques
© University of Wisconsin, CS559 Spring 2004
© University of Wisconsin, CS559 Spring 2004
© University of Wisconsin, CS559 Fall 2004
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
(c) 2002 University of Wisconsin
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008

Today Shape Modeling Reading Real-Time Rendering, 2e, (except Rational Bezier Patches) Linux: /p/course/cs559-lizhang/public/readings/rtr-12- curves-surfaces.pdf Windows: P:\course\cs559-lizhang\public\readings\rtr- 12-curves-surfaces.pdf

OpenGL and Vertex Indirection struct Vertex { float coords[3]; } struct Triangle { GLuint verts[3]; } struct Mesh { struct Vertex vertices[m]; struct Triangle triangles[n]; } 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 struct Vertex { float coords[3]; } struct Triangle { GLuint verts[3]; } struct Mesh { struct Vertex vertices[m]; struct Triangle triangles[n]; } 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! Other tricks to accelerate using array, see Red book, Ch 2 on vertex arrays

Normal Vectors in Mesh 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) struct Vertex { float coords[3]; } struct Triangle { GLuint verts[3]; float normal[3]; } struct Mesh { struct Vertex vertices[m]; struct Triangle triangles[n]; }

Normal Vectors in Mesh Normal vectors give information about the true surface shape Per-Vertex normals: – A normal specified for every vertex (smooth shading) struct Vertex { float coords[3]; float normal[3]; } struct Triangle { GLuint verts[3]; } struct Mesh { struct Vertex vertices[m]; struct Triangle triangles[n]; }

Storing Other Information Colors, Texture coordinates and so on can all be treated like vertices or normals Lighting/Shading coefficients may be per-face, per-object, or per-vertex

Other Data in Mesh Normal vectors give information about the true surface shape Per-Vertex normals: – A normal specified for every vertex (smooth shading) Per-Vertex Texture Coord struct Vertex { float coords[3]; float normal[3]; float texCoords[2]; } struct Triangle { GLuint verts[3]; } struct Mesh { Vertex vertices[m]; Triangle triangles[n]; }

Other Data in Mesh Normal vectors give information about the true surface shape Per-Vertex normals: – A normal specified for every vertex (smooth shading) Per-Vertex Texture Coord, Shading Coefficients struct Vertex { float coords[3]; float normal[3]; float texCoords[2], diffuse[3], shininess; } struct Triangle { GLuint verts[3]; } struct Mesh { Vertex vertices[m]; Triangle triangles[n]; }

Other Data in Mesh Normal vectors give information about the true surface shape Per-Vertex normals: – A normal specified for every vertex (smooth shading) Per-Vertex Texture Coord, Shading Coefficients struct Vertex { float coords[3]; } struct Triangle { GLuint verts[3]; } struct Mesh { Vertex vertices[m]; float normals[3*m]; float texCoords[2*m], diffuse[3*m], shininess[m]; Triangle triangles[n]; }

Issues 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

In Project 3, we use 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? – Normals come from sweep polygon and path orientation Texture Coord? – Sweep polygon defines one texture parameter, sweep path defines the other

General Sweeps The path maybe any curve

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, … Cube Twisted Cube

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, …

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 Texture Coord? Difficult to avoid self-intersection

Klein Bottle Torus Klein Bottle

Mobious Strip Non-orientable surfaces

Change Topology when Sweeping

Spatial Enumeration Basic idea: Describe something by the space it occupies – For example, break the volume of interest into lots of tiny cubes Data is associated with each voxel (volume element), binary or grayscale. Works well for things like medical data (MRI or CAT scans, enumerates the volume)

Spatial Enumeration Basic idea: Describe something by the space it occupies – For example, break the volume of interest into lots of tiny cubes Data is associated with each voxel (volume element), binary or grayscale. Works well for things like medical data (MRI or CAT scans, enumerates the volume) Problem to overcome: – For anything other than small volumes or low resolutions, the number of voxels explodes – Note that the number of voxels grows with the cube of linear dimension

Octrees (and Quadtrees) Build a tree for adaptive voxel resolution – Large voxel for smooth regions – Small voxel for fine structures Quadtree is for 2D (four children for each node) Octree is for 3D (eight children for each node)

Quadtree example

Rendering Octrees Volume rendering renders octrees and associated data directly – A special area of graphics, visualization, not covered in this class Can convert to polygons: – Find iso-surfaces within the volume and render those – Typically do some interpolation (smoothing) to get rid of the artifacts from the voxelization

Rendering Octrees Typically render with colors that indicate something about the data One MRI slice Surface rendering with color coded brain activity

Parametric surface Line Segments (1D) -> polygon meshes (2D) Cubic curves (1D) -> BiCubic Surfaces (2D) – Bezier curve -> Bezier surface

Bilinear Bezier Patch Define a surface that passes through a, b, c, d? Looks familiar?