Clipping: In computer graphics our screen act as a 2-D coordinate system. it is not necessary that each and every point can be viewed on our viewing pane(i.e. our computer screen). We can view points, which lie in particular range (0,0) and (Xmax, Ymax). So, clipping is a procedure that identifies those portions of a picture that are either inside or outside of our viewing pane.
In case of point clipping, we only show/print points on our window which are in range of our viewing pane, others points which are outside the range are discarded.
Point Clipping Algorithm:
- Get the minimum and maximum coordinates of both viewing pane.
- Get the coordinates for a point.
- Check whether given input lies between minimum and maximum coordinate of viewing pane.
- If yes display the point which lies inside the region otherwise discard it.
Point inside the viewing pane: [10, 10] [100, 40] Point outside the viewing pane: [-10, 10] [400, 100] [100, 400] [400, 400] [400, 400]
This article is contributed by Shivam Pradhan (anuj_charm). If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Methods for Text Clipping in Computer Graphics
- Line Clipping | Set 1 (Cohen–Sutherland Algorithm)
- Polygon Clipping | Sutherland–Hodgman Algorithm
- Line Clipping | Set 2 (Cyrus Beck Algorithm)
- Cohen-Sutherland vs. Liang-Barsky line clipping algorithm
- DDA Line generation Algorithm in Computer Graphics
- Painter's Algorithm in Computer Graphics
- 2D Transformation in Computer Graphics | Set 1 (Scaling of Objects)
- Translation of objects in computer graphics
- Segments in Computer Graphics
- Computer Graphics | Cathode ray tube (video display device)
- Computer Graphics | Antialiasing
- Draw a moving car using computer graphics programming in C
- Computer Graphics | The RGB color model
- Refresh type output devices in Computer Graphics
- Applications of Computer Graphics
- Window to Viewport Transformation in Computer Graphics with Implementation
- Display Processor in Computer Graphics
- Introduction to Computer Graphics
- Difference between Parallel and Perspective Projection in Computer Graphics