Download presentation
Presentation is loading. Please wait.
1
Texture mapping
3
Adds realism to computer graphics Texture mapping applies a pattern of color Bump mapping alters the surface Mapping is cheaper than adding polygons
4
Example
5
Normalizing mapping We might need to bound the object It’s common no normalize coordinates
6
Mapping types 2D and 3D
7
2D mapping How the image is pasted on the object?
8
Planar mapping Remove Z coordinate
9
Planar shape Z axis X axisX-Z axis
10
Cylindrical Use angle and height
11
Cylindrical
12
Sphere Longitude and latitude
13
Sphere
14
Box Map
15
A fast way for environment mapping
16
Parametric patch
18
Break up model into single texture
19
Combining textures Background colors are transparent
20
2D drawbacks Singularities Taking out the right dimension
21
3D textures Use (x,y,z) to compute the color Similar to carving object out of a solid Colors are not stored for each (x,y,z) Coordinate based computation
22
3D textures Use point to compute an index into color table. –Using fractional part of X coordinate.
23
Noise Desired properties –Known range –Stationary –Band limited Lattice noise –Random number at each integer lattice point –Use it for object integers, otherwise – interpolate Gradient noise –Random gradients at integer lattice points
24
Noise Marbled appearance by perturbing stripes
25
Noise Making wood by adding noise to concentric rings
26
Bump mapping Change object normals before rendering Both magnitude and direction are subject to change The geometry does not change With bump mapping No bump mapping
27
Bump mapping
28
If transition is from white to black, rotate the point’s surface normal by θ If transition is from black to white, rotate the point’s surface normal by -θ
29
Displacement map Alters object geometry Displaces points along normal Bump Map Displacement Map
30
Texture in Inventor Nodes –SoTexture2. Specifies a 2D texture map. –SoTextureCoordinate2. Defines the set of 2D texture coordinates SoTexture2 *rock = new SoTexture2; root->addChild(rock); rock->filename.setValue("brick.1.rgb"); root->addChild(new SoCube);
31
SoTexture2 Fields Filename (name of the file to use as a map) Image (color and number of pixels) wrapS, wrapT – image wrapping in horizontal (s) and vertical (T) directions. –REPEAT. Repeat all texture –CLAMP. Repeat last row Model –MODULATE. The shaded color times the texture –DECAL. Replace the shaded color with texture –BLEND. Blends the shaded and texture colors blendColor – specifies blending method
32
Transforming Texture SoTexture2Transform –Rotation –Translation –scaleFactor. Scales texture on object –Center
33
Mapping texture Several options –Default coordinates (according to shape) –For vertexes it can be specified explicitly –Use texture coordinate functions SoTextureCoordinatePlane SoTexturecoordinateEnvironment
34
Default texture mapping Compute the bounding box Longest edge is the horizontal edge (s) The next longest is the vertical (t) Set (s) coordinates from 0 to 1 Set (t) coordinates from 0 to |t|/|s|
35
Mapping to different surfaces
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.