Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Meshes Lecture 22 Mon, Oct 20, 2003.

Similar presentations


Presentation on theme: "Introduction to Meshes Lecture 22 Mon, Oct 20, 2003."— Presentation transcript:

1 Introduction to Meshes Lecture 22 Mon, Oct 20, 2003

2 Chapter 6 Modeling Shapes with Polygonal Meshes

3 Introduction to Solid Modeling with Polygonal Meshes In computer graphics, we do not draw surfaces that are truly curved. Instead, each surface consists of many small polygons connected in a mesh. This is also called a wireframe. If we fill the polygons in the mesh, then the surface looks solid.

4 Solid Model

5 Wireframe Model

6 Solid Model (69451 faces)

7 Wireframe Model

8 Close-up of Wireframe Model

9 Polygonal Faces The simplest of all polygonal faces is the triangle. Triangles have two major advantages. All triangles are planar. All triangles are convex.

10 One Normal for the Face The normal may be calculated from the vertices. n = (Q – P)  (R – P). P R Q n

11 One Normal for each Vertex The normal at each vertex may be perpendicular to the face. n 1 = n 2 = n 3. n1n1 n3n3 n2n2

12 One Normal for each Vertex The normal at each vertex may point in a unique direction. n 1  n 2  n 3. n1n1 n3n3 n2n2

13 Lighting and Normals When using a lighting model, the brightness and color of the surface are determined, in part, by the normals. If there is one normal, the surface is of uniform brightness. This is called flat shading.

14 Lighting and Normals If each vertex has a distinct normal, then the brightness may vary over the surface. This is called smooth shading.

15 One Normal, Uniform Shading

16 Distinct Normals, Varying Shading

17 Shading a Triangle We will study lighting models later. Lighting models determine how to color, or shade, a vertex. For now, we will assume that each vertex has been assigned a shade. Note: “shading” has nothing to do with shadows. It refers to the shade of color.

18 Shading a Triangle Each point in the interior and on the boundary of a triangle can be expressed as a linear combination aP + bQ + cR of the three vertices of the triangle, where a + b + c = 1. These are the barycentric coordinates.

19 Shading a Triangle The coefficients a, b, c are used to determine the color of the point in the triangle. The color of the point is the same linear combination of the colors of the vertices. This is done for each pixel that is part of the triangle.

20 Consider this triangle. Shading a Triangle R(4, 8), color = (1, 0, 0) P(0, 0) color = (1, 1, 0) Q(12, 0) color = (0, 1, 1)

21 Shading a Triangle What is the color of the outlined pixel? R(4, 8), color = (1, 0, 0) P(0, 0) color = (1, 1, 0) Q(12, 0) color = (0, 1, 1)

22 Shading a Triangle The coordinates are (3, 3). Solve the system a(0, 0) + b(12,0) + c(4, 8) = (3, 3), a + b + c = 1. The equations are 12b + 4c = 3, 8c = 3, a + b + c = 1.

23 Shading a Triangle The solution is a = 1/2. b = 1/8. c = 3/8. Therefore, the color of the pixel is (1/2)(1, 1, 0) + (1/8)(0, 1, 1) + (3/8)(1, 0, 0) = (7/8, 5/8, 1/8).

24 Shading a Triangle R(4, 8), color = (1, 0, 0) P(0, 0) color = (1, 1, 0) Q(12, 0) color = (0, 1, 1) color = (7/8, 5/8, 1/8)

25 Shading a Triangle The entire triangle R(4, 8) P(0, 0) Q(12, 0)


Download ppt "Introduction to Meshes Lecture 22 Mon, Oct 20, 2003."

Similar presentations


Ads by Google