3D Viewing Pipeline - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

3D Viewing Pipeline

Description:

Orthogonal projection: projection lines are perpendicular to the view plane. ... Cabinet projection: angle = 63.4 degrees / tan (angle) = 2 ... – PowerPoint PPT presentation

Number of Views:1776
Avg rating:3.0/5.0
Slides: 17
Provided by: isabellebi
Category:
Tags: lines | pipeline | tan | viewing

less

Transcript and Presenter's Notes

Title: 3D Viewing Pipeline


1
3D Viewing Pipeline
2
Learning Objectives
  • 3D viewing pipeline
  • OpenGL functions for 3D viewing

3
Learning Objectives
  • Understand the 3D viewing pipeline.
  • Understand OpenGL 3D viewing functions.

4
3D Viewing Pipeline
  • Procedures for displaying views of a
    three-dimensional scene on an output device
    involve many aspects
  • Generate a 3D scene with objects generally
    defined with a set of surfaces forming a closed
    boundary around the object interior.
  • Generate interior of 3D objects, if needed.
  • Project object surfaces views onto the surface of
    a display device with 3D viewing pipeline.
  • Identification of visible parts.
  • Lighting effects and surface characteristics.

5
3D Viewing Pipeline
(from Donald Hearn and Pauline Baker)
6
3D Viewing Pipeline
  • 3D viewing pipeline similar to taking a picture
    with a camera
  • Construct and model the scene in world
    coordinates.
  • Choose a viewing position corresponding to where
    we would place a camera, depending whether we
    want a front, back, top, bottom, or side of the
    scene, or inside of an object, or within group.
  • Choose camera orientation.

7
3D Viewing Pipeline
  • 3D viewing pipeline similar to taking a picture
    with a camera
  • Convert the description of the scene to viewing
    coordinates, which includes the position and
    orientation of the projection plane, called the
    view plane, similar to a camera film plane.
  • Convert and project the viewing coordinates into
    projection coordinates of the 2D clipping region
    selected called the view volume and defined as
    a volume of space enclosed in clipping planes.
  • Transform viewing-coordinates to
    normalized-coordinates (ex between 0 and 1, or
    between -1 and 1), clipping off parts of the
    scene outside the view volume.
  • Map normalized-coordinates to device-coordinates.

8
3D Viewing Pipeline
(from Donald Hearn and Pauline Baker)
9
3D Viewing Pipeline
  • 3D viewing pipeline projection transformations
  • Parallel projection parallel lines are
    transformed into parallel lines can be
    orthogonal or oblique.
  • Orthogonal projection projection lines are
    perpendicular to the view plane.
  • Oblique parallel projections projection lines
    are all parallel and not perpendicular to the
    view plane.
  • Cavalier projection angle 45 degrees
  • Cabinet projection angle 63.4 degrees / tan
    (angle) 2
  • Perspective projection does not conserve parallel
    lines nor objects proportions.
  • Frustum is the view volume between near and far
    clipping planes, and has the shape of a truncated
    pyramid.

10
3D Viewing Pipeline
(from Donald Hearn and Pauline Baker)
11
3D Viewing Pipeline
(from Donald Hearn and Pauline Baker)
12
3D Viewing Pipeline
  • OpenGL 3D viewing functions
  • Modeling of 3D scene
  • Geometric transformation of viewingglMatrixMode
    (GL.GL_MODELVIEW)
  • Viewing parameters specificationglLookAt (x0,
    y0, z0, xref, yref, zref, Vx, Vy, Vz) where
    P0(x0, y0, z0) is viewing position in
    world-coordinates (camera position)where
    Pref(xref, yref, zref) is reference position
    (look-at point) where V(Vx, Vy, Vz) is the
    view-up vector (opposite to viewing
    direction)default P0(0, 0, 0) and Pref(0, 0,
    -1) and V(0, 1, 0) (negative zworld axis)
  • Projection mode
  • glMatrixMode (GL.GL_PROJECTION)
  • glLoadIdentity()
  • Clipping window
  • Orthogonal projection near clipping plane is
    the view planegluOrtho(xwmin, xwmax, ywmin,
    ywmax, dnear, dfar)defaults are (-1.0, 1.0,
    -1.0, 1.0, -1.0, 1.0) (cube centered on
    coordinate origin)

13
3D Viewing Pipeline
  • OpenGL 3D viewing functions
  • Clipping window
  • Perspective projection with symmetric frustum
    volume gluPerspective (theta, aspect, dnear,
    dfar)where theta is the field-of-view angle
    (angle between top and bottom clipping
    planes)where aspect is the value for the aspect
    ratio (width / height) of the clipping
    windowdnear and dfar are the positions of the
    near and far clipping planes and need to be on
    the negative zview axis (in front of the viewing
    position), although their positive values are
    transformed into dnear and -dfar
  • Perspective projection with symmetric or not
    frustum volume glFrustum (xwmin, xwmax, ywmin,
    ywmax, dnear, dfar)where near plane is the view
    planewhere xwmin, xwmax, ywmin, ywmax are the
    coordinates of the clipping window on the near
    planednear and dfar are the positions of the
    near and far clipping planes and need to be on
    the negative zview axis (in front of the viewing
    position), although their positive values are
    transformed into dnear and dfar.

14
3D Viewing Pipeline
  • OpenGL 3D viewing functions
  • Viewport
  • glViewport (xvmin, yvmin, vpwidth,
    vpHeight)default is size of the display
    windowwhere xvmin and yvmin represent the
    integer position of the lower-left corner of the
    viewportwhere vpwidth and vpheight give the
    integer width and height of the viewport.
  • glGetIntegerv (GL.GL_VIEWPORT, vpArray)returns
    an array of integers containing the current
    viewport parameters xvmin, yvmin, vpwidth,
    vpHeight.

15
3D Viewing Pipeline
(from Donald Hearn and Pauline Baker)
16
3D Viewing Pipeline
  • Example Chap73DViewingPipeline.javaperspective
    projection of a square
Write a Comment
User Comments (0)
About PowerShow.com