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

Loading in 2 Seconds...

play fullscreen
1 / 31

Computer Graphics - PowerPoint PPT Presentation

  • Uploaded on

Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester 2008-2009. Computer Graphics. University of Palestine. ITGD3107. ITGD3107 Computer Graphics. Chapter 6 Two Dimensional Viewing. Two Dimensional Viewing. The Viewing Pipeline Viewing Effects

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' - garth-church

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
Assistant Professor

Dr. Sana’a Wafa Al-Sayegh

2nd Semester 2008-2009

Computer Graphics

University of Palestine


itgd3107 computer graphics
ITGD3107Computer Graphics

Chapter 6

Two Dimensional Viewing

two dimensional viewing
Two Dimensional Viewing
  • The Viewing Pipeline
  • Viewing Effects
  • Viewing Coordinate Reference Frame
  • Workstation transformation
  • Clipping Operations
  • Line Clipping
  • Polygon Clipping
the viewing pipeline
The Viewing Pipeline
  • Window
    • A world-coordinate area selected for display.

defines what is to be viewed

  • Viewport
    • An area on a display device to which a window is mapped.

defines where it is to be displayed

  • Viewing transformation
    • The mapping of a part of a world-coordinate scene to device coordinates.
  • A window could be a rectangle to have any orientation.
viewing effects
Viewing Effects
  • Zooming effects
    • Successively mapping different-sized windows on a fixed-sized viewports.
  • Panning effects
    • Moving a fixed-sized window across the various objects in a scene.
  • Device independent
    • Viewports are typically defined within the unit square (normalized coordinates)
viewing coordinate reference frame
Viewing Coordinate Reference Frame
  • The reference frame for specifying the world-coordinate window.
    • Viewing-coordinate origin: P0 = (x0, y0)
    • View up vector V: Define the viewing yv direction
clipping operations
Clipping Operations
  • Clipping
    • Identify those portions of a picture that are either inside or outside of a specified region of space.
  • Clip window
    • The region against which an object is to be clipped.
    • The shape of clip window
  • Applications of clipping
  • World-coordinate clipping
clipping operations1
Clipping Operations
  • Viewport clipping
    • It can reduce calculations by allowing concatenation of viewing and geometric transformation matrices.
  • Types of clipping
    • Point clipping
    • Line clipping
    • Area (Polygon) clipping
    • Curve clipping
    • Text clipping
  • Point clipping (Rectangular clip window)
line clipping
Line Clipping
  • Possible relationships between line positions and a standard rectangular clipping region

Before clipping

after clipping

line clipping1
Line Clipping
  • Possible relationships
    • Completely inside the clipping window
    • Completely outside the window
    • Partially inside the window
  • Parametric representation of a line

x = x1 + u(x2 - x1)

y = y1 + u(y2 - y1)

  • The value of u for an intersection with a rectangle boundary edge
    • Outside the range 0 to 1
    • Within the range from 0 to 1
cohen sutherland line clipping
Cohen-Sutherland Line Clipping
  • Region code
    • A four-digit binary code assigned to every line endpoint in a picture.
    • Numbering the bit positions in the region code as 1 through 4 from right to left.
cohen sutherland line clipping1
Cohen-Sutherland Line Clipping
  • Bit values in the region code
    • Determined by comparing endpoint coordinates to the clip boundaries
      • A value of 1 in any bit position: The point is in that relative position.
  • Determined by the following steps:
    • Calculate differences between endpoint coordinates and clipping boundaries.
    • Use the resultant sign bit of each difference calculation to set the corresponding bit value.
cohen sutherland line clipping2
Cohen-Sutherland Line Clipping
  • The possible relationships:
    • Completely contained within the window
      • 0000 for both endpoints.
    • Completely outside the window
      • Logical and the region codes of both endpoints, its result is not 0000.
    • Partially
splitting concave polygons
Splitting Concave Polygons
  • Identify a concave polygon
    • Calculating the cross product of successive edge vectors.
    • If the z component of some cross product is positive while others have a negative, it is concave.
splitting concave polygons1
Splitting Concave Polygons
  • Vector method
    • Calculate the edge-vector cross product in a counterclockwise order.
    • If any z component turns out to be negative
      • The polygon is concave.
      • Split it along the line of the first edge vector in the cross-product pair.
sutherland hodgeman polygon clipping
Sutherland-Hodgeman Polygon Clipping
  • Processing the polygon boundary as a whole against each window edge
    • Processing all polygon vertices against each clip rectangle boundary in turn
sutherland hodgeman polygon clipping1
Sutherland-Hodgeman Polygon Clipping
  • Pass each pair of adjacent polygon vertices to a window boundary clipper
    • There are four cases:
sutherland hodgeman polygon clipping2
Sutherland-Hodgeman Polygon Clipping
  • Intermediate output vertex list
    • Once all vertices have been processed for one clip window boundary, it is generated.
    • The output list of vertices is clipped against the next window boundary.
    • It can be eliminated by a pipeline of clipping routine.
  • Convex polygons are correctly clipped.
  • If the clipped polygon is concave
    • Split the concave polygon
weiler atherton polygon clipping
Weiler-Atherton Polygon Clipping
  • Developed as a method for identifying visible surfaces
    • It can be applied with arbitrary polygon-clipping region.
    • Not always proceeding around polygon edges
    • Sometimes follows the window boundaries
  • For clockwise processing of polygon vertices
    • For an outside-to-inside pair of vertices, follow the polygon boundary.
    • For an inside-to-outside pair of vertices, follow the window boundary in clockwise direction.
other clipping
Other Clipping
  • Curve clipping
    • Use bounding rectangle to test for overlap with a rectangular clip window.
  • Text clipping
    • All-or-none string-clipping
    • All-or-none character-clipping
    • Clip the components of individual characters
exterior clipping
Exterior Clipping
  • Save the outside region
  • Applications
    • Multiple window systems
    • The design of page layouts in advertising or publishing
    • Adding labels or design patterns to a picture
  • Procedures for clipping objects to the interior of concave polygon windows