Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar...

66
Computer Graphics Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010

Transcript of Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar...

Page 1: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Computer Graphics

Subodh Kumar

Dept of Computer Sc. & Engg.IIT Delhi

Thursday 4 February 2010

Page 2: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Pixel/Screen Coordinates

Thursday 4 February 2010

Page 3: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Pixel/Screen Coordinates

Thursday 4 February 2010

Page 4: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Pixel/Screen Coordinates

Xscreen = 0 1 w-1

Thursday 4 February 2010

Page 5: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Pixel/Screen Coordinates

Xscreen = 0 1 w-1

Caution: In OpenGL this is X = 0, pixel centers are at int + .5

Thursday 4 February 2010

Page 6: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Polygon RasterizationDraw pixels “intersected” by polygon

But one color per pixel..And 2D polygon?

Can iterate over rows (scan lines) Find intersection of scan-lines with edges

All lines and edges?

Thursday 4 February 2010

Page 7: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Polygon RasterizationDraw pixels “intersected” by polygon

But one color per pixel..And 2D polygon?

Can iterate over rows (scan lines) Find intersection of scan-lines with edges

All lines and edges?

Thursday 4 February 2010

Page 8: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization Issues

Sliver problem

Thursday 4 February 2010

Page 9: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Animating Slivers

Triangle Rasterization Issues

Thursday 4 February 2010

Page 10: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization Issues

Shared Edge Ownership

Thursday 4 February 2010

Page 11: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Polygon Rasterization Rules

Draw pixel, if center inside polygonWhat if it is at an edge?Draw on left edge, Skip on right edgeUnless Horizontal

Then, draw a bottom edge, skip a top edge

Find lo, hi y (scanline)For y=lo to hi: Find left extreme (of span) Find right extreme (of span) For left to right, draw pixel

Thursday 4 February 2010

Page 12: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

Thursday 4 February 2010

Page 13: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

For a scan line: find Left extreme

Thursday 4 February 2010

Page 14: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

For a scan line: find Left extremeRemember from previous line:

Thursday 4 February 2010

Page 15: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

For a scan line: find Left extremeRemember from previous line:

StartX = StartXprevious+ 1/m

Thursday 4 February 2010

Page 16: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

For a scan line: find Left extremeRemember from previous line:

StartX = StartXprevious+ 1/m

Similarly find Right extreme

Thursday 4 February 2010

Page 17: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

For a scan line: find Left extremeRemember from previous line:

StartX = StartXprevious+ 1/m

Similarly find Right extreme Extrema are on two edges

Thursday 4 February 2010

Page 18: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

For a scan line: find Left extremeRemember from previous line:

StartX = StartXprevious+ 1/m

Similarly find Right extreme Extrema are on two edges

(sometimes at vertices)

Thursday 4 February 2010

Page 19: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

For a scan line: find Left extremeRemember from previous line:

StartX = StartXprevious+ 1/m

Similarly find Right extreme Extrema are on two edges

(sometimes at vertices)Which two?

Thursday 4 February 2010

Page 20: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

For a scan line: find Left extremeRemember from previous line:

StartX = StartXprevious+ 1/m

Similarly find Right extreme Extrema are on two edges

(sometimes at vertices)Which two?

Start with two at the lowest vertex

Thursday 4 February 2010

Page 21: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

For a scan line: find Left extremeRemember from previous line:

StartX = StartXprevious+ 1/m

Similarly find Right extreme Extrema are on two edges

(sometimes at vertices)Which two?

Start with two at the lowest vertex What if there are two lowest vertices?

Thursday 4 February 2010

Page 22: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

For a scan line: find Left extremeRemember from previous line:

StartX = StartXprevious+ 1/m

Similarly find Right extreme Extrema are on two edges

(sometimes at vertices)Which two?

Start with two at the lowest vertex What if there are two lowest vertices?

When an edge ends (at a vertex), replace edge

Thursday 4 February 2010

Page 23: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

For a scan line: find Left extremeRemember from previous line:

StartX = StartXprevious+ 1/m

Similarly find Right extreme Extrema are on two edges

(sometimes at vertices)Which two?

