3D and 2D homogeneous space line clipping using liang barsky algorithm

line clipping using parallelizable implementation of liang barsky
160 download
Aggiornato 26 giu 2015

Visualizza la licenza

n 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)
Algorithms used: Liang Barsky
clip_linesegment_LB_3D_Parallel.m (for clipping with all 6 planes of view frustrum)
clip_linesegment_LB_2D_Parallel.m (for clipping with 4 planes of frustrum- excluding near and far plane)
Above two implementations attempt to implement algorithm so that it is fast on DSP processor (parallel implementation avoiding if else statements). The functions is optimized to remove branch/jump occurance and enable parallel computations.

Cita come

Vipin Yadav (2025). 3D and 2D homogeneous space line clipping using liang barsky algorithm (https://it.mathworks.com/matlabcentral/fileexchange/51550-3d-and-2d-homogeneous-space-line-clipping-using-liang-barsky-algorithm), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2012b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Systems of Nonlinear Equations in Help Center e MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0