Coordinate Systems - PowerPoint PPT Presentation

About This Presentation
Title:

Coordinate Systems

Description:

Raster. Scan line. V1. Approximating Curved Surfaces with Flat Polygons ... Raster. Scan line. Illumination / Shading. Distinction between illumination and ... – PowerPoint PPT presentation

Number of Views:65
Avg rating:3.0/5.0
Slides: 53
Provided by: torste1
Category:

less

Transcript and Presenter's Notes

Title: Coordinate Systems


1
Coordinate Systems
Coordinate Systems (conventional
Cartesianreference system)
Y
Z
Y
X
Z
X
2
Transformations
  • Transformation occurs about the origin of the
    coordinate systems axis

Scale
Translate
Rotate
3
Order of Transformations Make a Difference
Rotate about Z 45 Translate along X 1
Box centered at origin
Translate along X 1 Rotate about Z 45
4
Hierarchy of Coordinate Systems
Local coordinate system
  • Also called
  • Scene graphs
  • Tree structures

5
The Camera
Near Clipping Plane
Far Clipping Plane
Projection Plane
View Volume
6
The Camera
Parallel Projection
Perspective Projection
7
Rendering Pipeline
  • Hardware

Modelling
Transform
Visibility
Illumination Shading
8
Polygons, Meshes Scan Conversion- In scan line
rendering (the most common) Each polygon is
calculated along each scan line. From the top
scan line to the bottom of a frame in the 2D
projection plane.
V1
Raster Scan line
V3
V2
9
Approximating Curved Surfaces with Flat Polygons
Flat Shading each polygon face has a normal
that is used to perform lighting calculations.
10
Gouraud Shading
  • Compute vertex normals by averaging face normals.
  • Compute intensity at each vertex.

I1
Raster Scan line
I1,2
I1,3
I1,2,3,4
I3
I2
11
Illumination / Shading
  • Distinction between illumination and shading
    models
  • illumination - calculate intensity at a point on
    surface
  • shading - uses calculated intensities to shade
    polygons (uses illumination models)
  • well review the important models

12
Illumination / Shading
  • global illumination
  • ray tracing radiosity
  • mapping and other techniques
  • texture maps, bump maps, reflection maps,
    transparency, anti-aliasing, shadows
  • ray tracing
    radiosity

13
Local Illumination
  • Local vs. global illumination models
  • local (typically) - how is one point of the scene
    illuminated directly by the light source
  • is light source only source of illumination?
  • Simple models lump the rest into a single ambient
    term
  • do not account for reflections within the
    environment

14
Local Illumination
  • Local vs. global illumination models
  • global - illuminates the whole scene
  • typically makes use of local illumination model
  • incorporates inter-reflectance of objects

15
Lighting Types
  • Ambient basic, even illumination of all objects
    in a scene
  • Directional all light rays are in parallel in 1
    direction - like the sun
  • Point all light rays emanate from a central
    point in all directions like a light bulb
  • Spot point light with a limited cone and a
    fall-off in intensity like a flashlight

Cone angle
Penumbra angle (light starts to drop offto zero
here)
16
Light Effects
  • Usually only considering reflected part

Light
reflected
specular
Light
absorbed
ambient
diffuse
transmitted
Lightrefl.absorbedtrans.
Lightambientdiffusespecular
17
Ambient Light
  • is the light in the environment evenly reaching
    all surfaces from all directions
  • light location doesnt matter
  • eye position doesnt matter
  • IA ambient light
  • ka materials ambient reflection coefficient

18
Ambient Light
  • IA ambient light
  • ka materials ambient reflection coefficient
  • Models general level of brightness in the scene
  • Accounts for light effects that are difficult to
    compute (secondary diffuse reflections, etc)

19
Ambient Light Example
20
Diffuse Light
  • Light absorbed by the surface and then reflected
    equally to all directions
  • Models dullness, roughness of a surface

Light
Lamberts Law(perfectly diffusesurface)
N
L
f
  • Id intensity of light source
  • kd materials diffuse reflection coefficient
  • N normal vector (normalized)
  • L light source vector (normalized)

21
Diffuse Light
22
Diffuse Lighting Example
23
Specular Light
  • Light that is reflected from the surface
    unequally to all directions
  • Models reflections on shiny surfaces

Phongs Law
Light
N
Eye
R
L
f
f
a
R
R
R
nsmall
nlarge
ninf.
24
Specular light example
25
Specular light calculation
  • The effect of n in the phong model

