home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
surfmodl
/
surfm203.arc
/
SURFSRC.ARC
/
HIDNLINE.INC
< prev
next >
Wrap
Text File
|
1987-01-05
|
2KB
|
75 lines
procedure HIDDENLINE;
{ Make a hidden lines drawing of the object }
var Node: integer; { node # }
Surf: integer; { surface # }
Cont: char;
{$ifndef BIGMEM}
Surfmin, Surfmax: surfaces;
{ surface minimum & maximum (Ztran) }
{$endif}
label ABORTTEXT, { text-mode abort }
ABORTGRPH; { graphics-mode abort }
begin
{$ifdef BIGMEM}
with ptra^ do with ptrb^ do with ptrc^ do
with ptrd^ do with ptre^ do with ptrf^ do
with ptri^ do with ptrk^ do
begin
{$endif}
if (Viewchanged) then begin
menumsg ('Transforming to 2-D...');
if (checkey) then goto ABORTTEXT;
{ Transform from 3-D to 2-D coordinates }
setorigin;
for Node := 1 to Nnodes do
perspect (Xworld[Node], Yworld[Node], Zworld[Node],
Xtran[Node], Ytran[Node], Ztran[Node]);
if (checkey) then goto ABORTTEXT;
{ Set plotting limits and normalize transformed coords to screen coords }
perspect (Xfocal, Yfocal, Zfocal, Xfotran, Yfotran, Zfotran);
if (not setnormal (Xfotran, Yfotran, XYmax)) then begin
menumsg ('Warning: Focal point outside data limits.');
writeln;
write (' Press any key ...');
while (not keypressed) do;
{ Erase the previous message }
menumsg ('');
writeln;
write (' ');
end;
{ Normalize all the nodes }
for Node := 1 to Nnodes do
normalize (Xtran[Node], Ytran[Node], Xfotran, Yfotran, XYmax);
menumsg ('Sorting surfaces...');
if (checkey) then goto ABORTTEXT;
minmax (Surfmin, Surfmax, Nsurf);
shelsurf (Surfmin, Surfmax, Nsurf);
Viewchanged := FALSE;
end; { if Viewchanged }
setgmode;
for Surf := 1 to Nsurf do begin
if (Nsides = 2) or (Visible (Surf, 1)) then begin
{ First fill the surface in with black }
fillsurf (Surf, 0, 0);
{ Now draw the border }
border (Surf, Color[Matl[Surf]]);
end;
if (grafstat) then goto ABORTGRPH;
end; { for Surf }
drawaxes (Xfotran, Yfotran, XYmax);
{ Wait for user keypress to continue }
continue;
ABORTGRPH:
exgraphic;
ABORTTEXT:
{$ifdef BIGMEM}
end; {with}
{$endif}
end; {procedure HIDDENLINE }