SlideShare a Scribd company logo
HIDDEN SURFACE REMOVAL
MADE BY
PUNYAJOY SAHA
What is a hidden surface?
 When we view a picture containing non-transparent objects and surfaces, then we cannot see
those surfaces from view which are behind from surfaces closer to eye.
Visible surfaceHidden surface
Why hidden surface removal is needed?
 If we don’t remove hidden surface, there may be some spurious surfaces in the 3d object.
 We must remove these hidden surfaces to get a realistic screen image.
3D object with false surfaces 3D object with true surfaces
False surface
Two types of approaches
 Object space approach
 Image space approach
OBJECT SPACE APPROACH
 Algorithm
for(each object in the world)
{
determine those parts of the object whose view is unobstructed
by other parts of it or any other object;
draw those parts in the appropriate colour
}
 Computational cost: O(n^2) (n is number of objects)
 Examples: . Roberts algorithm, Warnock’s algorithm
IMAGE SPACE APPROACH
 Algorithm
for(each pixel in the image)
{
determine the object closest to the viewer that is intercepted by
the projector through the pixel;
draw the pixel in the appropriate colour;
}
 Computational cost: O(np) (n:number of object p:number of pixels)
 Examples: . Z-buffer, Floating horizon algorithm
Image space approaches
 Floating horizon
 Z-buffer
 Ray tracing
Floating Horizon Algorithm
The technique is to convert 3D problem to equivalent 2D problem by intersecting 3D surface
with a series of parallel cutting planes at constant values of the coordinate in the view
direction. It could be x, y or z. The function F(x,y,z)=0 is reduced to a planar curve in each of
these parallel planes
y  f (x,z)
SELECTION OF PLANES
 F(x, y, za)=0
 F(x, y, zb)=0
 F(x, y, zc)=0
 and so on….
Y
Z
Za
Zc
Zb
Visibility of curves
 With z=constant plane closest to the viewpoint, the curve in each plane is
generated (for each x coordinate in image space the appropriate y value is
found).
X
Y
FRONT
BACK
Z1
Z2
Z3
Z4
Z5
Possible cases..
X
Y
FRONT
BACK
Z1
Z2
Z3
Z4
Z5
Case 1
Case 2
Z-Buffer Algorithm
 In this process depth of the z-axis is used to determine the closest (visible surface).
 The depth value of a pixel is compared and the closest surface determines the colour
 Depth buffer ( values between 0 to inf) for each pos (x,y).
 Frame buffer is used to store the intensity of the colour value.
Intensity f(x ,y)
Depth Z(x ,y)
INTENSITY DEPTH
Pseudo code
 Initialize all d[i,j]=inf (max depth), c[i,j]=background color.
for (each polygon)
{
for (each pixel in polygon’s projection)
{
Find depth-z of polygon at (x,y) corresponding to pixel (i,j);
If z < d[i,j]
{
d[i,j] = z;
p[i,j] = color;
}
}
}
X
Y
Z
Za
Zb
Zc
(x,y)
Example
Not parallel to XY
plane
parallel to XY
plane
α α α α α α α α
α α α α α α α α
α α α α α α α α
α α α α α α α α
α α α α α α α α
α α α α α α α α
α α α α α α α α
α α α α α α α α
BG BG BG BG BG BG BG BG
BG BG BG BG BG BG BG BG
BG BG BG BG BG BG BG BG
BG BG BG BG BG BG BG BG
BG BG BG BG BG BG BG BG
BG BG BG BG BG BG BG BG
BG BG BG BG BG BG BG BG
BG BG BG BG BG BG BG BG
DEPTH BUFFER
FRAME BUFFER
Initialisation
Parallel with
the image plane 
 
      
     
    
   
  
 

Checking the first surface….
Updating the frame buffer and depth
buffer
       
       
       
       
       
       
       
       
Depth buffer Frame buffer
Checking the second surface….




 
  
   
    
     
Updating the frame buffer and depth
buffer
       
       
       
       
       
       
       
       
Depth buffer Frame buffer
Ray Tracing
 Allows the observer to see a point on the surface as a result of interaction of the
