Line Clipping and Rasterization in Graphics Pipeline, Slides of Computer Science

An in-depth exploration of line clipping and rasterization in the context of the graphics pipeline. It covers the importance of clipping, various clipping strategies, and the process of rasterizing lines and circles. The document also discusses antialiasing techniques to ensure continuous appearance and accuracy.

Typology: Slides

2012/2013

Uploaded on 03/22/2013

dhirendra
dhirendra 🇮🇳

4.3

(78)

268 documents

1 / 62

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
The Graphics
Pipeline:
Line Clipping &
Line Rasterization
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e

Partial preview of the text

Download Line Clipping and Rasterization in Graphics Pipeline and more Slides Computer Science in PDF only on Docsity!

The Graphics^ Pipeline: Line Clipping & Line Rasterization

Docsity.com

Last Time?

-^ Ray Tracing vs. Scan Conversion•^ Overview of the Graphics Pipeline•^ Projective Transformations ModelingTransformations Illumination(Shading) Viewing Transformation(Perspective / Orthographic)^ Clipping Projection(to Screen Space) Scan Conversion(Rasterization) Visibility / Display

Docsity.com

Today: Line Clipping & Rasterization

-^ Portions of theobject outsidetheview frustumare removed•^ Rasterizeobjectsinto pixels ModelingTransformations Illumination(Shading) Viewing Transformation(Perspective / Orthographic)^ Clipping^ Projection(to Screen Space) Scan Conversion(Rasterization) Visibility / Display

Docsity.com

Today • Why Clip? • Line Clipping • Overview of Rasterization • Line Rasterization • Circle Rasterization • Antialiased Lines

Docsity.com

Why clip? • Avoid degeneracies– Don’t draw stuffbehind the eye– Avoid divisionby 0 and overflow• Efficiency– Don’t waste time on objectsoutside the image boundary• Other graphics applications (often non-convex)– Hidden-surface removal, Shadows, Picking,Binning, CSG (Boolean) operations (2D & 3D)

Docsity.com

Clipping strategies • Don’t clip (and hope for the best) • Clip on-the-fly during rasterization • Analytical clipping: alter input geometry

Docsity.com

Today • Why Clip? • Point & Line Clipping^ – Plane – Line intersection^ – Segment Clipping^ – Acceleration using outcodes • Overview of Rasterization • Line Rasterization • Circle Rasterization • Antialiased Lines

Docsity.com

Implicit 3D Plane Equation • Plane defined by:^ point

p &^ normal

n^ OR

normal^ n &

offset^ d^

OR

3 points • Implicit plane equation A x +B y +C

z +D = 0

P^ P^0 Docsity.com

Point-to-Plane Distance

P^0 P’

P d^ H = (A,B,C,D)

  • If (A,B,C) is normalized:^ d = H•p = H

Tp

(the dot product in homogeneous coordinates) • d is a^ signed distance positive = "inside" negative = "outside"

Docsity.com

Clipping a Point with respect to a Plane

P^0 P’

P d^ H = (A,B,C,D)

  • If d = H•p

≥^0 Pass through • If d = H•p < 0: Clip (or cull or reject)

Docsity.com

What are the View Frustum Planes?

H=(^0 near^ H= far^ H= bottom^ H= top^ H= left^ H= right^

–1^ – near ) (^0

1 far^ ) (^0 near bottom

(^0 – near

  • top^ 0 ) (^ left^ near
^0 0 )

(– right^ – near

^0 0 )

P ( left , bottom , – near

( right*far/near

,^ top*far/near

, – far )

Docsity.com

Clipping & Transformation • Transform M (e.g. from world space to NDC) • The plane equation is transformed with (M

-1T )^ ( 1,1,1 )

y nearfar z

y x

xo^ eye

z

Docsity.com

Segment Clipping • If H^ •^ p > 0 and H

•q < 0

  • clip q to plane • If H^ •^ p < 0 and H

•q > 0

  • If H^ •^ p > 0 and H

•q > 0

  • If H^ •^ p < 0 and H

•q < 0

p^ n q Docsity.com

Segment Clipping • If H^ •^ p > 0 and H

•q < 0

  • clip q to plane • If H^ •^ p < 0 and H

•q > 0

  • clip p to plane • If H^ •^ p > 0 and H

•q > 0

  • If H^ •^ p < 0 and H

•q < 0

n^ p q Docsity.com