3D and 2D homogeneous space line clipping using cohen sudherland algorithm

line clipping using cohen sudherland algorithm
137 Downloads
Updated 26 Jun 2015

View License

In graphics pipeline, clipping is performed after multiplication of points with perspective matrix. This is known as clip space. The input to algorithm is endpoints of line in homogeneous co-ordinates (x, y, z, w) in clip space. The outputs is clipped line (modified endpoints of line) if line is clipped. If line is removed, is_removed is set to 1. There are three cases:
1. line is unmodified (when it is inside view frustrum) (is_clipped = 0, is_removed =0)
2. line is clipped by one or more planes of view frustrum (is_clipped = 1, is_removed = 0)
3. line is outside the view frustrum (is_removed = 1)

Cite As

Vipin Yadav (2024). 3D and 2D homogeneous space line clipping using cohen sudherland algorithm (https://www.mathworks.com/matlabcentral/fileexchange/51548-3d-and-2d-homogeneous-space-line-clipping-using-cohen-sudherland-algorithm), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Creating and Concatenating Matrices in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0