Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object Representation Rama C Hoetzlein, 2010 Univ. of California Santa Barbara Lecture Notes.

Similar presentations


Presentation on theme: "Object Representation Rama C Hoetzlein, 2010 Univ. of California Santa Barbara Lecture Notes."— Presentation transcript:

1 Object Representation Rama C Hoetzlein, 2010 Univ. of California Santa Barbara Lecture Notes

2 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.

3 Mathematical definition: Surface 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. 3

4 What are some natural examples of surfaces that are... - Open Surfaces with no interior - Closed Surfaces which have an interior - Disjoint Surfaces with distinct parts (C0 discontinuous) - Rough Surfaces with angles (C1 discontinuous) - Smooth Surfaces which are locally smooth (C1 smooth) - Self-similar Surfaces which are similar at different scales - Implicit Surfaces with no sharp boundaries - Analytical Surfaces defined by a closed mathematical func. - Revolved Surfaces created by sweeping a curve about an axis - Loft Surfaces created by sweeping a curve along a path

5 Three most common in Computer Graphics: Implicit surfaces...... f(x,y,z) = R (eg. Metablobs) Curved surfaces....... f(u, v) => R (eg. NURBS) Polygonal surfaces... M = {V, E, F} (eg. Meshes) Object Representation 1 1 3

6 Implicit Surfaces f(x,y,z) = R 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. 1

7 Simple implicit surface F(x,y,z) = sqrt( p – r ) < 1

8 Blob functions add together Metaballs: One kind of Implicit Surface f(x,y,z) =

9 James Blinn, “A Generalization of Algebraic Surface Drawing”, 1982

10 Implicit Surface Implicit Surfaces - Rendering Option 1: Raytrace the function Option 2: Convert to polygons (Marching Cubes)

11 Curved Surfaces f(u, v) => R A two-dimensional function is defined with maps two parametric variables to a point in 3D space. There are many ways that f(u,v) could be defined. 3

12

13

14

15 Curved Surfaces - Key points define the shape of an explicit function. - Properties: Infinitely divisible Everywhere smooth Easy to control

16

17 Utah Teapot Alan Newell, 1975

18 Curved surfaces have revolutionized the automotive and film industry by simplifying complex shapes. (Prior to this, only way was to explicitly specify all vertices.) Geri’s Game, 1997 (Pixar), First sub-division surfaces.

19 M = {V, E, F} Polygonal Surfaces Defined as a discrete set of vertices, edges and faces which connected together create a locus of points defining a surface.

20

21 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.

22 Stanford Bunny Greg Turk & Marc Levoy, 1994 3D scanned mesh, 69,451 triangles

23 Paolo Uccello Perspective drawing of a Challice (ca. 1450)

24 - Just describe the vertices. We also need their connectivity. - How do you know what the faces are?

25 Colin Smith, On Vertex-Vertex Systems and Their Use in Geometric and Biological Modeling, 2006.

26 - Make faces explicit. Each face indexes vertices. - Most common in graphics hardware. Const time face geometry.

27 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)

28 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

29 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.

30 Each representation makes more information explicit... giving constant-time lookups at the cost of storage space.

31 Many Operations Add/Remove Noise Face Extrusion Subdivision Find Silouettes Simplification Change Representation

32

33 Modeling in OpenGL Objects are expressed as vertex lists, appearing between glBegin..glEnd blocks: glBegin ( GL_TRANGLES); glVertex3f ( 0, 0, 0); glVertex3f ( 1, 0, 0); glVertex3f ( 0, 0, 1 ); glEnd ();

34 The type of primitive determines how the vertices will be interpreted. glBegin ( GL_POINTS );// Every 1 is a point glBegin ( GL_LINES) ;// Every 2 is a line glBegin ( GL_TRANGLES );// Every 3 is a face glBegin ( GL_QUADS );// Every 4 is a face

35 Surface normals and colors can be provided for every vertex if you want.. glBegin ( GL_TRANGLES );// Every 3 is a triangle glNormal3f ( 1, 0, 0 ); glColor3f(1,0,0); glVertex3f (1, 0, 0); glNormal3f ( 0, 1, 0 ); glColor3f(0,1,0); glVertex3f (0, 1, 0); glNormal3f ( 0, 0, 1 ); glColor3f(0,0,1); glVertex3f (0, 0, 1);.... next triangle.. glEnd ();

36 The glBegin..glEnd block indicates to OpenGL that you are giving it geometry. Transformations and Lighting must appear before any geometry is specified. Nothing else can appear in the glBegin/glEnd section except for geometry data. glEnable ( GL_LIGHTING );// Lighting glTranslate3f ( 1, 0, 0);// Transform(s) glScale3f ( 2, 2, 2 ); glBegin ( GL_TRIANGLES );// Geometry glColor3f(1,0,0); glVertex3f ( 1, 0, 0 ); // Color is part of geom glNormal3f(0,1,0); glVertex3f ( 0, 1, 0 ); // Normal is also geom glVertex3f ( 0, 0, 1 ); glEnd ();

37 Modeling in OpenGL LAB #5 – 10:00 - 11:00 1) Model a cube in OpenGL 2) Make sure that dynamic lighting of the cube is correct 3) Model the Coke Can challenge


Download ppt "Object Representation Rama C Hoetzlein, 2010 Univ. of California Santa Barbara Lecture Notes."

Similar presentations


Ads by Google