Understanding 3D Projection and Cohen-Sutherland Clipping

Posted by Anonymous and classified in Visual arts

Written on in English with a size of 3.3 KB

What Is Projection?

Definition: Projection is the process of representing a three-dimensional (3D) object on a two-dimensional (2D) projection plane. It is used to display 3D objects on a computer screen.

Parallel Projection

In parallel projection, all projection lines are parallel to each other.

Types of Parallel Projection

  • Orthographic Projection
  • Oblique Projection

1. Oblique Projection

In oblique projection, projection lines are parallel but inclined to the projection plane.

Types of Oblique Projection
  • (a) Cavalier Projection: Receding lines are drawn at 45°. Depth is shown at full scale, making the object appear longer in depth.
    • Angle: 45°
    • Depth Scale: 1
  • (b) Cabinet Projection: Receding lines are drawn at 45°. Depth is reduced to half of the actual length. It is more realistic than Cavalier.
    • Angle: 45°
    • Depth Scale: 1/2

2. Orthographic Projection

Orthographic projection is a parallel projection where projection lines are perpendicular to the projection plane.

Types of Orthographic Projection
  • (a) Isometric Projection: All three principal axes are equally inclined with equal foreshortening.
    • Three axes make equal angles.
    • Scale is equal along all axes.
  • (b) Dimetric Projection: Two axes have equal foreshortening, while the third axis has a different foreshortening.
    • Two scales are equal.
    • One scale is different.

Cohen-Sutherland Line Clipping Algorithm

Definition: The Cohen–Sutherland Line Clipping Algorithm is used to determine the visible portion of a line within a rectangular clipping window. It efficiently accepts, rejects, or clips a line segment against the window.

Concept

The clipping window is divided into 9 regions. Each region is assigned a 4-bit region code (Outcode):

1001 | 1000 | 1010
------------------
0001 | 0000 | 0010
------------------
0101 | 0100 | 0110

Bit Representation

  • 1st: Top
  • 2nd: Bottom
  • 3rd: Right
  • 4th: Left

0000 indicates the point is inside the clipping window.

Steps of the Algorithm

  1. Assign Region Codes: Find the 4-bit region code for each endpoint of the line.
  2. Check for Trivial Acceptance: If both endpoints have code 0000, the line lies completely inside the window. Result: Accept the line.
  3. Check for Trivial Rejection: If the logical AND of both region codes is not zero (Code1 AND Code2 ≠ 0), the line lies completely outside the window. Result: Reject the line.
  4. Perform Clipping: If neither accepted nor rejected, select an endpoint outside the window, find the intersection point with the boundary, replace the outside endpoint with the intersection point, and recalculate the region code.
  5. Repeat: Repeat the process until the line is either accepted or rejected.

Advantages

  • Simple and efficient.
  • Fast acceptance and rejection of lines.

Related entries: