3 views

Uploaded by Praveen Chintapalle

- Multimedia & CG
- IIT JEE 2010 Solution Paper 2 English
- webgl_tutorial.pdf
- Photoshop Short Cuts
- String Art
- IFEM.Ch18
- Shape function magic
- Greek Geometry From Thales to Euclid
- Hatch Slack Pathway
- Coordinate Geometry
- Triangle of Solomon
- 54774839-NX7-Manual_Part1
- student-graphics-info 1
- Maya Presentation
- 14621_K3R25 CSE405
- New Microsoft Word Document (2)
- 1st-trial 11-12
- Trans Troy e Mar
- Lab Index
- Ug Math 2018

You are on page 1of 13

c b

Simple Algorithms

We start from a triangle 1 1 2 2, and 3 3 Find all pixels inside Method 1 the worst algorithm For each pixel do If 2 then draw-pixel p end if End for Method 2 a slight improvement

T x ;y ; x ;y x ;y T p p T B

For each pixel 2 do If 2 then draw-pixel p end if End for The given previous algorithms suggest an important sub-problem: Given a triangle , and = How to determine: 2

p B p T T p px ; py p T

bounding

box T

Ray Firing

Here's a simple approach to test if 2 1 draw a ray from outward in any direction 2 count number of intersections of this ray with boundaries of 3 If odd, then 2 , otherwise, is not in Is this method correct? What happens if the ray crosses at a vertex?

p T p T p T p T

A slightly easier method Consider the edge 1 2 Write down the implicit function of this line

v v l ;

1 2

x; y

=

a ; x

12

+b

12

;

+c

12

;

l ; l ; x ;y h ; h ;

1 2 = f

x; y

:

l ;

1 2

x; y

=0

Apply the similar process shown above to 1 3 and 2 3 Construct half-planes 1 3 and 2 3 The important observation

l ; l ; h ; h ;

h ;

12

h ;

13

h ;

h ;

23

p T p h ; p h ; p l ; l ; l ;

1 2 1 3 2 3

px ; py

=0 =0 =0

px ; py

px ; py

Sweep-line Algorithm

p T

Observation If 2 , then neighboring pixels are probably in the triangle, too Coherence Idea 1 sweep from top to bottom 2 maintain intersections of and sweep-line span" 3 paint pixels in the span Algorithm Initialize and For each scan line covered by do Paint pixels on the current span Incrementally update and End for Question: how do we update and ? Answer: midpoint algorithm !

T xl xr T xl ; y ; : : : ; : : : ; xr ; y xl xr xl xr

Given a simple polygon with vertices 1 1 2 2 Find all pixels inside Polygon classi cation simple convex simple concave non-simple self-intersection Once again, we could compute a bounding box and use ray casting = , For each pixel 2 do If 2 then paint end if End for But this would NOT take advantage of coherence Coherence Adjacent pixels in image space are likely sharing the similar graphic properties such as color

P x ;y ; x ;y ;:::; xn ; yn P B bounding box P p B p P p

Scan Conversion

More e cient algorithm For each scanline Identify all intersections 0 1 ,1 Sort intersections from left to right Fill pixels between consecutive pairs of intersection

x ; x ; : : : ; xk

x

i; y

; x

2 +1

i

;y

We must deal with special cases" ! horizontal lines intersecting a vertex double intersection unwanted intersection We must speed up the edge intersection detection Data structure for e cient implementation A sorted edge table The active edge list From bottom to the top

Figure 3.39 Practical polygon scan conversion Many implementations just triangulate the polygon and then convert the triangles Extremely easy to do for convex polygons Triangles are often particularly nice to work with because they are always planar and simple

Special Cases

- Multimedia & CGUploaded bySharu Khem
- IIT JEE 2010 Solution Paper 2 EnglishUploaded byResonance Kota
- webgl_tutorial.pdfUploaded byDvlanker Endesor
- Photoshop Short CutsUploaded byArijit Sinha
- String ArtUploaded byminathl
- IFEM.Ch18Uploaded byfapperForReal
- Shape function magicUploaded byeunsu_kim
- Greek Geometry From Thales to EuclidUploaded bytenebris_obortis
- Hatch Slack PathwayUploaded byallanlopez_2009
- Coordinate GeometryUploaded byVeera Venkata Sairam Chakravartula
- Triangle of SolomonUploaded byMukul Kataria
- 54774839-NX7-Manual_Part1Uploaded bySai Ch
- student-graphics-info 1Uploaded byapi-333231034
- Maya PresentationUploaded byScott Turner
- 14621_K3R25 CSE405Uploaded byGaurav Tomar
- New Microsoft Word Document (2)Uploaded bychanti92
- 1st-trial 11-12Uploaded byapi-253679034
- Trans Troy e MarUploaded bySyed Rafat
- Lab IndexUploaded byChetna Sachdeva
- Ug Math 2018Uploaded byPiyush Dubey
- understanding the problem peer reviewUploaded byapi-386984397
- Analyzing and Enhancing ImagesUploaded byJulyannoor Agung Prakasa
- Assignment GUploaded byHarshit Sharma
- Midterm Study GuideUploaded bymishi19
- 7Uploaded byFustei Bogdan
- Bmo 2012 SolutionUploaded byjfmarques
- Math SummryUploaded byMansoor Sultan
- mathlpUploaded byapi-316342645
- Final Problems EngUploaded bymathlinks1990
- The Basics Of Photoshop.pptxUploaded bythomas

- RP macros.xlsxUploaded byCherish Boxall
- 0580_s17_ms_43Uploaded byyuke kristina
- Product Catalogue EnUploaded byIrene Lara Abad
- CV CHANDRA (ENGLISH).pdfUploaded byhalloif
- The Lords of Avaris David RohlUploaded byLeandro Prata
- U2100_L2100.xlsxUploaded byAhmad Yusrifar Junaid
- RelNotes-524_MSM3x4x_MAP3x6xUploaded byArmando
- Stock market prediction using Neural Networks and sentiment analysis of News Articles.Uploaded byIJAR Journal
- Considerations of Rope Rescue 2009Uploaded byKevin J. Stoll
- Police Log January 21, 2016Uploaded byMansfieldMAPolice
- DbreedUploaded byDaniel Dbreed Ayuba
- 723 Conduct TrainingUploaded byWanda
- Reles Eletromecanicos Formulas de CurvasUploaded byLUCELINO DA COSTA LARANJEIRA
- Chapter 8Uploaded byRobbie
- micro teach lesson planUploaded byapi-333221520
- GSM Mobility Mangement Using an Intelligent Network PlatformUploaded byAdifby
- thirddraftplasticUploaded byapi-253605738
- Numericke Metode u Inzenjerstvu Predavanja 1 (1)Uploaded byDzenan Hasanbasic
- Crystalpure Sonaki - Vitamin ShowerUploaded byjgrnet
- hw3_sol.pdfUploaded bySmitha Vas
- Hydro Test FormUploaded byAnonymous 6S9tcbh
- 1Uploaded byaparajita8
- Communal Violence in Kozhikode VillageUploaded byNidhish K Sundar
- Depreciation Rates IndiaUploaded byHarsh Doshi
- T101 Drilling Machine BrochureUploaded byRicardo Ortega
- Role of ICT in Poverty AlleviationUploaded byConnorLokman
- Final Exam Study Guide - MarketingUploaded byNicole McCoy Wilson
- BE & CSR Slides 3Uploaded bySarkar Raj
- Wikileak | Sudan | PLOTTING FOR BASHIR EXIT INTENSIFIESUploaded byMintPress News
- Rituals and Stages of Performing UmrahUploaded byCheapUmrahPackage