rays emanating from other source.
•
•
•
View
point
•
•
Invisible Rays
cast from the
viewpoint
Regular grid,
corresponding
to pixels:
• The rays find
the closest object
intersected...
rays are stopped
at the first
intersection...
• A ray is fired
from the viewpoint
through each
pixel to which the
window maps
Pseudo code:
For each scan line in the image
For each pixel in a scan line
• Determine the ray from the viewpoint (or center of
projection) through the pixel;
• For each object in the scene
– If the object is intersected and is closest found so
far...then record the intersection and object's name;
• Set the pixel's color to the closest object intersection;
BACKWARD RAY TRACING
 Camera shoots rays
 Rays get reflected and intercepted by camera
 Closest intersection is visible
Finding the closest intersection point P
 RD=(xD,yD,zD)
 R0=(x0,y0,z0)
2 2 2
D
0 D
D D
t 0
x y z 1
R(t) R R t 
 



2 2 2 2
C C C R(x x ) (y y ) (z z ) S     
Given equations
 Ray equation
We consider the ray towards the scene not opposite to the
scene
We consider normalized direction of the ray i.e. perpendicular to
the viewer’s plane
 Sphere equation
Calculations
 Put the ray equation into sphere equation and solve t
 We get:
Find the value of closest t from R0
0 D
0 D
0 D
x x x t
y y y t
z z z t
 
 
 
2 2 2
D D D
D 0 C D 0 C D 0 C
2 2 2
0 C 0 C 0
2
C
A x y z
B (x (x x ) y (y y ) z (z z ))
C (x x ) (y
At Bt C
y ) ( )
0
z z
 
  
     
   

 
THANK YOU

More Related Content

What's hot

Segments in Graphics
Segments in GraphicsSegments in Graphics
Segments in Graphics
Rajani Thite
 
Clipping
ClippingClipping
Clipping
AMIT VIRAMGAMI
 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphics
KALESHWAR KUMAR
 
Raster animation
Raster animationRaster animation
Raster animation
abhijit754
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
SHIVANI SONI
 
Mid point circle algorithm
Mid point circle algorithmMid point circle algorithm
Mid point circle algorithm
Mani Kanth
 
COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"
Ankit Surti
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clippingMohd Arif
 
The sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmThe sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithm
Mani Kanth
 
3D Transformation
3D Transformation3D Transformation
3D Transformation
SwatiHans10
 
Computer animation
Computer animationComputer animation
Computer animation
shusrusha
 
Bresenham's line drawing algorithm
Bresenham's line drawing algorithmBresenham's line drawing algorithm
Bresenham's line drawing algorithm
nehrurevathy
 
3D Display
3D Display3D Display
3D Display
Toushik Paul
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphicanku2266
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displays
Somya Bagai
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
A B Shinde
 
Spline representations
Spline representationsSpline representations
Spline representations
Nikhil krishnan
 
3D Display Method
3D Display Method3D Display Method
3D Display Method
Khaled Sany
 
Hidden surface removal algorithm
Hidden surface removal algorithmHidden surface removal algorithm
Hidden surface removal algorithm
KKARUNKARTHIK
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
Laxman Puri
 

What's hot (20)

Segments in Graphics
Segments in GraphicsSegments in Graphics
Segments in Graphics
 
Clipping
ClippingClipping
Clipping
 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphics
 
Raster animation
Raster animationRaster animation
Raster animation
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
Mid point circle algorithm
Mid point circle algorithmMid point circle algorithm
Mid point circle algorithm
 
COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
The sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmThe sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithm
 
3D Transformation
3D Transformation3D Transformation
3D Transformation
 
Computer animation
Computer animationComputer animation
Computer animation
 
Bresenham's line drawing algorithm
Bresenham's line drawing algorithmBresenham's line drawing algorithm
Bresenham's line drawing algorithm
 
3D Display
3D Display3D Display
3D Display
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphic
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displays
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Spline representations
Spline representationsSpline representations
Spline representations
 
3D Display Method
3D Display Method3D Display Method
3D Display Method
 
Hidden surface removal algorithm
Hidden surface removal algorithmHidden surface removal algorithm
Hidden surface removal algorithm
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
 

Similar to Hidden surface removal

Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determinationPatel Punit
 
Lec03 light
Lec03 lightLec03 light
Lec03 light
BaliThorat1
 
Ray Tracing.pdf
Ray Tracing.pdfRay Tracing.pdf
Ray Tracing.pdf
Mattupallipardhu
 
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
fungfung Chen
 
