1 / 25

Introduction to Meshes

Introduction to Meshes. Lecture 22 Mon, Oct 20, 2003. Chapter 6. Modeling Shapes with Polygonal Meshes. Introduction to Solid Modeling with Polygonal Meshes. In computer graphics, we do not draw surfaces that are truly curved.

sjamison
Download Presentation

Introduction to Meshes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. R n P Q One Normal for the Face • The normal may be calculated from the vertices. • n = (Q – P)  (R – P).

  11. n2 n1 n3 One Normal for each Vertex • The normal at each vertex may be perpendicular to the face. • n1 = n2 = n3.

  12. n2 n1 n3 One Normal for each Vertex • The normal at each vertex may point in a unique direction. • n1n2n3.

  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. R(4, 8), color = (1, 0, 0) Q(12, 0) color = (0, 1, 1) P(0, 0) color = (1, 1, 0) Shading a Triangle • Consider this triangle.

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

  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. R(4, 8), color = (1, 0, 0) color = (7/8, 5/8, 1/8) Q(12, 0) color = (0, 1, 1) P(0, 0) color = (1, 1, 0) Shading a Triangle

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

More Related