From 6824fd50ee1338ef52ff250367b4a81e0e80f830 Mon Sep 17 00:00:00 2001 From: neauoire Date: Sat, 16 May 2020 21:37:52 +0900 Subject: [PATCH] Added plane with intersections --- projects/Neauismetica/Graf3DStructures.pas | 18 ++++++++++++++++++ units/Graf3DScene/Graf3DScene.pas | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/projects/Neauismetica/Graf3DStructures.pas b/projects/Neauismetica/Graf3DStructures.pas index 0622066..0f5c85a 100644 --- a/projects/Neauismetica/Graf3DStructures.pas +++ b/projects/Neauismetica/Graf3DStructures.pas @@ -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. \ No newline at end of file diff --git a/units/Graf3DScene/Graf3DScene.pas b/units/Graf3DScene/Graf3DScene.pas index b4cbbce..d019a91 100644 --- a/units/Graf3DScene/Graf3DScene.pas +++ b/units/Graf3DScene/Graf3DScene.pas @@ -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;