Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 9. Textures v Create the illusion of detail by wraping a complex image (texture) around a simple geometry –realism is increased without the need for.

Similar presentations


Presentation on theme: "1 9. Textures v Create the illusion of detail by wraping a complex image (texture) around a simple geometry –realism is increased without the need for."— Presentation transcript:

1 1 9. Textures v Create the illusion of detail by wraping a complex image (texture) around a simple geometry –realism is increased without the need for a complex shape Texture Mapping continued

2 2 Textures

3 3 OpenGL Pipeline OpenGL Pipeline Overview Diagram OpenGL Reference Manual (Addison-Wesley Publishing Company)

4 4 Textures v Express a image or complex objects v How to present wall or tree –Geometry and color?? –Texture!!

5 5 Textures v Basic Principles v Create a Simple Texture

6 6 Textures Objectives v Know what a texture is and why we need it. v Be able to program simple textures.

7 7 Textures Basic Principles v Detailed surface structures are hard and expensive to build in 3D -> Texture! v „Texel“ is „texture element“ -> one pixel of a texture. v Texture mapping: Fit image to a given geometry.

8 8 Textures Create a Simple Texture v Load an image v Create a texture v Create 3D- object with appearance String filename = "earth.jpg"; TextureLoader loader = new TextureLoader(filename, this); ImageComponent2D image = loader.getImage(); Texture2D texture = new Texture2D(Texture.BASE_LEVEL, Texture.RGBA, image.getWidth(), image.getHeight()); texture.setImage(0, image); Appearance appear = new Appearance(); appear.setTexture(texture); Sphere earth = new Sphere(1.0f, Primitive.GENERATE_TEXTURE_COORDS, appear));

9 9 Java3D Textures v TextureLoader class v TexCoordGeneration class v Texture2D class v Texture3D class

10 10 Adding Texture v Adds high-frequency detail that would be unreasonable to achieve through polygons and color

11 11

12 12

13 13

14 14 Textures v Artist creates Bitmaps v “wrap the bitmap around the model” via UV Mapping

15 15 UV Mapping v Cutting, Stretching, Rotating a flat texture to project on a 3D surface v Texture Exists in (u,v) space v Model’s polygons carry (u,v) coordinates in addition to (xyz) v Use tools to assign the proper (u,v) pairs to each polygon

16 16 u v 1.0, 0.5 0,0 0.5, 1.0 0,0 1.0, 0.5 0.5, 1.0

17 17 v 2D and 3D textures are supported v Textures an be attached to shapes in a variety of predefined ways, or linked to specific coordinates in the shape.

18 18 Texture Mapping v Wrap and Clamp v Filtering –Texel to pixel –Magnification –Minification –MIPmaps

19 19 Texture Coordinate Generation v TexCoordGeneration class –Automatically generate texture coordinates. –Linear Projection –Sphere Map


Download ppt "1 9. Textures v Create the illusion of detail by wraping a complex image (texture) around a simple geometry –realism is increased without the need for."

Similar presentations


Ads by Google