Docsity

Vertex Processing - Introduction to Computer Graphics - Lecture Slides, Slides of Computer Graphics

Partial preview of the text

Download Vertex Processing - Introduction to Computer Graphics - Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!

Vertex Processing:

Viewing

Rendering Pipeline

  • OpenGL rendering works like an assembly

line

  • Each stage of the pipeline performs a distinct function on the data flowing by
  • Each stage is applied to every vertex to determine its contribution to output pixels Geometry (Vertices) Vertex Processing Rasterizer Fragment Processing Pixels

Vertex Processing

  • Vertex processing consists of:
    • ModelView transform
    • Projection transform
    • Lighting
    • Perspective divide
    • Polygon clipping
    • Viewport transform Vertex Processing

Vertex Processing

Vertex Processing

Vertices

Modelview Transform Projection Transform Clipping & Primitive Assembly Viewport Transform Lighting

Viewing in OpenGL

  • The OpenGL viewpoint acts as a virtual

camera

  • What parameters do you need to define a camera? - Viewpoint (Center of Projection) - View direction - Field of view - Film size - Projection plane

Viewing

  • Viewing requires 3 elements:
    • Objects to be viewed
    • A viewer with a projection surface
    • A projection from the objects to the viewing surface

Viewing

  • Example: OpenGL camera
    • Objects: The input geometry
    • Viewer: The OpenGL “camera” (with the view volume as its viewing “surface”)
    • Projection: The OpenGL projection matrix (GL_PROJECTION), maps 3D space (world coordinates) into 3D space (eye coordinates) - Eventually into normalized device coordinates (NDC)

Classical Viewing

  • Classical views are based on the relationship

between these 3 elements: objects, a

viewer, and a projection

  • In classical views, objects are assumed to be

constructed from flat principal faces

  • i.e. many buildings
  • Used primarily by architects / engineers

Perspective vs. Parallel

  • Perspective
    • Viewing volume is a truncated pyramid
      • aka frustum
  • Orthographic
    • Viewing volume is a box

Perspective

Orthographic

Taxonomy of Planar Geometric

Projections

Planar Geometric Projections

Perspective

Parallel / Orthographic

Multiview Axonometric Oblique

Isometric Dimetric Trimetric

One-point Two-point Three-point

Benefits

  • Why use orthographic?
    • Preserves distances and angles
      • Perspective does not
    • Can be used for measurements
  • Why multiview?
    • The main problem with orthographic projection is that it hides many surfaces
    • Often add isometric view as well

Axonometric Projections

  • Direction of projection is still perpendicular

to the viewing plane

  • But principle faces not parallel to it
  • 3 different kinds:
  • Isometric, dimetric, trimetric
  • Classified by number of different foreshortening factors

Advantages and Disadvantages

  • Advantages:
    • Can see multiple faces of an object simultaneously
    • Lines are scaled, but by a constant factor
      • Could still be used for measurement
  • Disadvantages:
    • Angles not preserved
    • Foreshortening does not depend on distance - Not realistic

Oblique Projection

  • Direction of projection is not

perpendicular to the viewing plane

  • Most general parallel projection
  • Is this possible with a normal camera?