Added plane with intersections

This commit is contained in:
neauoire 2020-05-16 21:37:52 +09:00
parent de90f4e649
commit 6824fd50ee
2 changed files with 19 additions and 1 deletions

View File

@ -8,7 +8,9 @@ interface
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);
procedure SetGrd3D (var shape: Shape3D; x, y, z, w, h, d: Longint);
implementation
@ -103,4 +105,20 @@ implementation
end;
end;
procedure SetGrd3D (var shape: Shape3D; x, y, z, w, h, d: Longint);
var
i: Integer;
begin
for i := 1 to d do
begin
AddVertice3D(shape, x - w div 2, y + h div 2 - h div d * (i - 1), z);
AddVertice3D(shape, x + w div 2, y + h div 2 - h div d * (i - 1), z);
AddEdge3D(shape, i * 4 - 3, i * 4 - 2);
AddVertice3D(shape, x + w div 2 - w div d * (i - 1), y - h div 2, z);
AddVertice3D(shape, x + w div 2 - w div d * (i - 1), y + h div 2, z);
AddEdge3D(shape, i * 4 - 1, i * 4);
end;
AddRec3D(shape, x, y, z, w, h div 4 * 4);
end;
end.

View File

@ -297,7 +297,7 @@ implementation
viewWidth := 640;
viewHeight := 405;
padLeft := 15;
padTop := 20;
padTop := 40;
SetRect(drawingRect, padLeft, padTop, padLeft + viewWidth, padTop + viewHeight);
SetDrawingRect(drawingRect);
ShowDrawing;