SlideShare a Scribd company logo
1 of 22
SUBMITTED BY:
JYOTIRAMAN DE
M TECH (CAD/CAM)
Problem:
Given a scene and a projection,
what can we see?
Two main types of algorithms:
Object space: Determine which part of the object are
visible. Also called as World Coordinates
Image space: Determine per pixel which point of an
object is visible. Also called as Screen Coordinates
Object space Image space
Two main Hidden Surface Removal Algorithm
Techniques:
Object space: Hidden Surface Removal for all
objects
Image space:
Objects: 3 D Clipping
Transformed to Screen Coordinates
Hidden Surface Removal
ALGORITHMS WE ARE GOING TO DISCUSS:
• Z-buffer method
• Scan-line method
• Spanning scan-line method
• Floating horizon method
• Discrete data method
Z-BUFFER ALGORITHM:
• Its an extension of Frame Buffer
• Display is always stored on Frame Buffer
• Frame Buffer stores information of each and every
pixel on the screen
• Bits (0, 1) decide that the pixel will be ON or OFF
• Z- Buffer apart from Frame buffer stores the depth
of pixel
• After analyzing the data of the overlapping
polygons, pixel closer to the eye will be updated
• Resolution of X,Y => Array[X,Y]
Given set of polygon in image space
Z-Buffer Algorithm:
1. Set the frame buffer & Z-Buffer to a background
value
(Z-BUFFER=Zmin) where, Zmin is value
To display polygon decide=>color, intensity and depth
2. Scan convert each polygon
i.e, for each pixel, find depth at that point
If Z(X,Y)>Z-BUFFER(X,Y)
Update Z-BUFFER(X,Y)=Z(X,Y)
& FRAME BUFFER
This process will repeat for each pixel
• By this way we can remove hidden lines and display
those polygons which are closer to eye
• X*Y space required to maintain Z-Buffer=> X*Y times
will be scanned
• Expensive in terms of time and space as space is very
large
x
z display
S
S’
x
y S
S’
Pseudocode for the z-buffer algorithm
void zBuffer(void)
{
int x,y;
for(y=0;y<YMAX;y++) { /*Clear frame buffer and z-buffer*/
for(x=0;x<XMAX;x++) {
WritePixel(x,y,BACKGROUND_VALUE);
WriteZ(x,y,0);
}
}
for(each polygon) { /*Draw Polygons*/
for(each pixel in polygons projection) {
double pz=polygons z-value at pixel coords(x,y);
if(pz>=ReadZ(x,y)) { /*New point is not farther*/
WriteZ(x,y,pz);
WritePixel(x,y,polygons color at pixel coords(x,y));
}
}
}
}
SCAN LINE Z-BUFFER ALGORITHM:
• An image space method for identifying visible
surfaces
• Computes and compares depth values along the
various scan-lines for a scene
• Scanning takes place row by row
• To facilitate the search for surfaces crossing a given
scan-line an active list of edges is formed for each
scan-line as it is processed
• The active list stores only those edges that cross the
scan-line in order of increasing x
• Pixel positions across each scan-line are processed
from left to right
• We only need to perform depth calculations
• In Scan Line, Z-Buffer(X) whereas earlier it was X*Y
Use Z-Buffer for only 1 scan line / 1 row of pixel
• During scan conversion in the Active Edge List(AEL)=>
Calculate Z(X,Y)
i.e, -Pixel info between 1 & 2 active edges will only
be stored
-Next pixel will be stored as z=z1+∆z
-∆z will be constant but can change anywhere in
case of slope
• If Z(X,Y)>Z BUFFER(X) => Update
• If 2 polygons are present-along with Active Edge List,
Active Polygon List will also be included
• Active Polygon List=> List of polygons intersecting a
scan line
Pseudocode for the general scan line algorithm
Add surfaces to surface table;
Initialize active-surface table;
for(each scan line)
{
update active-surface table;
for(each pixel on scan line)
{
determine surfaces in active-surface table that project to pixel;
find closest such surface;
determine closest surface’s shade at pixel;
}
}
SPANNING SCAN LINE Z-BUFFER ALGORITHM:
• Z-Buffer is not applicable
• Scan conversion is not done
• Speed increases
1 2 3 4 5 6
Each span at
most one
polygon shall be
displayed
• For each polygon determine the highest scan line
intersected by it
• Place the polygon in the Y-Bucket of that scan line
[YB]
• For each scan line
-Examine YB for any new polygon
-Add new polygon to APL
-Update AEL
-Divide into spans
-In each span decide which polygon shall be displayed
-Increment Y, update AEL & APL
FLOATING HORIZON ALGORITHM:
• Used for displaying surface
• Take each plane & intersection
z=constant plane and get a curve
from F(x,y)=0 f(x,y,z)=0
Array HORIZONTAL[X]=Ymax
Curve in each plane=>f(x,y)=0
y=f(x,y)
z=constant curves
Family of curves
1. Sort all curves as per z-coordinates
2. Start by z=constant curve closest to eye
- If at any x-value Y=f(x,y)
Y<HORIZON(X)-curve is hidden
- If Y>HORIZON(X)-curve is visible &
update HORIZON(X)=Y
- If Y<HORIZON-L(X) : curve is visible &
update HORIZON L(X)=Y
- If Y>HORIZON-U(X) : HORIZON U(X)=Y
• Above Algorithm are applied on surfaces which is in
the form of mathematical equation
• If this curve is not a mathematical equation like this
but it is a set of discrete data points then this
algorithm might not be directly useful
• Maintain HORIZON[X] at each side
• While displaying next curve, it will be compared to 2
points i.e, Y(Xi) & Y(Xi+1)
• If both points are visible, then the complete curve is
visible
• Algorithm will be complex as the curve is in discrete
data form
Y(Xi) Y(Xi+1) Result
V V Curve is visible
V I Xi to Intersection -> Visible
Intersection to Xi+1 -> NOT Visible
I V Xi to Intersection -> NOT Visible
Intersection to Xi+1 -> Visible
I I NOT Visible
SUMMARY
• We need to make sure that we only draw
visible surfaces when rendering scenes
• There are a number of techniques for doing
this such as
– Z-buffer method
– Scan-line method
– Spanning scan-line method
– Floating horizon method
– Discrete data method
REFERENCES
• NPTEL Video Lectures: CAD by Dr. Anoop Chawla, Dept. of
Mechanical Engineering, Indian Institute of Technology, Delhi,
Lecture No. # 12,13,14
• Ibrahim Zeid, “CAD/CAM” TMH
• Hoschek J, Dieter L, “Fundamentals of Computer Aided
Geometric Design ”, A K Peters, 1997
• Rogers D F I and Adams J A, “Mathematical Elements for
Computer Graphics”, McGraw-Hill, 1996
• J.H. Hughes, J.D.F., A.V.M., S.K.F., “Computer Graphics
Principles And Practice”, Pearson Education Asia,2001
Computer Graphics - Hidden Line Removal Algorithm

