mirror of
https://git.sr.ht/~rabbits/macintosh_cookbook
synced 2025-01-03 09:30:21 +00:00
Added Andes Castel
This commit is contained in:
parent
7f05b347e4
commit
306a88f554
@ -7,6 +7,7 @@ interface
|
||||
procedure SetStairs3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
|
||||
procedure SetDoorway3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
|
||||
procedure SetDoorwayWall3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
|
||||
procedure SetLedge3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
|
||||
procedure SetParticles3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
|
||||
|
||||
implementation
|
||||
@ -76,20 +77,28 @@ implementation
|
||||
AddFace3D(shape, 1, 2, 9);
|
||||
end;
|
||||
|
||||
procedure SetLedge3D (var shape: Shape3D; x, y, z, w, h, d: Longint);
|
||||
begin
|
||||
AddRec3D(shape, x, y, z, w, h div 4 * 4);
|
||||
AddRec3D(shape, x, y - 120, z + 20, w, h div 4 * 3);
|
||||
AddEdge3D(shape, 2, 5);
|
||||
AddEdge3D(shape, 3, 8);
|
||||
AddFace3D(shape, 2, 3, 5);
|
||||
AddFace3D(shape, 3, 5, 8);
|
||||
end;
|
||||
|
||||
procedure SetParticles3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
|
||||
var
|
||||
i: Integer;
|
||||
rx, ry, rz: Fixed;
|
||||
begin
|
||||
{ frame }
|
||||
|
||||
for i := 1 to 20 do
|
||||
for i := 1 to 16 do
|
||||
begin
|
||||
rx := FracMul(Fix2Frac(Random), w);
|
||||
ry := FracMul(Fix2Frac(Random), h);
|
||||
rz := FracMul(Fix2Frac(Random), z);
|
||||
AddVertice3D(shape, x + rx, y + ry, z + rz);
|
||||
AddVertice3D(shape, x + rx, y + ry + 2, z + rz);
|
||||
AddVertice3D(shape, x + rx, y + ry + 10, z + rz);
|
||||
AddEdge3D(shape, i * 2 - 1, i * 2);
|
||||
end;
|
||||
end;
|
99
projects/Neauismetica/andes_castel.pas
Normal file
99
projects/Neauismetica/andes_castel.pas
Normal file
@ -0,0 +1,99 @@
|
||||
program AndesCastel;
|
||||
|
||||
uses
|
||||
FixMath, Graf3D, Graf3DScene, Graf3DPrimitives, Graf3DStructures;
|
||||
|
||||
var
|
||||
sta1, sta12, dwy1, dwy11, dwy12, dww1, cir1, rec1: Shape3D;
|
||||
sta2, sta22, dwy2, dwy21, dwy22, dww2, cir2, rec2: Shape3D;
|
||||
cir3, tri1, tri2, led1, led2, led3, led4, led5, led6, led7, led8: Shape3D;
|
||||
par1: Shape3D;
|
||||
guide1, guide2, guide3, guide4: Shape3D;
|
||||
begin
|
||||
|
||||
{scene}
|
||||
|
||||
SetScene3D(scene);
|
||||
|
||||
{guides}
|
||||
|
||||
SetRec3D(guide1, 0, 0, -100, 1000, 1000);
|
||||
SetRec3D(guide2, 0, 0, -100, 1000, 1000);
|
||||
SetRec3D(guide4, 0, 0, -100, 1000, 1000);
|
||||
SetRec3D(guide3, 0, 0, 500, 1000, 300);
|
||||
TurnXShape3D(@guide2);
|
||||
TurnYShape3D(@guide3);
|
||||
AddShape3D(scene, @guide1);
|
||||
AddShape3D(scene, @guide2);
|
||||
AddShape3D(scene, @guide3);
|
||||
AddShape3D(scene, @guide4);
|
||||
|
||||
SetStairs3D(sta1, 0, -150, 0, 100, 100, 100);
|
||||
SetStairs3D(sta12, 0, -250, 200, 100, 100, 100);
|
||||
SetDoorwayWall3D(dww1, 0, 50, -50, 100, 300, 100);
|
||||
|
||||
SetRec3D(rec1, 0, -150, -100, 100, 200);
|
||||
SetRec3D(rec2, 0, 200, -150, 100, 300);
|
||||
SetCir3D(cir1, 0, 150, -50, 250);
|
||||
|
||||
SetDoorway3D(dwy1, 0, 50, -50, 100, 300, 100);
|
||||
SetDoorway3D(dwy11, 0, 50, -150, 100, 300, 100);
|
||||
SetDoorway3D(dwy12, 0, 50, -200, 100, 300, 100);
|
||||
|
||||
AddShape3D(scene, @rec1);
|
||||
TurnXShape3D(@rec1);
|
||||
AddShape3D(scene, @dwy11);
|
||||
AddShape3D(scene, @dwy12);
|
||||
AddShape3D(scene, @dww1);
|
||||
|
||||
SetCir3D(cir2, -300, 150, -50, 250);
|
||||
SetDoorway3D(dwy2, -300, 50, -50, 100, 300, 100);
|
||||
SetStairs3D(sta2, -300, -150, 0, 100, 100, 100);
|
||||
SetStairs3D(sta22, -300, -250, 200, 100, 100, 100);
|
||||
|
||||
SetLedge3D(led1, -100, 50, -50, 100, 100, 100);
|
||||
SetLedge3D(led2, -200, 50, -50, 100, 100, 100);
|
||||
SetLedge3D(led3, -400, 50, -50, 100, 100, 100);
|
||||
SetLedge3D(led4, 100, 50, -50, 100, 100, 100);
|
||||
AddShape3D(scene, @led1);
|
||||
AddShape3D(scene, @led2);
|
||||
AddShape3D(scene, @led3);
|
||||
AddShape3D(scene, @led4);
|
||||
|
||||
SetLedge3D(led5, 200, 50, 150, 300, 100, 100);
|
||||
TurnYShape3D(@led5);
|
||||
TurnYShape3D(@led5);
|
||||
TurnYShape3D(@led5);
|
||||
SetLedge3D(led6, -150, -250, -50, 600, 100, 100);
|
||||
AddShape3D(scene, @led5);
|
||||
AddShape3D(scene, @led6);
|
||||
|
||||
SetLedge3D(led7, 200, -250, 150, 300, 100, 100);
|
||||
TurnYShape3D(@led7);
|
||||
TurnYShape3D(@led7);
|
||||
TurnYShape3D(@led7);
|
||||
AddShape3D(scene, @led7);
|
||||
|
||||
AddShape3D(scene, @dwy1);
|
||||
AddShape3D(scene, @cir1);
|
||||
AddShape3D(scene, @sta1);
|
||||
AddShape3D(scene, @sta12);
|
||||
|
||||
AddShape3D(scene, @dwy2);
|
||||
AddShape3D(scene, @cir2);
|
||||
AddShape3D(scene, @sta2);
|
||||
AddShape3D(scene, @sta22);
|
||||
|
||||
SetParticles3D(par1, 0, 0, 200, 1000, 1000, 1000);
|
||||
AddShape3D(scene, @par1);
|
||||
|
||||
{ornaments}
|
||||
SetCir3D(cir2, -150, 400, -50, 250);
|
||||
AddShape3D(scene, @cir3);
|
||||
SetTri3D(tri1, -150, 250, -50, 300, 300);
|
||||
AddShape3D(scene, @tri1);
|
||||
tri1.facesLength := 0;
|
||||
|
||||
InitWindow;
|
||||
|
||||
end.
|
@ -37,7 +37,7 @@ interface
|
||||
|
||||
Scene3D = record
|
||||
length: Integer;
|
||||
shapes: array[1..20] of Shape3DPtr;
|
||||
shapes: array[1..30] of Shape3DPtr;
|
||||
end;
|
||||
|
||||
Scene3DPtr = ^Scene3D;
|
||||
@ -291,10 +291,10 @@ implementation
|
||||
|
||||
procedure InitWindow;
|
||||
begin
|
||||
viewWidth := 500;
|
||||
viewHeight := 342;
|
||||
padLeft := 60;
|
||||
padTop := 60;
|
||||
viewWidth := 640;
|
||||
viewHeight := 405;
|
||||
padLeft := 15;
|
||||
padTop := 20;
|
||||
SetRect(drawingRect, padLeft, padTop, padLeft + viewWidth, padTop + viewHeight);
|
||||
SetDrawingRect(drawingRect);
|
||||
ShowDrawing;
|
||||
|
Loading…
Reference in New Issue
Block a user