Interactive Refractions And Caustics Using Image Space Techniques
Interactive Refractions And Caustics Using Image Space TechniquesInteractive Refractions And Caustics Using Image Space Techniques
Interactive Refractions And Caustics Using Image Space Techniques
codevania
 
Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Rep...
Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Rep...Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Rep...
Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Rep...
Vincent Sitzmann
 
Hidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferHidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-buffer
Raj Sikarwar
 
7-Surface Detection Methods.ppt
7-Surface Detection Methods.ppt7-Surface Detection Methods.ppt
7-Surface Detection Methods.ppt
MarkHark1
 
Visible Surface Detection
Visible Surface DetectionVisible Surface Detection
Visible Surface Detection
AmitBiswas99
 
unit 4.pptx
unit 4.pptxunit 4.pptx
unit 4.pptx
PrabinNeupane8
 
Understanding neural radiance fields
Understanding neural radiance fieldsUnderstanding neural radiance fields
Understanding neural radiance fields
Varun Bhaseen
 
Computer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and MotionComputer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and MotionDamian T. Gordon
 
Computer Graphics Part1
Computer Graphics Part1Computer Graphics Part1
Computer Graphics Part1
qpqpqp
 
Computer graphics iv unit
Computer graphics iv unitComputer graphics iv unit
Computer graphics iv unit
aravindangc
 
3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals
Muhammed Afsal Villan
 
Use of Specularities and Motion in the Extraction of Surface Shape
Use of Specularities and Motion in the Extraction of Surface ShapeUse of Specularities and Motion in the Extraction of Surface Shape
Use of Specularities and Motion in the Extraction of Surface Shape
Damian T. Gordon
 
Shadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareShadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL Hardware
Mark Kilgard
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
BHAGYAPRASADBUGGE
 

Similar to Hidden surface removal (20)

Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determination
 
Lec03 light
Lec03 lightLec03 light
Lec03 light
 
Ray Tracing.pdf
Ray Tracing.pdfRay Tracing.pdf
Ray Tracing.pdf
 
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
 
Interactive Refractions And Caustics Using Image Space Techniques
Interactive Refractions And Caustics Using Image Space TechniquesInteractive Refractions And Caustics Using Image Space Techniques
Interactive Refractions And Caustics Using Image Space Techniques
 
Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Rep...
Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Rep...Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Rep...
Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Rep...
 
Hidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferHidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-buffer
 
7-Surface Detection Methods.ppt
7-Surface Detection Methods.ppt7-Surface Detection Methods.ppt
7-Surface Detection Methods.ppt
 
Visible Surface Detection
Visible Surface DetectionVisible Surface Detection
Visible Surface Detection
 
unit 4.pptx
unit 4.pptxunit 4.pptx
unit 4.pptx
 
Understanding neural radiance fields
Understanding neural radiance fieldsUnderstanding neural radiance fields
Understanding neural radiance fields
 
visible surface detection
visible surface detectionvisible surface detection
visible surface detection
 
Computer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and MotionComputer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and Motion
 
Computer Graphics Part1
Computer Graphics Part1Computer Graphics Part1
Computer Graphics Part1
 
Computer graphics iv unit
Computer graphics iv unitComputer graphics iv unit
Computer graphics iv unit
 
3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals
 
Use of Specularities and Motion in the Extraction of Surface Shape
Use of Specularities and Motion in the Extraction of Surface ShapeUse of Specularities and Motion in the Extraction of Surface Shape
Use of Specularities and Motion in the Extraction of Surface Shape
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Shadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareShadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL Hardware
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 

Recently uploaded

Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 

Recently uploaded (20)

Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 

