Introduction to Meshes

Slides:



Advertisements
Similar presentations
Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
Advertisements

Polygon Rendering Flat Rendering Goraud Rendering Uses Phong Reflectance Phong Rendering.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Computer Graphics - Class 10
Graphics Programming: Polygon Filling
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Textures – Magnification and Minification Lecture 30 Mon, Nov 17, 2003.
1 Graphics CSCI 343, Fall 2013 Lecture 20 Lighting and Shading III.
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 445 / 645 Introduction to Computer Graphics Lecture 18 Shading Shading.
CS-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
COMP 261 Lecture 14 3D Graphics 2 of 2. Doing better than 3x3? Translation, scaling, rotation are different. Awkward to combine them. Use homogeneous.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.
Triangle Scan Conversion. 2 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Rasterization Rasterization (scan conversion) –Determine which.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
COMP 261 Lecture 16 3D Rendering. input: set of polygons viewing direction direction of light source(s) size of window. output: an image Actions rotate.
Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
Illumination and Shading How to shade surfaces based on the position,orientation,characteristics of the surfaces and the light sources illuminating them.
CAP4730: Computational Structures in Computer Graphics
Computer Graphics Basic 3D Geometry CO2409 Computer Graphics Week 5-1.
Vector Graphics Digital Multimedia Chap 이병희
Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.
1 Polygonal Techniques 이영건. 2 Introduction This chapter –Discuss a variety of problems that are encountered within polygonal data sets The.
Komputer Grafik 2 (AK045206) Shading 1/17 Realisme : Shading.
Illumination and Shading
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Color and Color Models Angel 2.5 Angel: Interactive Computer Graphics5E © Addison-Wesley
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
In the name of God Computer Graphics Bastanfard. Curve Function(2) Other method is approximate it using a poly-line. Just locate a set of points along.
3D Object Representations graphics scenes contain solid geometric objects trees, flowers, clouds, rocks, water representations surface ↔interior models.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Local Illumination and Shading
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
Introduction to Meshes Lecture 22 Mon, Oct 20, 2003.
Textures – Basic Principles Lecture 29 Fri, Nov 14, 2003.
2 3D Viewing Process  3D viewing process MC Model Space Model Transformation Model Transformation WC World Space Viewing Transformation Viewing Transformation.
Schedule Update GP 4 – Tesselation/Cg GDS 4 – Subdiv Surf. GP 5 – Object Modeling Lab: Mini-proj Setup GDS 5 – Maya Modeling MCG 6 – Intersections GP 6.
3D Object Representations. Introduction Line and circle and polygon algorithms- represented simple and smooth object. Some Natural object are neither.
Computer Graphics (Fall 2006) COMS 4160, Lecture 16: Illumination and Shading 1
Computer Graphics Lecture 26 Mathematics of Lighting and Shading Part II Taqdees A. Siddiqi
Shaders, part 2 alexandri zavodny.
Computer Graphics Chapter 9 Rendering.
POLYGON MESH Advance Computer Graphics
Morphing and Shape Processing
CS148: Introduction to Computer Graphics and Imaging
Chapter 14 Shading Models.
Basic Graphing Techniques
CSC461: Lecture 23 Shading Computation
Vectors, Normals, & Shading
Introduction to Computer Graphics with WebGL
Introduction to Meshes
Color and Shading Lecture 9 Mon, Sep 26, 2005.
Shading Polygons Lecture 36 Wed, Nov 28, 2007.
Computer Graphics (Fall 2003)
Chapter 14 Shading Models.
Clipping Polygons Lecture 31 Fri, Nov 9, 2007.
Presentation transcript:

Introduction to Meshes Lecture 21 Wed, Oct 26, 2005

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.

Solid Model

Wireframe Model

Solid Model (69451 faces)

Wireframe Model

Close-up of Wireframe Model

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

Shading Models In flat shading, the entire polygon is given the shade of a single vertex. In smooth shading, the colors of the vertices are interpolated across the polygon. Use the OpenGL function glShadeModel() with one parameter. GL_FLAT GL_SMOOTH

One Normal, Uniform Shading

Distinct Normals, Varying Shading

Shading, Lighting, and Textures of Faces In the absence of lighting and textures, the shade of each vertex is determined by glColor(). If lighting is enabled, the shade of each vertex is computed from the lighting effects. If textures are used, the shade of each vertex is determined by the texels or a combination of texels, lighting, and color.

Shading, Lighting, and Textures of Faces In all three cases, once the shade of the vertices is determined, then those shades are interpolated across the pixels, shading all the pixels in the polygon’s interior.

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 P, Q, and R of the triangle, where a + b + c = 1. These are the barycentric coordinates.

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.

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

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

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,

Shading a Triangle The solution is 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).

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

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

Method of Interpolation An alternate way to calculate the color of a point C is to use interpolation. Interpolate along the edges PR and QR to find the colors of the endpoints of the horizontal row containing C. Interpolate across the row between the endpoints. This method requires 3 interpolations.

Method of Interpolation Consider again the triangle and the pixel at (3, 3). R(4, 8), color = (1, 0, 0) Q(12, 0) color = (0, 1, 1) P(0, 0) color = (1, 1, 0)

Method of Interpolation Interpolate for the endpoints A and B of row 3. R(4, 8), color = (1, 0, 0) P(0, 0) color = (1, 1, 0) Q(12, 0) color = (0, 1, 1) B = (5/8)Q + (3/8)R A = (5/8)P + (3/8)R

Method of Interpolation Compute the colors of the horizontal endpoints. R(4, 8), color = (1, 0, 0) P(0, 0) color = (1, 1, 0) Q(12, 0) color = (0, 1, 1) A = (5/8)P + (3/8)R B = (5/8)Q + (3/8)R color = (1, 5/8, 0) color = (3/8, 5/8, 5/8)

Method of Interpolation Interpolate for the point C. R(4, 8), color = (1, 0, 0) P(0, 0) color = (1, 1, 0) Q(12, 0) color = (0, 1, 1) A = (5/8)P + (3/8)R B = (5/8)Q + (3/8)R color = (1, 5/8, 0) color = (3/8, 5/8, 5/8) C = (6/7.5)A + (1.5/7.5)B

Method of Interpolation Compute the color of C. R(4, 8), color = (1, 0, 0) P(0, 0) color = (1, 1, 0) Q(12, 0) color = (0, 1, 1) A = (5/8)P + (3/8)R B = (5/8)Q + (3/8)R color = (1, 5/8, 0) color = (3/8, 5/8, 5/8) C = (6/7.5)A + (1.5/7.5)B color = (7/8, 5/8, 1/8)