3D viewing -a.pdf

Embed Size (px)

Citation preview

  • 7/27/2019 3D viewing -a.pdf

    1/10

    '

    &

    $

    %

    3D Viewing

    Chapter 7

    3D pipeline

    3D Viewing coordinates and viewing transformations

    Projections

    1

  • 7/27/2019 3D viewing -a.pdf

    2/10

    '

    &

    $

    %

    3D Viewing Overview

    More complicated than 2D because there are more possibilities.

    Coordinate reference for viewing needs more parameters than in 2D.

    What kind of projection?

    How to give the illusion of depth?

    Identifying visible lines and surfaces

    Surface rendering

    2

  • 7/27/2019 3D viewing -a.pdf

    3/10

    '

    &

    $

    %

    Camera Position and Orientation

    To know how to display a 3D scene, we need to know

    Where we are looking from

    What direction we are looking

    Which direction is up

    One way to model this is to think of how you take a picture with a camera

    The film plane is where the image will be.

    3

  • 7/27/2019 3D viewing -a.pdf

    4/10

    '

    &

    $

    %

    If you look at a wire frame diagram, it can be difficult to tell what is in front.

    This can also be true for solid figures if the color is flat.

    Possible solutions

    Make brightness inversely proportional to distance from viewer.

    Make distant objects fuzzier like the effect of haze in real life.

    Give visible lines different brightness (or color) than invisible ones.

    Render surfaces with lighting effects which gives cues about orientation.

    4

  • 7/27/2019 3D viewing -a.pdf

    5/10

    '

    &

    $

    %

    3D Viewing Pipeline

    Use a similar sequence to what we did in 2D.

    You need more information to specify the viewing transformation.

    You need to specify how to project from 3D to 2D.

    5

  • 7/27/2019 3D viewing -a.pdf

    6/10

    '

    &

    $

    %

    Specifying Viewing Coordinates

    Specify a viewing reference frame by

    giving

    P0 = (x0, y0, z0) which is the view-

    ing origin (eye or camera position).

    V which is the view-up vector

    zview axis eye is usually looking

    toward zview = inf.

    6

  • 7/27/2019 3D viewing -a.pdf

    7/10

    '

    &

    $

    %

    uvn Coordinate Reference Frame

    Usually consider a viewing plane that is perpendicular to zview .

    View-up vector establishes where up is in the viewing plane.

    It need to be perpendicular to zview.

    Third coordinate direction is determined by requirement that the directionsbe orthogonal.

    uvn coordinate system defined by

    n = N|N| = (nx, ny, nz)

    u = VN|V| = (ux, uy, uz)

    v = n u = (vx, vy, vz)

    yview

    xview

    zview

    nu

    v

    7

  • 7/27/2019 3D viewing -a.pdf

    8/10

    '

    &

    $

    %

    World to Viewing Coordinate Transformations

    Translate viewing origin to world origin

    T =

    1 0 0 x0

    0 1 0 y0

    0 0 1 z0

    0 0 0 1

    Rotate to align viewing and world coordinate axes

    B =

    ux uy uz 0

    vx vy vz 0

    nx ny nz 0

    0 0 0 1

    8

  • 7/27/2019 3D viewing -a.pdf

    9/10

    '

    &

    $

    %

    Composite transform is

    MW CV C = R T =

    ux uy uz u P0

    vx vy vz v P0

    nx ny nz n P0

    0 0 0 1

    where P0 is the vector from the world coordinate origin to the viewing coor-

    dinate origin.

    9

  • 7/27/2019 3D viewing -a.pdf

    10/10

    '

    &

    $

    %

    Projections

    Parallel

    Coordinates are transformed

    along parallel lines

    Relative sizes are preserved

    Parallel lines remain parallel

    Perspective

    Projection lines converge at a

    point

    More distant objects are rela-

    tively smaller

    Closer to the way we actually see

    things

    10