Hidden surface removal

  • 1. HIDDEN SURFACE REMOVAL MADE BY PUNYAJOY SAHA
  • 2. What is a hidden surface?  When we view a picture containing non-transparent objects and surfaces, then we cannot see those surfaces from view which are behind from surfaces closer to eye. Visible surfaceHidden surface
  • 3. Why hidden surface removal is needed?  If we don’t remove hidden surface, there may be some spurious surfaces in the 3d object.  We must remove these hidden surfaces to get a realistic screen image. 3D object with false surfaces 3D object with true surfaces False surface
  • 4. Two types of approaches  Object space approach  Image space approach
  • 5. OBJECT SPACE APPROACH  Algorithm for(each object in the world) { determine those parts of the object whose view is unobstructed by other parts of it or any other object; draw those parts in the appropriate colour }  Computational cost: O(n^2) (n is number of objects)  Examples: . Roberts algorithm, Warnock’s algorithm
  • 6. IMAGE SPACE APPROACH  Algorithm for(each pixel in the image) { determine the object closest to the viewer that is intercepted by the projector through the pixel; draw the pixel in the appropriate colour; }  Computational cost: O(np) (n:number of object p:number of pixels)  Examples: . Z-buffer, Floating horizon algorithm
  • 7. Image space approaches  Floating horizon  Z-buffer  Ray tracing
  • 8. Floating Horizon Algorithm The technique is to convert 3D problem to equivalent 2D problem by intersecting 3D surface with a series of parallel cutting planes at constant values of the coordinate in the view direction. It could be x, y or z. The function F(x,y,z)=0 is reduced to a planar curve in each of these parallel planes y  f (x,z)
  • 9. SELECTION OF PLANES  F(x, y, za)=0  F(x, y, zb)=0  F(x, y, zc)=0  and so on…. Y Z Za Zc Zb
  • 10. Visibility of curves  With z=constant plane closest to the viewpoint, the curve in each plane is generated (for each x coordinate in image space the appropriate y value is found). X Y FRONT BACK Z1 Z2 Z3 Z4 Z5
  • 12. Z-Buffer Algorithm  In this process depth of the z-axis is used to determine the closest (visible surface).  The depth value of a pixel is compared and the closest surface determines the colour  Depth buffer ( values between 0 to inf) for each pos (x,y).  Frame buffer is used to store the intensity of the colour value. Intensity f(x ,y) Depth Z(x ,y) INTENSITY DEPTH
  • 13. Pseudo code  Initialize all d[i,j]=inf (max depth), c[i,j]=background color. for (each polygon) { for (each pixel in polygon’s projection) { Find depth-z of polygon at (x,y) corresponding to pixel (i,j); If z < d[i,j] { d[i,j] = z; p[i,j] = color; } } }
  • 14. X Y Z Za Zb Zc (x,y) Example Not parallel to XY plane parallel to XY plane
  • 15. α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α α BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG BG DEPTH BUFFER FRAME BUFFER Initialisation
  • 16. Parallel with the image plane                                Checking the first surface….
  • 17. Updating the frame buffer and depth buffer                                                                 Depth buffer Frame buffer
  • 18. Checking the second surface….                        
  • 19. Updating the frame buffer and depth buffer                                                                 Depth buffer Frame buffer
  • 20. Ray Tracing  Allows the observer to see a point on the surface as a result of interaction of the rays emanating from other source. • • • View point • • Invisible Rays cast from the viewpoint Regular grid, corresponding to pixels: • The rays find the closest object intersected... rays are stopped at the first intersection... • A ray is fired from the viewpoint through each pixel to which the window maps
  • 21. Pseudo code: For each scan line in the image For each pixel in a scan line • Determine the ray from the viewpoint (or center of projection) through the pixel; • For each object in the scene – If the object is intersected and is closest found so far...then record the intersection and object's name; • Set the pixel's color to the closest object intersection;
  • 22. BACKWARD RAY TRACING  Camera shoots rays  Rays get reflected and intercepted by camera  Closest intersection is visible
  • 23. Finding the closest intersection point P  RD=(xD,yD,zD)  R0=(x0,y0,z0)
  • 24. 2 2 2 D 0 D D D t 0 x y z 1 R(t) R R t       2 2 2 2 C C C R(x x ) (y y ) (z z ) S      Given equations  Ray equation We consider the ray towards the scene not opposite to the scene We consider normalized direction of the ray i.e. perpendicular to the viewer’s plane  Sphere equation
  • 25. Calculations  Put the ray equation into sphere equation and solve t  We get: Find the value of closest t from R0 0 D 0 D 0 D x x x t y y y t z z z t       2 2 2 D D D D 0 C D 0 C D 0 C 2 2 2 0 C 0 C 0 2 C A x y z B (x (x x ) y (y y ) z (z z )) C (x x ) (y At Bt C y ) ( ) 0 z z                  