home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Underground
/
UNDERGROUND.ISO
/
graphic
/
3d_glass.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-07-28
|
3KB
|
82 lines
Uses Crt,ModeXLib,var_3d;
Const
worldlen=8*3; {Point-Array}
Worldconst:Array[0..worldlen-1] of Integer =
(-200,-200,-200,
-200,-200,200,
-200,200,-200,
-200,200,200,
200,-200,-200,
200,-200,200,
200,200,-200,
200,200,200);
surfclen=38; {Surface-Array}
surfcconst:Array[0..surfclen-1] of Word=
(01,4, 0,2,6,4,
02,4, 0,1,3,2,
04,4, 4,6,7,5,
08,4, 1,5,7,3,
16,4, 2,3,7,6,
32,4, 0,4,5,1,0,0);
Var
i,j:Word;
Procedure Glass_Pal;
{prepares the palette for glass solids}
Begin
FillChar(Palette[3],765,63); {first all colors white}
For i:=1 to 255 do Begin {define 255 mixed colors}
If i and 1 = 1 Then Dec(Palette[i*3],16);
If i and 2 = 2 Then Dec(Palette[i*3+1],16);
If i and 4 = 4 Then Dec(Palette[i*3+2],16);
If i and 8 = 8 Then Begin
Dec(Palette[i*3],16);
Dec(Palette[i*3+1],16);
End;
If i and 16 = 16 Then Begin
Dec(Palette[i*3],16);
Dec(Palette[i*3+2],16);
End;
If i and 32 = 32 Then Begin
Dec(Palette[i*3+1],16);
Dec(Palette[i*3+2],16);
End;
End;
SetPal;
End;
procedure drawworld;external; {draws the world on current video page}
{$l 3dasm.obj}
{$l poly.obj}
{$l bres.obj}
{$l root.obj}
Begin
vz:=1000; {solid is located at 1000 units depth}
vpage:=0; {start with page 0}
init_modex; {enable ModeX}
Glass_Pal;
rotx:=0; {initial values for rotation}
roty:=0;
rotz:=0;
Fill:=true; {SurfaceFill on}
sf_sort:=false; {SurfaceSort off}
sf_shift:=false; {SurfaceShift suppression off}
Glass:=true; {glass surfaces on}
repeat
clrx($0f); {clear screen}
DrawWorld; {draw world}
switch; {switch to finished picture}
WaitRetrace; {wait for next retrace}
Inc(rotx); {continue rotating ... }
If rotx=120 Then rotx:=0;
Inc(rotz);
If rotz=120 Then rotz:=0;
inc(roty);
if roty=120 Then roty:=0;
Until KeyPressed; { ... until key}
TextMode(3);
End.