Graphics Reference
In-Depth Information
Procedure Clip (( move , draw ) flag)
begin
label moveit, nontriv, finish;
Calculate BC1, CODE1;
if flag = move then goto moveit;
if (CODE0 and CODE1) π 0 then goto finish;
if (CODE0 or CODE1) π 0 then goto nontriv;
ViewPt( p1 , draw );
finish:
[ p0 ,BC0,CODE0] := [ p1 ,BC1,CODE1];
return ;
moveit:
if CODE1 π 0 then goto finish;
ViewPt( p1 , move );
goto finish;
nontriv:
DoNontrivialStuff ();
goto finish;
end ;
Algorithm 4.6.2.
More efficient clipping using homogeneous coordinates.
Figure 4.12.
Single- and double-clip pyramid.
Search WWH ::




Custom Search