computer graphics fall 2009 n.
Skip this Video
Loading SlideShow in 5 Seconds..
Computer Graphics (fall 2009) PowerPoint Presentation
Download Presentation
Computer Graphics (fall 2009)

Loading in 2 Seconds...

play fullscreen
1 / 36

Computer Graphics (fall 2009) - PowerPoint PPT Presentation

  • Uploaded on

Computer Graphics (fall 2009). School of Computer Science University of Seoul. Chap 5: Viewing. Classical and Computer Viewing Viewing with a Computer Positioning of the Camera Simple Projections Projections in OpenGL Hidden-Surface Removal Interactive Mesh Displays

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

PowerPoint Slideshow about 'Computer Graphics (fall 2009)' - hugh

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
computer graphics fall 2009

Computer Graphics(fall 2009)

School of Computer Science

University of Seoul

chap 5 viewing
Chap 5: Viewing
  • Classical and Computer Viewing
  • Viewing with a Computer
  • Positioning of the Camera
  • Simple Projections
  • Projections in OpenGL
  • Hidden-Surface Removal
  • Interactive Mesh Displays
  • Parallel-Projection Matrices
  • Perspective-Projection Matrices
  • Projections and Shadows
basic elements
Basic Elements
  • Object
  • Projector
  • Projection Plane
  • COP (Center of Projection) or DOP (Direction of Projection)
  • Principal faces/directions
classical viewing
Classical Viewing
  • Orthographic projections
  • Axonometric projections
    • Isometric, dimetric, trimetric
  • Oblique projections
  • Perspective projections
    • One-, two-, three-point perspectives
1 orthographic projections
1. Orthographic Projections
  • Projectors perpendicular to the projection plane
  • Multivieworthographic projection

(image courtesy of

2 axonometric projections
2. Axonometric Projections
  • Projectors orthogonal to the projection plane
  • Projection plane can have any orientation with respect to the object
  • Isometric, dimetric, trimetric
    • How many principal faces is the projection plane is placed symmetrically with respect to
3 oblique projections
3. Oblique Projections
  • Most general parallel views
  • Projector can have an arbitrary angle with the projection plane
4 perspective viewing
4. Perspective Viewing
  • To achieve real-looking images
  • One-, two-, three-point perspectives
    • Number of vanishing points
    • How many of three principal directions in the object are parallel to the projection plane?
opengl viewing
OpenGL Viewing
  • All the classical viewing can be implemented HOW??? (§5.9 & §5.10)
  • Default camera
    • Orthographic
    • Projection plane: “z=0”
    • At the origin pointing to –z-direction
    • Up direction: +y-direction
    • Viewing volume: cube with side 2  objects outside of this box cannot be rendered! (“clipping”)
    • Objects behind the camera can be rendered! (only for orthogonal projections)
positioning the camera
Positioning the Camera
  • No separate “viewing” transformation  concatenated into model-view matrices
  • Object coords.worldcoords.eyecoords.
  • What matters is the relative position of objects and the camera
  • At any given time, the state of the model-view matrix encapsulates the relationship between the camera frame and the object frame
positioning the camera cont d
Positioning the Camera (cont’d)
  • Separate matrices For model & viewing
  • Model-view matrix (OpenGL)
viewing coordinate system
Viewing-Coordinate System
  • Defined by
    • Position (VRP: view-reference point, p)
    • Viewing direction (VPN: view-plane normal , n)
    • Up direction (VUP: view-up vector, vup)
      • Projected on the view plane (v)
    • 3rd orthogonal direction (u) obtained by cross product
  • View-orientation matrixderivation? (advanced)
  • x, y, z axes  u, v, n
  • gluLookAt
    • Needs to be called before transforming objects
    • Error in the book (p.251)
other viewing apis
Other Viewing APIs
  • Roll, pitch, yaw
    • To specify the orientation
    • Ex) flight simulation
  • Elevation, azimuth, twist
    • Direction from the viewer
    • Ex) star in the sky
perspective projections
Perspective Projections
  • All projectors pass through the origin
  • (x,y,z)(xp,yp,zp)
  • Nonlinear, not affine, irreversible
  • Perspective division required
  • “Extended” homogeneous coordinates required  3D points = 4D lines (through the origin): (x,y,z,1)(x,y,z,z/d)=(xp,yp,zp,1)
  • How does the matrix look like?
orthogonal projections
Orthogonal Projections
  • No division required
  • (x,y,z)(x,y,0)=(xp,yp,zp)
  • How does the matrix look like?
projections in opengl
Projections in OpenGL
  • Parameters in eye coordinates
  • Near/far clipping planes
perspective viewing in opengl
Perspective Viewing in OpenGL
  • glFrustum
    • Need not be symmetric
  • gluPerspective
    • Symmetric
    • Defined using fov (field of view)  error in the figure 5.28 of the textbook
    • Calls glFrustum internally
  • near & far parameters must be positive

(image courtesy of the redbook)

parallel viewing in opengl
Parallel Viewing in OpenGL
  • glOrtho
  • gluOrtho2D
  • No sign restrictions on near & far parameters
hidden surface removal
Hidden-Surface Removal
  • How to determine which object is closer than others?
  • What happens without hidden-surface removal?
  • Two classes
    • Object space algorithm
      • BSP (Binary Space Partitioning) tree  restriction?
    • Image space algorithm
      • Z-buffer algorithm  used in (most) interactive graphics system including OpenGL
        • Complexity proportional to the resolution
        • Small overhead
        • More in Chap 7
  • Culling
    • Back faces of closed objects not rendered
    • Number of primitives reduced early
projection normalization
Projection Normalization
  • All projections are converted into orthogonal projections by first distorting the objects such that the orthogonal projection of the distorted objects is the same as the desired projection of the original objects.
  • Simplifies clipping & hidden-surface removal(Chap 7)
orthogonal projection matrices
Orthogonal-Projection Matrices
  • Normalization(by OpenGL projection matrix)
    • Converts the specified viewing volume to canonical view volume ([-1,1]x[-1,1]x[-1,1] cube)
    • Translation followed by scaling
  • Orthographic projection
    • (x,y,z)  (x,y,0)
oblique projections
Oblique Projections
  • We can either
    • Define the 4x4 matrix directly or
    • Implement by shear followed by orthographic projection (In practice, normalization is required in between)
simple perspective projection
Simple Perspective Projection
  • Frustum defined by x=±z, y=±z, z_max, z_min
  • For the perspective-normalization matrix N,what converts the planes as follows?
    • x=±z  x’’=±1
    • y=±z  y’’=±1
    • z=z_max z’’=1
    • z=z_minz’’=-1
perspective projection
Perspective Projection
  • Depth ordering preserved by perspective-projection matrix  hidden-surface removal works in the normalized volume
  • General perspective projection
    • Apply shear to convert the asymmetric frustum to a symmetric one
    • Scale to the “simple” frustum
  • A point is in shadow if it is not illuminated by any light source, or equivalently if a viewer at that point cannot see any light source.
  • Shadow polygon
rendering shadow
Rendering Shadow
  • Render twice: object polygon and shadow polygon
  • How to find the shadow polygon?  perspective projection (with light source as the camera)
  • Works only for shadowson flat surface
  • More on Chap 12