More Related Content

What's hot

Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clippingMani Kanth
 
Hermit curves &amp; beizer curves
Hermit curves &amp; beizer curvesHermit curves &amp; beizer curves
Hermit curves &amp; beizer curvesKKARUNKARTHIK
 
Back face detection
Back face detectionBack face detection
Back face detectionPooja Dixit
 
Mid point circle algorithm
Mid point circle algorithmMid point circle algorithm
Mid point circle algorithmMani Kanth
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer GraphicsLaxman Puri
 
Scan line method
Scan line methodScan line method
Scan line methodPooja Dixit
 
B. SC CSIT Computer Graphics Unit 3 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit 3 By Tekendra Nath YogiB. SC CSIT Computer Graphics Unit 3 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit 3 By Tekendra Nath YogiTekendra Nath Yogi
 
Hidden line removal algorithm
Hidden line removal algorithmHidden line removal algorithm
Hidden line removal algorithmKKARUNKARTHIK
 
Hidden lines & surfaces
Hidden lines & surfacesHidden lines & surfaces
Hidden lines & surfacesAnkur Kumar
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clippingMohd Arif
 
Surface representation
Surface representationSurface representation
Surface representationSunith Guraddi
 
3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics FundamentalsMuhammed Afsal Villan
 
The sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmThe sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmMani Kanth
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformationsMohd Arif
 

What's hot (20)

Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clipping
 
Hermit curves &amp; beizer curves
Hermit curves &amp; beizer curvesHermit curves &amp; beizer curves
Hermit curves &amp; beizer curves
 
