ch12 view1

Upload: jacqulin-margret

Post on 03-Apr-2018

259 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 ch12 view1

    1/29

    p_16

    _10

    @hotmail.comit4ever2008 @hotmail.com 1

    University of PalestineComputer Graphics

    ITGD3107

    Prepare:Mohammed J. el-masre

    Nidal M. El-Borbar

    Supervision:Dr. Sana'a

    Presentation name :Three Dimensional Viewing

  • 7/29/2019 ch12 view1

    2/29

    p_16

    _10

    @hotmail.comit4ever2008 @hotmail.com 2

    Contents

    3D ViewingCamera AnalogyViewing Pipeline

    Camera Modeling w/ OpenGLProjectionsTypes of ProjectionsPerspective ProjectionParallel ProjectionProjection Matrix

    Projection of Lines3D Viewing with OpenGLMatrix ModesThree Dimensional Viewing

  • 7/29/2019 ch12 view1

    3/29

    p_16

    _10

    @hotmail.comit4ever2008 @hotmail.com 3

    3D ViewingThe steps for computer generation of a view of a three

    dimensional scene are somewhat analogous to the

    processes involved in taking a photograph.

  • 7/29/2019 ch12 view1

    4/29

    p_16

    _10

    @hotmail.comit4ever2008 @hotmail.com 4

    Camera Analogy

    Position

    Orientation

    Window (aperture)

    of the camera

    1. Viewing position

    2. Camera orientation

    3. Size of clippingwindow

  • 7/29/2019 ch12 view1

    5/29

    p_16

    _10

    @hotmail.comit4ever2008 @hotmail.com 5

    Viewing PipelineThe general processing steps for modeling and

    converting a world coordinate description of a

    scene to device coordinates:

  • 7/29/2019 ch12 view1

    6/29

    p_16

    _10

    @hotmail.comit4ever2008 @hotmail.com 6

  • 7/29/2019 ch12 view1

    7/29

    p_16

    _10

    @hotmail.comit4ever2008 @hotmail.com 7

    Viewing Pipeline1. Construct the shape of individual objects in a scene within modeling

    coordinate, and place the objects into appropriate positions within the scene

    (world coordinate).

  • 7/29/2019 ch12 view1

    8/29

    p_16

    _10

    @hotmail.comit4ever2008 @hotmail.com 8

    Viewing PipelineWorld coordinate positions are converted to viewing

    coordinates.

  • 7/29/2019 ch12 view1

    9/29

    p_16

    _10

    @hotmail.comit4ever2008 @hotmail.com 9

    Viewing PipelineConvert the viewing coordinate description of the

    scene to coordinate positions on the projection

    plane.

  • 7/29/2019 ch12 view1

    10/29

    p_16

    _10

    @hotmail.comit4ever2008 @hotmail.com 10

    Viewing Pipeline

    Positions on the projection plane, will then mapped

    to the Normalized coordinate and output device.

  • 7/29/2019 ch12 view1

    11/29

    11

    Camera Modeling w/ OpenGLcamera coordinatesystem

    viewport coordinate

    system

    device/screen

    coordinate system

  • 7/29/2019 ch12 view1

    12/29

    Coordinate Systems

    World Coordinate System-This is object space or the space in

    which the application model is defined.

    Screen Coordinate System-The space in which the image is

    displayed.World Window (or clipping)-This is the rectangle in the world

    defining the region that is to be displayed.

    Viewport-The rectangular portion of the interface window that

    defines where the image will actually appear (usually theentire interface window but in some cases modified to be a

    portion of the interface window).

    Viewing Transformation-The process of mapping a world

    window in World Coordinates to the Viewport.12

  • 7/29/2019 ch12 view1

    13/29

    Window to Viewport mapping

    Window-to-Viewport mapping is the process of

    mapping or transforming a two-dimensional,world-coordinate scene to device coordinates. In

    particular, objects inside the world or clipping

    window are mapped to the viewport. The viewport

    is displayed in the interface window on the screen.In other words, the clipping window is used to

    select the part of the scene that is to be displayed.

    The viewport then positions the scene on the

    output device. 13

  • 7/29/2019 ch12 view1

    14/29

    Projection plane

    1. Projection plane called the view plane in

    computer graphics

    2. It is defined by a point called view

    reference point (VRP) and a normal (a

    vector perpendicular to the plane) called

    view plane normal (VPN).

    14

  • 7/29/2019 ch12 view1

    15/29

    Viewing Coordinates

    View Reference point: It is the center of viewing

    coordinate system. It is chosen to be close to or onsurface of object in a scene.

    View Plane normal vector: This normal vector is in

    a direction perpendicular to view plane.

    View Distance: It is the distance from view plane to

    view reference point. 15

  • 7/29/2019 ch12 view1

    16/29

    Positioned by a View distance

    16

  • 7/29/2019 ch12 view1

    17/29

    17

    Projections

    Once the view volume isdetermined, aprojectiontransformation willconvert the object inthe 3D view volume toa 2D image on the

    projection plane.

  • 7/29/2019 ch12 view1

    18/29

    18

    Types of Projections

    Perspective ProjectionParallel Projection

  • 7/29/2019 ch12 view1

    19/29

    19

    Perspective Projection (1/2)

    Give a realistic view of 3D objects, but doesnot preserve shape of object or scale

    Perspective images of parallel lines notparallel with projection plane converge to apoint called vanishing point or projectionreference point.

    Size of object is diminished with distance Used in architectural, engineering, industrial

    design, and advertising drawings

  • 7/29/2019 ch12 view1

    20/29

    20

    Perspective Projection (2/2)

    3-point perspective

    1-point perspective

    2-point perspective

    Most popular

  • 7/29/2019 ch12 view1

    21/29

    21

    Parallel Projection

    Accurate and same-scale measurements

    Not realistic, and may require multipleprojections to get a complete feeling of theobject

    Used in drawings of machine parts and inworking architectural drawings

  • 7/29/2019 ch12 view1

    22/29

    Orthographic ProjectionProjectors are orthogonal to projection surface

    22

  • 7/29/2019 ch12 view1

    23/29

    Multiview Orthographic Projection

    1. Projection plane parallel to principal face2. Usually form front, top, side views

    p_16_10 @hotmail.comit4ever2008 @hotmail.com 23

  • 7/29/2019 ch12 view1

    24/29

    Axonometric Projections

    Allow projection plane to move relative

    to object

    24

  • 7/29/2019 ch12 view1

    25/29

    Types of

    Axonometric Projections

    25

  • 7/29/2019 ch12 view1

    26/29

    Oblique Projections

    Projectors not orthogonal to projection plane

    The projection plane is typically parallel to a face of the

    object

    Classified by the angle between projector and plane

    Pi/4: Cavalier type

    Preserves the lengths of edges orthogonal to projection

    plane. Cavalier: 45 degree ArcTan(2): Cabinet type

    Halves the lengths of edges orthogonal to projection plane

    Cabinet: arctan(2) =63.4 degree

    26

  • 7/29/2019 ch12 view1

    27/29

    Types of Perspective Projections

    Based on number of vanishing points for

    lines parallel to the three coordinateaxes

    Determined by number of axes parallel

    to the viewing plane

    27

  • 7/29/2019 ch12 view1

    28/29

    Types

    28

  • 7/29/2019 ch12 view1

    29/29

    p_16_10 @hotmail.comit4ever2008 @hotmail.com 29