home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trixter's Scene Collection
/
trixter.zip
/
trixter
/
Demos
/
FAST3D.ZIP
/
makeobj.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-06-27
|
8KB
|
410 lines
type Point3D=record
X:single;
Y:single;
Z:single;
end;
type TPoly=record
NumVert:byte;
Red:byte;
Green:byte;
Blue:byte;
Vert:array[1..10] of Point3D;
end;
var f:file;
NumPoly:word;
res:integer;
cont:integer;
a:TPoly;
LR,SR,VLR,VSR,HSR:single;
flag:boolean;
begin
assign(f,'DATA.MDL');
rewrite(f,1);
NumPoly:=120;
blockwrite(f,NumPoly,2,res);
NumPoly:=NumPoly div 12;
LR:=80;
SR:=35;
VLR:=85;
VSR:=17;
HSR:=5;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=3;
a.Blue:=50;
a.Green:=0;
a.Red:=0;
with a.Vert[3] do
begin
x:=LR*Sin((cont+1)*Pi/(NumPoly/2));
y:=5;
z:=LR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=LR*Sin((cont)*Pi/(NumPoly/2));
y:=5;
z:=LR*Cos((cont)*Pi/(NumPoly/2));
end;
with a.Vert[1] do
begin
x:=SR*Sin((cont+0.5)*Pi/(NumPoly/2));
y:=-4;
z:=SR*Cos((cont+0.5)*Pi/(NumPoly/2));
end;
blockwrite(f,a,4+a.NumVert*12,res);
end;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=3;
a.Blue:=65;
a.Green:=0;
a.Red:=0;
with a.Vert[3] do
begin
x:=SR*Sin((cont-0.5)*Pi/(NumPoly/2));
y:=-4;
z:=SR*Cos((cont-0.5)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=SR*Sin((cont+0.5)*Pi/(NumPoly/2));
y:=-4;
z:=SR*Cos((cont+0.5)*Pi/(NumPoly/2));
end;
with a.Vert[1] do
begin
x:=LR*Sin((cont)*Pi/(NumPoly/2));
y:=5;
z:=LR*Cos((cont)*Pi/(NumPoly/2));
end;
blockwrite(f,a,4+a.NumVert*12,res);
end;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=4;
a.Blue:=50;
a.Green:=50;
a.Red:=50;
with a.Vert[4] do
begin
x:=LR*Sin((cont+1)*Pi/(NumPoly/2));
y:=5;
z:=LR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[3] do
begin
x:=VLR*Sin((cont+1)*Pi/(NumPoly/2));
y:=10;
z:=VLR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=VLR*Sin((cont)*Pi/(NumPoly/2));
y:=10;
z:=VLR*Cos((cont)*Pi/(NumPoly/2));
end;
with a.Vert[1] do
begin
x:=LR*Sin((cont)*Pi/(NumPoly/2));
y:=5;
z:=LR*Cos((cont)*Pi/(NumPoly/2));
end;
blockwrite(f,a,4+a.NumVert*12,res);
end;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=4;
a.Blue:=0;
a.Green:=0;
a.Red:=50;
with a.Vert[4] do
begin
x:=VLR*Sin((cont+1)*Pi/(NumPoly/2));
y:=10;
z:=VLR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[3] do
begin
x:=VLR*Sin((cont+1)*Pi/(NumPoly/2));
y:=15;
z:=VLR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=VLR*Sin((cont)*Pi/(NumPoly/2));
y:=15;
z:=VLR*Cos((cont)*Pi/(NumPoly/2));
end;
with a.Vert[1] do
begin
x:=VLR*Sin((cont)*Pi/(NumPoly/2));
y:=10;
z:=VLR*Cos((cont)*Pi/(NumPoly/2));
end;
blockwrite(f,a,4+a.NumVert*12,res);
end;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=4;
a.Blue:=50;
a.Green:=50;
a.Red:=50;
with a.Vert[4] do
begin
x:=VLR*Sin((cont+1)*Pi/(NumPoly/2));
y:=15;
z:=VLR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[3] do
begin
x:=LR*Sin((cont+1)*Pi/(NumPoly/2));
y:=20;
z:=LR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=LR*Sin((cont)*Pi/(NumPoly/2));
y:=20;
z:=LR*Cos((cont)*Pi/(NumPoly/2));
end;
with a.Vert[1] do
begin
x:=VLR*Sin((cont)*Pi/(NumPoly/2));
y:=15;
z:=VLR*Cos((cont)*Pi/(NumPoly/2));
end;
blockwrite(f,a,4+a.NumVert*12,res);
end;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=3;
flag:=not(flag);
a.Green:=50;
a.Blue:=0;
a.Red:=0;
with a.Vert[3] do
begin
x:=LR*Sin((cont+1)*Pi/(NumPoly/2));
y:=20;
z:=LR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=SR*Sin((cont+0.5)*Pi/(NumPoly/2));
y:=29;
z:=SR*Cos((cont+0.5)*Pi/(NumPoly/2));
end;
with a.Vert[1] do
begin
x:=LR*Sin((cont)*Pi/(NumPoly/2));
y:=20;
z:=LR*Cos((cont)*Pi/(NumPoly/2));
end;
blockwrite(f,a,4+a.NumVert*12,res);
end;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=3;
flag:=not(flag);
a.Green:=65;
a.Blue:=0;
a.Red:=0;
with a.Vert[3] do
begin
x:=SR*Sin((cont+0.5)*Pi/(NumPoly/2));
y:=29;
z:=SR*Cos((cont+0.5)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=SR*Sin((cont-0.5)*Pi/(NumPoly/2));
y:=29;
z:=SR*Cos((cont-0.5)*Pi/(NumPoly/2));
end;
with a.Vert[1] do
begin
x:=LR*Sin((cont)*Pi/(NumPoly/2));
y:=20;
z:=LR*Cos((cont)*Pi/(NumPoly/2));
end;
blockwrite(f,a,4+a.NumVert*12,res);
end;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=4;
a.Blue:=70;
a.Green:=70;
a.Red:=70;
with a.Vert[1] do
begin
x:=SR*Sin((cont+1)*Pi/(NumPoly/2));
y:=-4;
z:=SR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=(SR-5)*Sin((cont+1)*Pi/(NumPoly/2));
y:=-10;
z:=(SR-5)*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[3] do
begin
x:=(SR-5)*Sin((cont)*Pi/(NumPoly/2));
y:=-10;
z:=(SR-5)*Cos((cont)*Pi/(NumPoly/2));
end;
with a.Vert[4] do
begin
x:=SR*Sin((cont)*Pi/(NumPoly/2));
y:=-4;
z:=SR*Cos((cont)*Pi/(NumPoly/2));
end;
blockwrite(f,a,4+a.NumVert*12,res);
end;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=4;
a.Blue:=80;
a.Green:=80;
a.Red:=80;
with a.Vert[1] do
begin
x:=(SR-5)*Sin((cont+1)*Pi/(NumPoly/2));
y:=-10;
z:=(SR-5)*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=VSR*Sin((cont+1)*Pi/(NumPoly/2));
y:=-15;
z:=VSR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[3] do
begin
x:=VSR*Sin((cont)*Pi/(NumPoly/2));
y:=-15;
z:=VSR*Cos((cont)*Pi/(NumPoly/2));
end;
with a.Vert[4] do
begin
x:=(SR-5)*Sin((cont)*Pi/(NumPoly/2));
y:=-10;
z:=(SR-5)*Cos((cont)*Pi/(NumPoly/2));
end;
blockwrite(f,a,4+a.NumVert*12,res);
end;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=3;
a.Blue:=127;
a.Green:=127;
a.Red:=127;
with a.Vert[1] do
begin
x:=HSR*Sin((cont+1)*Pi/(NumPoly/2));
y:=-17;
z:=HSR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=0;
y:=-25;
z:=0;
end;
with a.Vert[3] do
begin
x:=HSR*Sin((cont)*Pi/(NumPoly/2));
y:=-17;
z:=HSR*Cos((cont)*Pi/(NumPoly/2));
end;
with a.Vert[4] do
begin
x:=SR*Sin((cont)*Pi/(NumPoly/2));
y:=-10;
z:=SR*Cos((cont)*Pi/(NumPoly/2));
end;
blockwrite(f,a,4+a.NumVert*12,res);
end;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=4;
a.Blue:=90;
a.Green:=90;
a.Red:=90;
with a.Vert[1] do
begin
x:=VSR*Sin((cont+1)*Pi/(NumPoly/2));
y:=-15;
z:=VSR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=HSR*Sin((cont+1)*Pi/(NumPoly/2));
y:=-17;
z:=HSR*Cos((cont+1)*Pi/(NumPoly/2));
end;
with a.Vert[3] do
begin
x:=HSR*Sin((cont)*Pi/(NumPoly/2));
y:=-17;
z:=HSR*Cos((cont)*Pi/(NumPoly/2));
end;
with a.Vert[4] do
begin
x:=VSR*Sin((cont)*Pi/(NumPoly/2));
y:=-15;
z:=VSR*Cos((cont)*Pi/(NumPoly/2));
end;
blockwrite(f,a,4+a.NumVert*12,res);
end;
for cont:=0 to (NumPoly-1) do
begin
a.NumVert:=3;
a.Blue:=2;
if flag=true
then begin
a.Green:=102;
a.Red:=104;
end
else begin
a.Green:=112;
a.Red:=114;
end;
flag:=not(flag);
with a.Vert[3] do
begin
x:=SR*Sin((cont+0.5)*Pi/(NumPoly/2));
y:=29;
z:=SR*Cos((cont+0.5)*Pi/(NumPoly/2));
end;
with a.Vert[2] do
begin
x:=0;
y:=32;
z:=0;
end;
with a.Vert[1] do
begin