Back face detection
Back face detectionBack face detection
Back face detection
 
Mid point circle algorithm
Mid point circle algorithmMid point circle algorithm
Mid point circle algorithm
 
Depth Buffer Method
Depth Buffer MethodDepth Buffer Method
Depth Buffer Method
 
GRPHICS06 - Shading
GRPHICS06 - ShadingGRPHICS06 - Shading
GRPHICS06 - Shading
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
 
Scan line method
Scan line methodScan line method
Scan line method
 
B. SC CSIT Computer Graphics Unit 3 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit 3 By Tekendra Nath YogiB. SC CSIT Computer Graphics Unit 3 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit 3 By Tekendra Nath Yogi
 
Hidden line removal algorithm
Hidden line removal algorithmHidden line removal algorithm
Hidden line removal algorithm
 
Spline representations
Spline representationsSpline representations
Spline representations
 
Hidden lines & surfaces
Hidden lines & surfacesHidden lines & surfaces
Hidden lines & surfaces
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
Surface representation
Surface representationSurface representation
Surface representation
 
Curves and surfaces
Curves and surfacesCurves and surfaces
Curves and surfaces
 
3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals
 
visible surface detection
visible surface detectionvisible surface detection
visible surface detection
 
Clipping
ClippingClipping
Clipping
 
The sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmThe sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithm
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
 

Viewers also liked

Bezier and Spline Curves and Surfaces
Bezier and Spline Curves and SurfacesBezier and Spline Curves and Surfaces
Bezier and Spline Curves and SurfacesSyed Zaid Irshad
 
Geometric modelling
Geometric modellingGeometric modelling
Geometric modellingAakash S
 
191483523 geometric-modeling
191483523 geometric-modeling191483523 geometric-modeling
191483523 geometric-modelingmanojg1990
 
5 geometric-modeling-ppt-university-of-victoria
5 geometric-modeling-ppt-university-of-victoria5 geometric-modeling-ppt-university-of-victoria
5 geometric-modeling-ppt-university-of-victoriaRaghu Gadde
 
Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)manojg1990
 
Geometric Modeling
Geometric Modeling Geometric Modeling
Geometric Modeling illpa
 
Hidden surfaces
Hidden surfacesHidden surfaces
Hidden surfacesMohd Arif
 

Viewers also liked (10)

Bezier and Spline Curves and Surfaces
Bezier and Spline Curves and SurfacesBezier and Spline Curves and Surfaces
Bezier and Spline Curves and Surfaces
 
3 d viewing
3 d viewing3 d viewing
3 d viewing
 
Geometric modelling
Geometric modellingGeometric modelling
Geometric modelling
 
191483523 geometric-modeling
191483523 geometric-modeling191483523 geometric-modeling
191483523 geometric-modeling
 
Parametric modelling
Parametric modellingParametric modelling
Parametric modelling
 
5 geometric-modeling-ppt-university-of-victoria
5 geometric-modeling-ppt-university-of-victoria5 geometric-modeling-ppt-university-of-victoria
5 geometric-modeling-ppt-university-of-victoria
 
Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)
 
Geometric Modeling
Geometric Modeling Geometric Modeling
Geometric Modeling
 
Hidden surfaces
Hidden surfacesHidden surfaces
Hidden surfaces
 
Shading
ShadingShading
Shading
 

Similar to Computer Graphics - Hidden Line Removal Algorithm

CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9fungfung Chen
 
Clipping & Rasterization
Clipping & RasterizationClipping & Rasterization
Clipping & RasterizationAhmed Daoud
 
Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determinationPatel Punit
 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removalAnkit Garg
 
Line drawing Algorithm DDA in computer Graphics.pdf
Line drawing Algorithm DDA in computer Graphics.pdfLine drawing Algorithm DDA in computer Graphics.pdf
Line drawing Algorithm DDA in computer Graphics.pdfRAJARATNAS
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1aravindangc
 
Open GL T0074 56 sm3
Open GL T0074 56 sm3Open GL T0074 56 sm3
Open GL T0074 56 sm3Roziq Bahtiar
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentationasodariyabhavesh
 
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- ButkarComputer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- ButkarVishal Butkar
 
Hidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferHidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferRaj Sikarwar
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterizationMaaz Rizwan
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterizationMaaz Rizwan
 
Computer graphics iv unit
Computer graphics iv unitComputer graphics iv unit
Computer graphics iv unitaravindangc
 
rural marketing ppt
rural marketing pptrural marketing ppt
rural marketing pptelaya1984
 
Visual surface detection i
Visual surface detection   iVisual surface detection   i
Visual surface detection ielaya1984
 

Similar to Computer Graphics - Hidden Line Removal Algorithm (20)

CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9
 
Clipping & Rasterization
Clipping & RasterizationClipping & Rasterization
Clipping & Rasterization
 
Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determination
 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removal
 
UNIT-III
UNIT-IIIUNIT-III
UNIT-III
 
Line drawing Algorithm DDA in computer Graphics.pdf
Line drawing Algorithm DDA in computer Graphics.pdfLine drawing Algorithm DDA in computer Graphics.pdf
Line drawing Algorithm DDA in computer Graphics.pdf
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
 
Clipping
ClippingClipping
Clipping
 
Open GL T0074 56 sm3
Open GL T0074 56 sm3Open GL T0074 56 sm3
Open GL T0074 56 sm3
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
unit 4.pptx
unit 4.pptxunit 4.pptx
unit 4.pptx
 
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- ButkarComputer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar
 
Mvs adas
Mvs adasMvs adas
Mvs adas
 
Hidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferHidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-buffer
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
 
Computer graphics iv unit
Computer graphics iv unitComputer graphics iv unit
Computer graphics iv unit
 
rural marketing ppt
rural marketing pptrural marketing ppt
rural marketing ppt
 
Visual surface detection i
Visual surface detection   iVisual surface detection   i
Visual surface detection i
 