n 10
n 90
n 30
n 270
26
Shading a Polygon
  • Illumination Model determine the color of a
    surface (data) point by simulating some light
    attributes.
  • Local IM deals only with isolated surface (data)
    point and direct light sources.
  • Global IM takes into account the relationships
    between all surfaces (points) in the environment.
  • Shading Model applies the illumination models at
    a set of points and colors the whole scene.
  • Texture Mapping remappes and avgs. any value
    above (diffuse) from a 2d picture or map

27
Shading a Polyhedra
  • Flat (facet) shading
  • Works well for objects
  • really made of flat faces.
  • Appearance depends on
  • number of polygons for
  • curved surface objects.
  • If polyhedral model is an approximation then need
    to smooth.

28
Flat and Smooth Shading
  • Getting smooth Curvature interpolation

Gouraud Shading
Flat Shading
29
Flat Shading
  • Polygon meshes approximate smooth curved surfaces
    with planar facets. Using the previous methods
    does not generate an illusion of smooth curved
    surface.

N1
N2
  • Reason discontinuity of the normal vectors.

30
Gouraud Shading
  • Assign vertex the normal of the smooth surface.
  • Or
  • Average the normal of all neighboring polygons

N
N1
N2
  • Interpolate colors along edges and scan-lines

31
Gouraud shading
32
Phong shading
33
Phong Shading
  • Gouraud Shading does not properly handle specular
    highlights.
  • Reason Colors are interpolated
  • Solution
  • Compute averaged normal at vertices (Gouraud)
  • Interpolate normals along edges and scan lines!
  • Apply illumination model at every pixel

34
Phong Shading
  • Gouraud Shading

Phong Shading
35
Specular
Large n
Small n
36
Textures
  • Images (textures) applied to polygons (models) to
    enhance the visual effect of a scene

Texture
Surface
Image
Angel Figure 9.3
37
Surface Textures
  • Add visual detail to surfaces of 3D objects

With surface texture
Polygonal model
38
Surface Textures
  • Add visual detail to surfaces of 3D objects

39
Parameterization


geometry
image
texture map
  • Q How do we decide where on the geometry each
    color from the image should go?

40
Option Varieties of projections
41
Texture Mapping
  • Steps
  • Define texture
  • Specify mapping from texture to surface
  • Lookup texture values during scan conversion

(0,1)
y
(1,0)
t
v
u
x
s
(0,0)
Modeling Coordinate System
Image Coordinate System
Texture Coordinate System
42
Texture Mapping
  • When scan convert, map from
  • image coordinate system (x,y) to
  • modeling coordinate system (u,v) to
  • texture image (t,s)

(1,1)
(0,1)
y
(1,0)
t
v
u
x
s
(0,0)
Modeling Coordinate System
Image Coordinate System
Texture Coordinate System
43
Texture Mapping
  • Interpolate texture coordinates down/across scan
    lines
  • U,V mapping can be arbitrary and manipulated
  • Distortion due to interpolation approximation

44
Texture Filtering
  • Aliasing is a problem

Area filtering
Point sampling
Angel Figure 9.5
45
Texture Filtering
  • Size of filter depends on projective warp
  • Can prefiltering images

Magnification
Minification
Angel Figure 9.14
46
Mip Maps
  • Keep textures prefiltered at multiple resolutions
  • For each pixel, linearly interpolate between two
    closest levels (e.g., trilinear filtering)
  • Fast, easy for hardware

47
What is a Texture?
  • MAP surface detail from a predefined (easy table
    (texture) to a simple polygon
  • Color
  • Specular color (environment map)
  • Normal vector deviation (bumpmap)
  • displacement mapping
  • transparency
  • ...

48
Bump Mapping
  • Modifies the direction of the surface normal.

49
Texture and Bump Mapping
  • Diffuse and normal remapping

50
Displacement Mapping
  • Modifies the surface position in the direction of
    the surface normal.
  • the actual geometric position of points over the
    textured surface are displaced along the surface
    normal according to the values stored into the
    texture.

51
Programmable Shaders
  • Vertex Shader - Small Vertex program that can
    modify the vertex between submission to the
    pipeline and rendering

52
Programmable Shaders
  • Vertex Shader - Small program that can
  • modify every vertex before rendering
  • 3 examples
  • Renderman (software-based, non real-time),
  • Microsofts DirectX (GPU real time)
  • Nvidias Cg (GPU real time)
  • http//www.nzone.com/object/nzone_luna_videos.html
Write a Comment
User Comments (0)
About PowerShow.com