Cap 4703 computer graphic methods
1 / 31

CAP 4703 Computer Graphic Methods - PowerPoint PPT Presentation

  • Uploaded on
  • Presentation posted in: General

CAP 4703 Computer Graphic Methods. Prof. Roy Levow Chapter 5. Viewing. Classical viewing Need to be able to reproduce classical views for a variety of applications Isometric Preserves measurements Elevation View a face of object Perspective Reflects size change of distant objects.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

Download Presentation

CAP 4703 Computer Graphic Methods

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

Cap 4703 computer graphic methods

CAP 4703Computer Graphic Methods

Prof. Roy Levow

Chapter 5



  • Classical viewing

    • Need to be able to reproduce classical views for a variety of applications

    • Isometric

      • Preserves measurements

    • Elevation

      • View a face of object

    • Perspective

      • Reflects size change of distant objects

Viewing terminology

Viewing Terminology

  • Center of Projection (COP)

    • Point where all projectors meet

    • Center of camera or eye lens

    • Origin of synthetic camera frame

  • Direction of Projection (DOP)

    • Direction of projectors when COP is moved to infinity

Types of viewing

Types of Viewing

  • Classical (many)

    • Orthographic

    • One-, two-, and 3-point perspectives

  • Computer

    • Orthographic

    • Perspective

Classical viewing concepts

Classical Viewing Concepts

  • Principal face

    • Primary surface of view

      • Based on rectangular solid structures

  • Orthographic Projection

    • Single view

    • Multiview

      • Show three orthogonal views

Axonometric projections

Axonometric Projections

  • Projectors are orthogonal to the projection plane but plane can be at angle to principal face

    • Isometric – symmetric with all three axes

    • Dimetric – symmetric with two axes

    • Trimetric – general case

    • Produces foreshortening of distances

Oblique projection

Oblique Projection

  • Most general parallel view

    • Projectors make arbitrary angle with projection plane

  • In computer graphics system, isometric, axonometric and oblique projections are all variations on one case



  • Characterized by diminution of size of more distant objects

  • Classically, viewer is symmetrical with respect to the projection plane

  • One-, two-, and three-point perspectives depending on number of vanishing points

Computer viewing

Computer Viewing

  • Choose parallel or perspective view

  • No separation of perspective degrees

  • Two key elements

    • Position camera

    • Apply projection transformaton

Opengl camera

OpenGL Camera

  • Default

    • Camera at origin

    • Pointing in negative z direction

    • Orthogonal view

    • Viewing volume is cube

      • Centered at origin

      • Side of length 2

Default camera

Default Camera

Positioning camera frame

Positioning Camera Frame

  • Can construct camera frame through translation and rotation of model view to get camera to desired viewing position from default position

  • For orthographic view, this does not change clipping volume set by glOrtho()

    • Size is unchanged

    • What is seen will change

View as change of frames

View as Change of Frames

  • Set View-Reference Point (VRP)

    • Center of camera

  • View plane defined by

    • View-plane normal (VPN)

    • View-up vector (VUP)

    • Project VUP onto projection plane to get up direction (vup)

  • Construct new frame with basis for view plane, u-v and normal n; u-v-n

Look at positioning

Look-At Positioning

Opengl look at

OpenGL Look-At

  • OpenGL simplifies camera positioning as follows

    • e = eye point

    • a = look-at point

    • Determines vpn as e – a



      gluLookAt(eyex, eyey, eyez,

      atx, aty, atz, upx, upy, upz);

      /* define objects here */

Perspective projection

Perspective Projection

  • Note: x/z = xp/d or xp= x/(z/d)

    • Similarly for y

    • Provides non-uniform foreshortening

  • Perspective Transformation

    • (x, y, z) -> (xp, yp, zp)

Perspective projection cont

Perspective Projection (cont)

  • Moving to 4 dimensions, consider

    (wx, wy, wz, w)T

  • Perspective transformation matrix

    • 0 0 0takes

      0 1 0 0(x, y, z, 1) T

      0 0 1 0 to

      0 0 1/d 0(x, y, z, z/d) T

  • Division by last coordinate gives

    (xp, yp, d, 1), the projection

Orthogonal projection in opengl

Orthogonal Projection in OpenGL

  • Simply map z into zero

Projection in opengl

Projection in OpenGL

  • Clipping region is a frustum, a truncated pyramid

Opengl frustum

OpenGL Frustum

  • glFrustum(xmin, xmax, ymin, ymax,

    near, far);

    // left, right, top, bottom, near, far

Parallel viewing in opengl

Parallel Viewing in OpenGL

  • glOrtho(xmin, xmax, ymin, ymax,

    near, far);

Hidden surface removal

Hidden Surface Removal

  • Remove hidden surfaces

  • Different view

    • Visible-surface algoritims

      • Identify visible surfaces

  • Work in either

    • Object space

    • Image space

Z buffer algorithm

Z-Buffer Algorithm

  • Image Space

  • Requires depth buffer, called z-buffer to store depth

  • Depth resolution usually 16, 24, or 32 bits

  • As polygon is rasterized, depth is computed and compared with current z-buffer value; only nearer values update

  • Very efficient

Opengl implementation

OpenGL Implementation

  • Enable with

    • glutInitDisplayMode(GLUT_DEPTH…);

    • glEnabel(GL_DEPTH_TEST);

  • Clear with

    • glClear(GL_DEPTH_BUFFER_BIT);

Scene walkthrough

Scene Walkthrough

  • Move camera to view color cube from different locations

    • cubeview.c

Parallel projection matrices

Parallel-Projection Matrices

  • Previous projection matrices do not cover all possibilities

  • Projection Normalization

    • convert all projections to orthogonal

    • by distorting objects

    • distortion is called normalization

  • Map viewing volume into 2x2x2 cube at origin; translate and then scale

Oblique projection1

Oblique Projection

  • Projectors do not need to be orthogonal to projection plane as in standard OpenGL projection

  • Equivalent to a shear transformation of the objects

Perspective projection matrices

Perspective-Projection Matrices

  • Again, distort object

  • Skipping details

  • OpenGL Perspective Transformations

    2z/(X-x) 0 (X+x)/(X-x) 0

    0 2z/(Y-y) (Y+y)/(Y-y) 0

    0 0 -(f+n)/(f-n) -2fn/(f-n)

    0 0 -1 0

Projections and shadows

Projections and Shadows

  • Shadow

    • projection of original polygon onto surface

    • center of projection is light source

    • shadow-polygon

    • shadow.c

  • Login