Recently uploaded

Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Computer Graphics - Hidden Line Removal Algorithm

  • 2. Problem: Given a scene and a projection, what can we see?
  • 3. Two main types of algorithms: Object space: Determine which part of the object are visible. Also called as World Coordinates Image space: Determine per pixel which point of an object is visible. Also called as Screen Coordinates Object space Image space
  • 4. Two main Hidden Surface Removal Algorithm Techniques: Object space: Hidden Surface Removal for all objects Image space: Objects: 3 D Clipping Transformed to Screen Coordinates Hidden Surface Removal
  • 5. ALGORITHMS WE ARE GOING TO DISCUSS: • Z-buffer method • Scan-line method • Spanning scan-line method • Floating horizon method • Discrete data method
  • 6. Z-BUFFER ALGORITHM: • Its an extension of Frame Buffer • Display is always stored on Frame Buffer • Frame Buffer stores information of each and every pixel on the screen • Bits (0, 1) decide that the pixel will be ON or OFF • Z- Buffer apart from Frame buffer stores the depth of pixel • After analyzing the data of the overlapping polygons, pixel closer to the eye will be updated • Resolution of X,Y => Array[X,Y]
  • 7. Given set of polygon in image space Z-Buffer Algorithm: 1. Set the frame buffer & Z-Buffer to a background value (Z-BUFFER=Zmin) where, Zmin is value To display polygon decide=>color, intensity and depth 2. Scan convert each polygon i.e, for each pixel, find depth at that point If Z(X,Y)>Z-BUFFER(X,Y) Update Z-BUFFER(X,Y)=Z(X,Y) & FRAME BUFFER This process will repeat for each pixel
  • 8. • By this way we can remove hidden lines and display those polygons which are closer to eye • X*Y space required to maintain Z-Buffer=> X*Y times will be scanned • Expensive in terms of time and space as space is very large x z display S S’ x y S S’
  • 9. Pseudocode for the z-buffer algorithm void zBuffer(void) { int x,y; for(y=0;y<YMAX;y++) { /*Clear frame buffer and z-buffer*/ for(x=0;x<XMAX;x++) { WritePixel(x,y,BACKGROUND_VALUE); WriteZ(x,y,0); } } for(each polygon) { /*Draw Polygons*/ for(each pixel in polygons projection) { double pz=polygons z-value at pixel coords(x,y); if(pz>=ReadZ(x,y)) { /*New point is not farther*/ WriteZ(x,y,pz); WritePixel(x,y,polygons color at pixel coords(x,y)); } } } }
  • 10. SCAN LINE Z-BUFFER ALGORITHM: • An image space method for identifying visible surfaces • Computes and compares depth values along the various scan-lines for a scene
  • 11. • Scanning takes place row by row • To facilitate the search for surfaces crossing a given scan-line an active list of edges is formed for each scan-line as it is processed • The active list stores only those edges that cross the scan-line in order of increasing x • Pixel positions across each scan-line are processed from left to right • We only need to perform depth calculations • In Scan Line, Z-Buffer(X) whereas earlier it was X*Y
  • 12. Use Z-Buffer for only 1 scan line / 1 row of pixel • During scan conversion in the Active Edge List(AEL)=> Calculate Z(X,Y) i.e, -Pixel info between 1 & 2 active edges will only be stored -Next pixel will be stored as z=z1+∆z -∆z will be constant but can change anywhere in case of slope • If Z(X,Y)>Z BUFFER(X) => Update • If 2 polygons are present-along with Active Edge List, Active Polygon List will also be included • Active Polygon List=> List of polygons intersecting a scan line
  • 13. Pseudocode for the general scan line algorithm Add surfaces to surface table; Initialize active-surface table; for(each scan line) { update active-surface table; for(each pixel on scan line) { determine surfaces in active-surface table that project to pixel; find closest such surface; determine closest surface’s shade at pixel; } }
  • 14. SPANNING SCAN LINE Z-BUFFER ALGORITHM: • Z-Buffer is not applicable • Scan conversion is not done • Speed increases
  • 15. 1 2 3 4 5 6 Each span at most one polygon shall be displayed • For each polygon determine the highest scan line intersected by it • Place the polygon in the Y-Bucket of that scan line [YB] • For each scan line -Examine YB for any new polygon -Add new polygon to APL -Update AEL -Divide into spans -In each span decide which polygon shall be displayed -Increment Y, update AEL & APL
  • 16. FLOATING HORIZON ALGORITHM: • Used for displaying surface • Take each plane & intersection z=constant plane and get a curve from F(x,y)=0 f(x,y,z)=0 Array HORIZONTAL[X]=Ymax Curve in each plane=>f(x,y)=0 y=f(x,y) z=constant curves Family of curves
  • 17. 1. Sort all curves as per z-coordinates 2. Start by z=constant curve closest to eye - If at any x-value Y=f(x,y) Y<HORIZON(X)-curve is hidden - If Y>HORIZON(X)-curve is visible & update HORIZON(X)=Y - If Y<HORIZON-L(X) : curve is visible & update HORIZON L(X)=Y - If Y>HORIZON-U(X) : HORIZON U(X)=Y
  • 18. • Above Algorithm are applied on surfaces which is in the form of mathematical equation • If this curve is not a mathematical equation like this but it is a set of discrete data points then this algorithm might not be directly useful
  • 19. • Maintain HORIZON[X] at each side • While displaying next curve, it will be compared to 2 points i.e, Y(Xi) & Y(Xi+1) • If both points are visible, then the complete curve is visible • Algorithm will be complex as the curve is in discrete data form Y(Xi) Y(Xi+1) Result V V Curve is visible V I Xi to Intersection -> Visible Intersection to Xi+1 -> NOT Visible I V Xi to Intersection -> NOT Visible Intersection to Xi+1 -> Visible I I NOT Visible
  • 20. SUMMARY • We need to make sure that we only draw visible surfaces when rendering scenes • There are a number of techniques for doing this such as – Z-buffer method – Scan-line method – Spanning scan-line method – Floating horizon method – Discrete data method
  • 21. REFERENCES • NPTEL Video Lectures: CAD by Dr. Anoop Chawla, Dept. of Mechanical Engineering, Indian Institute of Technology, Delhi, Lecture No. # 12,13,14 • Ibrahim Zeid, “CAD/CAM” TMH • Hoschek J, Dieter L, “Fundamentals of Computer Aided Geometric Design ”, A K Peters, 1997 • Rogers D F I and Adams J A, “Mathematical Elements for Computer Graphics”, McGraw-Hill, 1996 • J.H. Hughes, J.D.F., A.V.M., S.K.F., “Computer Graphics Principles And Practice”, Pearson Education Asia,2001