home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
surfmodl
/
surfm203.arc
/
SURFSRC.ARC
/
WIREFRAM.INC
< prev
next >
Wrap
Text File
|
1988-01-30
|
2KB
|
56 lines
procedure WIREFRAME;
{ Make a wireframe drawing of the object }
var Node: integer; { node # }
Surf: integer; { surface # }
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
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]);
{ 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;
end;
if (checkey) then goto ABORTTEXT;
{ Normalize all the nodes }
for Node := 1 to Nnodes do
normalize (Xtran[Node], Ytran[Node], Xfotran, Yfotran, XYmax);
end; { if Viewchanged }
{ Draw the outline of each surface }
setgmode;
for Surf := 1 to Nsurf do begin
border (Surf, Color[Matl[Surf]]);
if (grafstat) then goto ABORTGRPH;
end;
drawaxes (Xfotran, Yfotran, XYmax);
{ Wait for user keypress to continue }
continue;
ABORTGRPH:
exgraphic;
ABORTTEXT:
{$ifdef BIGMEM}
end; {with}
{$endif}
end; {procedure WIREFRAME }