Start with two at the lowest vertex What if there are two lowest vertices?

When an edge ends (at a vertex), replace edge What if both edges end?

Thursday 4 February 2010

Page 24: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

General Polygon Rasterization

Thursday 4 February 2010

Page 25: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

General Polygon Rasterization

Multiple spans

Thursday 4 February 2010

Page 26: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

General Polygon Rasterization

Multiple spans

B

CD

E

FG

I H

J

AThursday 4 February 2010

Page 27: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

General Polygon Rasterization

Multiple spans

B

CD

E

FG

I H

J

AThursday 4 February 2010

Page 28: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

General Polygon Rasterization

Multiple spans

B

CD

E

FG

I H

J

AThursday 4 February 2010

Page 29: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

General Polygon Rasterization

Multiple spansCount parity

B

CD

E

FG

I H

J

AThursday 4 February 2010

Page 30: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

General Polygon Rasterization

Multiple spansCount parity

How do you count vertex intersections?

B

CD

E

FG

I H

J

AThursday 4 February 2010

Page 31: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

General Polygon Rasterization

Multiple spansCount parity

How do you count vertex intersections?

Divide into triangles

B

CD

E

FG

I H

J

AThursday 4 February 2010

Page 32: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangulation

Draw horizontal line at each vertexAssume no two vertices have the

same YPerturb if assumption not true

Draw diagonals of trapezoids Decomposed into monotone

polygons Triangulate monotone polygon O(n lg* n)

Thursday 4 February 2010

Page 33: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangulating Monotone Polygons Process vertices from low to high Push first (lowest two) vertices on a stack For each vi

If vi and top are on the same chain: Form diagonal with the top and pop until possible Finally, push vi

Otherwise savetop := top Form diagonal with the top and pop until possible Finally, push savetop and vi

O(n)

Thursday 4 February 2010

Page 34: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangulating Monotone Polygons Process vertices from low to high Push first (lowest two) vertices on a stack For each vi

If vi and top are on the same chain: Form diagonal with the top and pop until possible Finally, push vi

Otherwise savetop := top Form diagonal with the top and pop until possible Finally, push savetop and vi

O(n)

Thursday 4 February 2010

Page 35: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangulating Monotone Polygons Process vertices from low to high Push first (lowest two) vertices on a stack For each vi

If vi and top are on the same chain: Form diagonal with the top and pop until possible Finally, push vi

Otherwise savetop := top Form diagonal with the top and pop until possible Finally, push savetop and vi

O(n)

Thursday 4 February 2010

Page 36: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangulating Monotone Polygons Process vertices from low to high Push first (lowest two) vertices on a stack For each vi

If vi and top are on the same chain: Form diagonal with the top and pop until possible Finally, push vi

Otherwise savetop := top Form diagonal with the top and pop until possible Finally, push savetop and vi

O(n)

Thursday 4 February 2010

Page 37: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangulating Monotone Polygons Process vertices from low to high Push first (lowest two) vertices on a stack For each vi

If vi and top are on the same chain: Form diagonal with the top and pop until possible Finally, push vi

Otherwise savetop := top Form diagonal with the top and pop until possible Finally, push savetop and vi

O(n)

Thursday 4 February 2010

Page 38: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangulating Monotone Polygons Process vertices from low to high Push first (lowest two) vertices on a stack For each vi

If vi and top are on the same chain: Form diagonal with the top and pop until possible Finally, push vi

Otherwise savetop := top Form diagonal with the top and pop until possible Finally, push savetop and vi

O(n)

Thursday 4 February 2010

Page 39: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Edge Equations

Edge equation (line equation)Defines two half-spaces:

Thursday 4 February 2010

Page 40: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Evaluation

Triangle = intersection of three positive half-spaces:

A1x + B1y + C1 < 0

A2x + B

2y + C2 < 0

A 3x +

B3y

+ C

3 < 0

A1x + B1y + C1 > 0

A 3x +

B3y

+ C

3 > 0 A

2x + B2y + C

2 > 0

Thursday 4 February 2010

Page 41: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Evaluate Edge Equations

Plug in pixels’ x,y into the equationIf F(x,y) > 0, draw

