Renamed proc

This commit is contained in:
neauoire 2020-05-15 19:49:28 +09:00
parent b77592d180
commit d08f838eec
3 changed files with 23 additions and 23 deletions

View File

@ -6,16 +6,16 @@ interface
{2d}
procedure SetTri3D (var shape: Shape3D; x, y, z, w, h: Fixed);
procedure SetRect3D (var shape: Shape3D; x, y, z, w, d: Fixed);
procedure SetCircle3D (var shape: Shape3D; x, y, z, r: Fixed);
procedure SetRec3D (var shape: Shape3D; x, y, z, w, d: Fixed);
procedure SetCir3D (var shape: Shape3D; x, y, z, r: Fixed);
{3d}
procedure SetWedge3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
procedure SetWed3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
procedure SetBox3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
procedure SetCyl3D (var shape: Shape3D; x, y, z, w, h, d, r: Fixed);
{parts}
procedure AddTri3D (var shape: Shape3D; x, y, z, w, h: Longint);
procedure AddRect3D (var shape: Shape3D; x, y, z, w, h: Longint);
procedure AddCircle3D (var shape: Shape3D; x, y, z, d: Longint);
procedure AddRec3D (var shape: Shape3D; x, y, z, w, h: Longint);
procedure AddCir3D (var shape: Shape3D; x, y, z, d: Longint);
implementation
@ -30,7 +30,7 @@ implementation
AddFace3D(shape, shape.verticesLength - 2, shape.verticesLength - 1, shape.verticesLength);
end;
procedure AddRect3D (var shape: Shape3D; x, y, z, w, h: Fixed);
procedure AddRec3D (var shape: Shape3D; x, y, z, w, h: Fixed);
begin
AddVertice3D(shape, x + w div 2, y + h div 2, z);
AddVertice3D(shape, x + w div 2, y - h div 2, z);
@ -44,7 +44,7 @@ implementation
AddFace3D(shape, shape.verticesLength - 3, shape.verticesLength - 2, shape.verticesLength);
end;
procedure AddCircle3D (var shape: Shape3D; x, y, z, d: Fixed);
procedure AddCir3D (var shape: Shape3D; x, y, z, d: Fixed);
var
voff, eoff, foff: Integer; { vertices offset}
i, segs: Integer;
@ -77,14 +77,14 @@ implementation
AddTri3D(shape, x, y, z, w, h);
end;
procedure SetRect3D (var shape: Shape3D; x, y, z, w, d: Fixed);
procedure SetRec3D (var shape: Shape3D; x, y, z, w, d: Fixed);
begin
AddRect3D(shape, x, y, z, w, d);
AddRec3D(shape, x, y, z, w, d);
end;
procedure SetCircle3D (var shape: Shape3D; x, y, z, r: Fixed);
procedure SetCir3D (var shape: Shape3D; x, y, z, r: Fixed);
begin
AddCircle3D(shape, x, y, z, r);
AddCir3D(shape, x, y, z, r);
end;
procedure SetBox3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
@ -92,13 +92,13 @@ implementation
i: Integer;
begin
SetPt3D(shape.origin, Long2Fix(x), Long2Fix(y), Long2Fix(z));
AddRect3D(shape, x, y, z + d div 2, w, h);
AddRect3D(shape, x, y, z - d div 2, w, h);
AddRec3D(shape, x, y, z + d div 2, w, h);
AddRec3D(shape, x, y, z - d div 2, w, h);
for i := 1 to 4 do
AddEdge3D(shape, i, i + 4);
end;
procedure SetWedge3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
procedure SetWed3D (var shape: Shape3D; x, y, z, w, h, d: Fixed);
var
i: Integer;
begin
@ -114,8 +114,8 @@ implementation
i: Integer;
begin
SetPt3D(shape.origin, Long2Fix(x), Long2Fix(y), Long2Fix(z));
AddCircle3D(shape, x, y, z + d div 2, r);
AddCircle3D(shape, x, y, z - d div 2, r);
AddCir3D(shape, x, y, z + d div 2, r);
AddCir3D(shape, x, y, z - d div 2, r);
for i := 1 to 12 do
AddEdge3D(shape, i, i + 12);
end;

View File

@ -16,10 +16,10 @@ implementation
hq: Fixed;
begin
hq := FixDiv(h, 4);
AddRect3D(shape, x, y - h + FixMul(hq div 2, 5), z + d - FixMul(hq, 2), w, h div 4);
AddRect3D(shape, x, y - h + FixMul(hq div 2, 7), z + d - FixMul(hq, 3), w, h div 4);
AddRect3D(shape, x, y - h + FixMul(hq div 2, 9), z + d - FixMul(hq, 4), w, h div 4);
AddRect3D(shape, x, y - h + FixMul(hq div 2, 11), z + d - FixMul(hq, 5), w, h div 4);
AddRec3D(shape, x, y - h + FixMul(hq div 2, 5), z + d - FixMul(hq, 2), w, h div 4);
AddRec3D(shape, x, y - h + FixMul(hq div 2, 7), z + d - FixMul(hq, 3), w, h div 4);
AddRec3D(shape, x, y - h + FixMul(hq div 2, 9), z + d - FixMul(hq, 4), w, h div 4);
AddRec3D(shape, x, y - h + FixMul(hq div 2, 11), z + d - FixMul(hq, 5), w, h div 4);
AddEdge3D(shape, 4, 7);
AddEdge3D(shape, 1, 6);
AddEdge3D(shape, 8, 11);

View File

@ -14,10 +14,10 @@ begin
SetScene3D(scene);
SetTri3D(tri1, -100, 0, 150, 100, 100);
SetRect3D(rec1, 0, 0, 150, 100, 100);
SetCircle3D(cir1, 100, 0, 150, 100);
SetRec3D(rec1, 0, 0, 150, 100, 100);
SetCir3D(cir1, 100, 0, 150, 100);
SetWedge3D(wed1, -100, 0, 0, 100, 100, 100);
SetWed3D(wed1, -100, 0, 0, 100, 100, 100);
SetBox3D(box1, 0, 0, 0, 100, 100, 100);
SetCyl3D(cyl1, 100, 0, 0, 100, 100, 100, 100);