1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.

Slides:



Advertisements
Similar presentations
Computer Graphics Bing-Yu Chen National Taiwan University.
Advertisements

1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Introduction to Computer Graphics Ed Angel Professor of Computer Science, Electrical and.
Texture Mapping April 9, The Limits of Geometric Modeling Although graphics cards can render over 10 million polygons per second, that number.
University of New Mexico
Texture Mapping Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Sampling and Aliasing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Texture Mapping. 2 The Limits of Geometric Modeling Although graphics cards can render over 10 million polygons per second, that number is insufficient.
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.
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.
Fundamentals of Computer Graphics Part 9 Discrete Techniques prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Angel and Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Introduction to Computer Graphics Ed Angel Professor Emeritus of Computer.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
June 9, 2008 Dr. Haim Levkowitz IVPR/CS/UML | 1 Texture.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Texture Mapping Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 Texture Mapping. 2 Texture Aliasing MIPmaps Environment Mapping Bump Mapping Displacement Mapping Shadow Maps Solid Textures Antialiasing.
Texture Mapping Software College, Shandong University Instructor: Zhou Yuanfeng
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Texture Mapping May 4, Many slides are borrowed from UNC-CH COMP236 Course (Spring 2003) taught by Leonard McMillan
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.
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Introduction to Computer Graphics with WebGL
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Emeritus of Computer Science University of New Mexico.
Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Emeritus of Computer Science University of New Mexico.
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
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.
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.
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.
Texture Mapping. For Further Reading Angel 7 th Ed: ­Chapter 7: 7.3 ~ 7.9 Beginning WebGL: ­Chapter 3 2.
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.
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.
1 Chapter 7 Texture Mapping. 2 The Limits of Geometric Modeling Although graphics cards can render over 10 million polygons per second, that number is.
Viewing and Texture Mapping In OPENGL. VIEWING 1.One or more objects 2.A viewer with a projection surface 3.Projectors that go from the object(s) to.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Introduction to Computer Graphics with WebGL
University of New Mexico
Buffers and texture mapping
Texture Mapping.
Computer Graphics Texture Mapping
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics
Introduction to Computer Graphics with WebGL
Texture Mapping Ed Angel Professor Emeritus of Computer Science
Texture Mapping Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science Laboratory University of New Mexico Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

Texture Mapping Ed Angel Professor Emeritus of Computer Science University of New Mexico 2 Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

3 Objectives Basic mapping strategies ­Forward vs backward mapping ­Point sampling vs area averaging Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

4 Is it simple? Although the idea is simple---map an image to a surface---there are 3 or 4 coordinate systems involved 2D image 3D surface Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

5 Coordinate Systems Parametric coordinates ­May be used to model curves and surfaces Texture coordinates ­Used to identify points in the image to be mapped Object or World Coordinates ­Conceptually, where the mapping takes place Window Coordinates ­Where the final image is really produced Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

6 Texture Mapping parametric coordinates texture coordinates world coordinates window coordinates Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

7 Mapping Functions Basic problem is how to find the maps Consider mapping from texture coordinates to a point on a surface Appear to need three functions x = f 1 (s,t) y = f 2 (s,t) z = f 3 (s,t) But we really want to go the other way s t (x,y,z) Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

8 Backward Mapping We really want to go backwards ­Given a pixel, we want to know to which point on an object it corresponds ­Given a point on an object, we want to know to which point in the texture it corresponds Need a map of the form s = g 1 (x,y,z) t = g 2 (x,y,z) Such functions are difficult to find in general Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

9 Backward Mapping Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015 We can associate texture coordinates manually (see next presentation) ­sometimes it is simple, sometimes not Or we can use mapping functions.

10 Two-part mapping One solution to the mapping problem is to first map the texture to a simple intermediate surface First step: map to a known object ­Example : map to cylinder Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

11 Second Mapping Second step: map from intermediate object to actual object ­Normals from intermediate to actual ­Normals from actual to intermediate ­Vectors from center of intermediate intermediate actual Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

12 Cylindrical Mapping Parametric equations of a cylinder : x = r cos (2  u) y = r sin (2  u) z = v/h They map a rectangle in u,v space to a cylinder of radius r and height h in world coordinates Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley ≤ u ≤ 1 0 ≤ v ≤ 1 If we set : u = s v = t We can then map from texture space. Draw some points on cylinder…

13 Spherical Map We can use a parametric sphere x = r cos (2  u) y = r sin (2  u) cos (2  v) z = r sin (2  u) sin (2  v) in a similar manner to the cylinder but have to decide where to put the distortion Spheres are used in environmental maps Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley ≤ u ≤ 1 0 ≤ v ≤ 1 Draw some points on sphere…

14 Box Mapping Easy to use with simple orthographic projection Also used in environment maps Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

Box Mapping Example Geri’s game 1997 (Pixar)Geri’s game Pixar ­History : 15 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Box mapping (for Geri’s glass) 16 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Notes The character ressembles actor Jonathan Harris (Lost in space)Jonathan Harris Geri can also be seen in Toy Story 2 Animators often put « secret » references in their work : ­ ­ 17 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Pixar debut: Luxo Jr (1986) Luxo jr: ­1986 ­History : ­Why choose a desk lamp ? A simple object on the animator’s desk… ­First time, shades are computed using « shaders »… 18 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Another Application of Box Mapping: Reflection Reflection mapping using a box: ­Good diagram in Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

20 Aliasing Point sampling of the texture can lead to aliasing errors point samples in u,v (or x,y,z) space point samples in texture space miss blue stripes Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

21 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

22 Area Averaging A better but slower option is to use area averaging Note that preimage of pixel is curved pixel preimage Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

23 Area Averaging Filtering methods: /AntiAliasingMenu.html ngUndersampling.en.html ­(click on next slides…) Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015