+++-

--

Thursday 4 February 2010

Page 42: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization

Thursday 4 February 2010

Page 43: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization Setup:

Find inverse of edge slopesFind bounding box

Thursday 4 February 2010

Page 44: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization Setup:

Find inverse of edge slopesFind bounding box

Rasterize: Initialize left, right intersectionFrom Bounding Box bottom to Top:

Update left, right intersectionRound up or downFill span

Thursday 4 February 2010

Page 45: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization Setup:

Find inverse of edge slopesFind bounding box

Rasterize: Initialize left, right intersectionFrom Bounding Box bottom to Top:

Update left, right intersectionRound up or downFill span

Interpolate Z, Color?Do in fragment shaderFill span = create fragment

Thursday 4 February 2010

Page 46: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization, Really

Multiple rasterizers?Blocked or Strided

Create tiles of fragmentsIn parallel, divide tiles into

sub-tilesEach sub-tile shaded

togetherMask to turn off uncovered

tiles

Thursday 4 February 2010

Page 47: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization, Really

Multiple rasterizers?Blocked or Strided

Create tiles of fragmentsIn parallel, divide tiles into

sub-tilesEach sub-tile shaded

togetherMask to turn off uncovered

tiles

Thursday 4 February 2010

Page 48: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization, Really

Multiple rasterizers?Blocked or Strided

Create tiles of fragmentsIn parallel, divide tiles into

sub-tilesEach sub-tile shaded

togetherMask to turn off uncovered

tiles

Thursday 4 February 2010

Page 49: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Triangle Rasterization, Really

Multiple rasterizers?Blocked or Strided

Create tiles of fragmentsIn parallel, divide tiles into

sub-tilesEach sub-tile shaded

togetherMask to turn off uncovered

tiles

Partially covered sub-tile

Fully covered sub-tile

Thursday 4 February 2010

Page 50: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Multi-sampling

An attempt to increase resolutionAnti-aliasing: more on this later

Thursday 4 February 2010

Page 51: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Multi-sampling

An attempt to increase resolutionAnti-aliasing: more on this later

Thursday 4 February 2010

Page 52: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Multi-sampling

An attempt to increase resolutionAnti-aliasing: more on this later

Thursday 4 February 2010

Page 53: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Multi-sampling

An attempt to increase resolutionAnti-aliasing: more on this later

Thursday 4 February 2010

Page 54: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Point Drawing

Draw [X0, Y0]

Thursday 4 February 2010

Page 55: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Point Drawing

Draw [X0, Y0]

Thursday 4 February 2010

Page 56: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Point Drawing

Draw [X0, Y0]

Thursday 4 February 2010

Page 57: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Point Drawing

Draw [X0, Y0] of a certain size

Thursday 4 February 2010

Page 58: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Point Drawing

Draw [X0, Y0] of a certain size

Thursday 4 February 2010

Page 59: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Point Drawing

Draw [X0, Y0] of a certain size

Thursday 4 February 2010

Page 60: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Point Drawing

Draw [X0, Y0] of a certain size

Thursday 4 February 2010

Page 61: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Point Drawing

Draw [X0, Y0] of a certain size

Thursday 4 February 2010

Page 62: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Point Drawing

Draw [X0, Y0] of a certain size

Thursday 4 February 2010

Page 63: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Line Drawing

Draw a lineStart at [X0, Y0]

End at [X1, Y1]

Thursday 4 February 2010

Page 64: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Line Drawing

Draw a lineStart at [X0, Y0]

End at [X1, Y1]

Thursday 4 February 2010

Page 65: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Line Drawing

Draw a lineStart at [X0, Y0]

End at [X1, Y1]

Thursday 4 February 2010

Page 66: Subodh Kumar IIT Delhi - ERNETsubodh/courses/CSL781/pdfslides/... · 2010. 2. 4. · Subodh Kumar Dept of Computer Sc. & Engg. IIT Delhi Thursday 4 February 2010. Pixel/Screen Coordinates

Line Drawing

Draw a lineStart at [X0, Y0]

End at [X1, Y1]

Thursday 4 February 2010