Object Representation Rama C Hoetzlein 2010 Univ of
Object Representation Rama C Hoetzlein, 2010 Univ. of California Santa Barbara Lecture Notes
Object Representation Object representation can be understood as an issue in communication… Describe to me, in exact detail what a surface looks like, without using “fuzzy” words.
Mathematical definition: Surface 3 A subset of points in R , which span a local two-dimensional space at each point. For any given point in the set, there are two directions in which another point in the set is infinitely close.
What are some natural examples of surfaces that are. . . - Open - Closed - Disjoint - Rough - Smooth - Self-similar - Implicit - Analytical - Revolved - Loft Surfaces with no interior Surfaces which have an interior Surfaces with distinct parts (C 0 discontinuous) Surfaces with angles (C 1 discontinuous) Surfaces which are locally smooth (C 1 smooth) Surfaces which are similar at different scales Surfaces with no sharp boundaries Surfaces defined by a closed mathematical func. Surfaces created by sweeping a curve about an axis Surfaces created by sweeping a curve along a path
Object Representation Three most common in Computer Graphics: 1 Implicit surfaces. . . f(x, y, z) = R 1 Curved surfaces. . . . f(u, v) => R (eg. Metablobs) 3 Polygonal surfaces. . . M = {V, E, F} (eg. NURBS) (eg. Meshes)
Implicit Surfaces f(x, y, z) = R 1 A function of three variables is defined which maps every point in space to a scalar value. Selecting a range of values defines a volume, while selecting a single value defines a surface.
Simple implicit surface F(x, y, z) = sqrt( p – r ) < 1
Metaballs: One kind of Implicit Surface f(x, y, z) = Blob functions add together
James Blinn, “A Generalization of Algebraic Surface Drawing”, 1982
Implicit Surfaces - Rendering Option 1: Raytrace the function Option 2: Convert to polygons (Marching Cubes) Implicit Surface
Curved Surfaces f(u, v) => R 3 A two-dimensional function is defined with maps two parametric variables to a point in 3 D space. There are many ways that f(u, v) could be defined.
Curved Surfaces - Key points define the shape of an explicit function. - Properties: Infinitely divisible Everywhere smooth Easy to control
Utah Teapot Alan Newell, 1975
Geri’s Game, 1997 (Pixar), First sub-division surfaces. Curved surfaces have revolutionized the automotive and film industry by simplifying complex shapes. (Prior to this, only was to explicitly specify all vertices. )
Polygonal Surfaces M = {V, E, F} Defined as a discrete set of vertices, edges and faces which connected together create a locus of points defining a surface.
Polygonal Surfaces A mesh is a discrete representation of a surface. - Surface is broken into vertices, edges, and faces. - Vertices = Subset of S sampled at discrete locations.
Stanford Bunny Greg Turk & Marc Levoy, 1994 3 D scanned mesh, 69, 451 triangles
Paolo Uccello Perspective drawing of a Challice (ca. 1450)
- Just describe the vertices. We also need their connectivity. - How do you know what the faces are?
Colin Smith, On Vertex-Vertex Systems and Their Use in Geometric and Biological Modeling, 2006.
- Make faces explicit. Each face indexes vertices. - Most common in graphics hardware. Const time face geometry.
Mesh storage. . . Example PLY files: - Number of vertices - Number of faces - Each vertex has a list of properties. In this case, x/y/z. Vertex could also have a color, or texture coordinate. - Each face is an index of vertices. (This example: 3 -sided faces only)
Mesh Operations What do you need to do for? 1. Adding a vertex 2. Deleting a vertex 3. Adding a face 4. Deleting a face
Winged Edge Meshes - More storage space - Each edge has: 2 vertices 2 faces - But. . . we can now find neighboring vertices and faces in constant time.
Each representation makes more information explicit. . . giving constant-time lookups at the cost of storage space.
Many Operations Face Extrusion Subdivision Find Silouettes Change Representation Simplification Add/Remove Noise
Modeling in Open. GL Objects are expressed as vertex lists, appearing between gl. Begin. . gl. End blocks: gl. Begin ( GL_TRANGLES); gl. Vertex 3 f ( 0, 0, 0); gl. Vertex 3 f ( 1, 0, 0); gl. Vertex 3 f ( 0, 0, 1 ); gl. End ();
The type of primitive determines how the vertices will be interpreted. gl. Begin ( GL_POINTS ); // Every 1 is a point gl. Begin ( GL_LINES) ; // Every 2 is a line gl. Begin ( GL_TRANGLES ); // Every 3 is a face gl. Begin ( GL_QUADS ); // Every 4 is a face
Surface normals and colors can be provided for every vertex if you want. . gl. Begin ( GL_TRANGLES ); // Every 3 is a triangle gl. Normal 3 f ( 1, 0, 0 ); gl. Color 3 f(1, 0, 0); gl. Vertex 3 f (1, 0, 0); gl. Normal 3 f ( 0, 1, 0 ); gl. Color 3 f(0, 1, 0); gl. Vertex 3 f (0, 1, 0); gl. Normal 3 f ( 0, 0, 1 ); gl. Color 3 f(0, 0, 1); gl. Vertex 3 f (0, 0, 1); . . next triangle. . gl. End ();
The gl. Begin. . gl. End block indicates to Open. GL that you are giving it geometry. Transformations and Lighting must appear before any geometry is specified. Nothing else can appear in the gl. Begin/gl. End section except for geometry data. gl. Enable ( GL_LIGHTING ); gl. Translate 3 f ( 1, 0, 0); gl. Scale 3 f ( 2, 2, 2 ); // Lighting // Transform(s) gl. Begin ( GL_TRIANGLES ); // Geometry gl. Color 3 f(1, 0, 0); gl. Vertex 3 f ( 1, 0, 0 ); // Color is part of geom gl. Normal 3 f(0, 1, 0); gl. Vertex 3 f ( 0, 1, 0 ); // Normal is also geom gl. Vertex 3 f ( 0, 0, 1 ); gl. End ();
Modeling in Open. GL LAB #5 – 10: 00 - 11: 00 1) Model a cube in Open. GL 2) Make sure that dynamic lighting of the cube is correct 3) Model the Coke Can challenge
- Slides: 37