-DECLARE SUB ruut2 (x!, y!, z!, s!)\r
-DECLARE SUB ruut (x%, y%, z%, s%)\r
-DECLARE SUB kuus (x!, y!, z!, s!)\r
-DECLARE SUB porand ()\r
-' Cursor keys and to z, w - rotate\r
+' Program renders 3D room with various decorative tiles on the wall and on the floor.\r
+' User can freely fly around and look at the room from different angles.\r
+'\r
+' By Svjatoslav Agejenko.\r
+' Email: svjatoslav@svjatoslav.eu\r
+' Homepage: http://www.svjatoslav.eu\r
+'\r
+' Changelog:\r
+' ?, Initial version\r
+' 2024, Improved program readability using AI\r
+'\r
+' Keyboard controls:\r
+' <left>, <right>, <up>, <down> - move around\r
+' 2, 6, 4, 8 - look around (number pad)\r
' <SPACE> - speed down\r
' q - quit\r
+' + / - - move up / down\r
+'\r
+\r
+\r
+DECLARE SUB renderSquare2 (x!, y!, z!, s!)\r
+DECLARE SUB renderSquare (x%, y%, z%, s%)\r
+DECLARE SUB renderHexagon (x!, y!, z!, s!)\r
+DECLARE SUB generateCube ()\r
\r
DECLARE SUB start ()\r
-DECLARE SUB addsq (x1%, y1%, z1%)\r
-DECLARE SUB getcor ()\r
-DECLARE SUB mulcor ()\r
-DECLARE SUB nait3d ()\r
-DECLARE SUB calcsin ()\r
-DIM SHARED xn(4000), yn(4000), zn(4000)\r
-DIM SHARED x(4000), y(4000), z(4000)\r
-\r
-DIM SHARED xo(4000), yo(4000), zo(4000)\r
-DIM SHARED point1(4000), point2(4000)\r
+DECLARE SUB addSquare (x1%, y1%, z1%)\r
+DECLARE SUB getCornerVertices ()\r
+DECLARE SUB multiplyCoordinates ()\r
+DECLARE SUB calculateSine ()\r
+DIM SHARED xVertex(4000), yVertex(4000), zVertex(4000)\r
+DIM SHARED xCoordinate(4000), yCoordinate(4000), zCoordinate(4000)\r
+\r
+DIM SHARED xOriginal(4000), yOriginal(4000), zOriginal(4000)\r
+DIM SHARED point1Vertex(4000), point2Vertex(4000)\r
DIM SHARED col(4000)\r
-DIM SHARED nump, numl\r
+DIM SHARED vertexCount, edgeCount\r
DIM SHARED myx, myy, myz, mye, myk\r
\r
myx = 0\r
\r
nait3d\r
\r
-SUB addp (x%, y%, z%)\r
+SUB addSquare (x1%, y1%, z1%)\r
c = 1\r
\r
' Define the vertices of a square in 3D space\r
- xn(nump + 1) = -100 + x\r
- yn(nump + 1) = y\r
- zn(nump + 1) = -100 + z\r
+ xVertex(vertexCount + 1) = -100 + x1\r
+ yVertex(vertexCount + 1) = y1\r
+ zVertex(vertexCount + 1) = -100 + z1\r
\r
- xn(nump + 2) = 100 + x\r
- yn(nump + 2) = y\r
- zn(nump + 2) = -100 + z\r
+ xVertex(vertexCount + 2) = 100 + x1\r
+ yVertex(vertexCount + 2) = y1\r
+ zVertex(vertexCount + 2) = -100 + z1\r
\r
- xn(nump + 3) = 100 + x\r
- yn(nump + 3) = y\r
- zn(nump + 3) = 100 + z\r
+ xVertex(vertexCount + 3) = 100 + x1\r
+ yVertex(vertexCount + 3) = y1\r
+ zVertex(vertexCount + 3) = 100 + z1\r
\r
- xn(nump + 4) = -100 + x\r
- yn(nump + 4) = y\r
- zn(nump + 4) = 100 + z\r
+ xVertex(vertexCount + 4) = -100 + x1\r
+ yVertex(vertexCount + 4) = y1\r
+ zVertex(vertexCount + 4) = 100 + z1\r
\r
' Define the edges of the square\r
- point1(numl + 1) = nump + 1\r
- point2(numl + 1) = nump + 2\r
- col(numl + 1) = c\r
+ point1Vertex(edgeCount + 1) = vertexCount + 1\r
+ point2Vertex(edgeCount + 1) = vertexCount + 2\r
+ col(edgeCount + 1) = c\r
\r
- point1(numl + 2) = nump + 2\r
- point2(numl + 2) = nump + 3\r
- col(numl + 2) = c\r
+ point1Vertex(edgeCount + 2) = vertexCount + 2\r
+ point2Vertex(edgeCount + 2) = vertexCount + 3\r
+ col(edgeCount + 2) = c\r
\r
- point1(numl + 3) = nump + 3\r
- point2(numl + 3) = nump + 4\r
- col(numl + 3) = c\r
+ point1Vertex(edgeCount + 3) = vertexCount + 3\r
+ point2Vertex(edgeCount + 3) = vertexCount + 4\r
+ col(edgeCount + 3) = c\r
\r
- point1(numl + 4) = nump + 4\r
- point2(numl + 4) = nump + 1\r
- col(numl + 4) = c\r
+ point1Vertex(edgeCount + 4) = vertexCount + 4\r
+ point2Vertex(edgeCount + 4) = vertexCount + 1\r
+ col(edgeCount + 4) = c\r
\r
' Update the counters for the next square\r
- nump = nump + 4\r
- numl = numl + 4\r
+ vertexCount = vertexCount + 4\r
+ edgeCount = edgeCount + 4\r
\r
END SUB\r
\r
-SUB getcor\r
+SUB getCornerVertices\r
\r
' Define the vertices of a square in 3D space\r
- xn(nump + 1) = -150\r
- yn(nump + 1) = -125\r
- zn(nump + 1) = -200\r
+ xVertex(vertexCount + 1) = -150\r
+ yVertex(vertexCount + 1) = -125\r
+ zVertex(vertexCount + 1) = -200\r
\r
- xn(nump + 2) = 150\r
- yn(nump + 2) = -125\r
- zn(nump + 2) = -200\r
+ xVertex(vertexCount + 2) = 150\r
+ yVertex(vertexCount + 2) = -125\r
+ zVertex(vertexCount + 2) = -200\r
\r
- xn(nump + 3) = 150\r
- yn(nump + 3) = 125\r
- zn(nump + 3) = -200\r
+ xVertex(vertexCount + 3) = 150\r
+ yVertex(vertexCount + 3) = 125\r
+ zVertex(vertexCount + 3) = -200\r
\r
- xn(nump + 4) = -150\r
- yn(nump + 4) = 125\r
- zn(nump + 4) = -200\r
+ xVertex(vertexCount + 4) = -150\r
+ yVertex(vertexCount + 4) = 125\r
+ zVertex(vertexCount + 4) = -200\r
\r
' Define the edges of the square\r
- point1(numl + 1) = nump + 1\r
- point2(numl + 1) = nump + 2\r
+ point1Vertex(edgeCount + 1) = vertexCount + 1\r
+ point2Vertex(edgeCount + 1) = vertexCount + 2\r
\r
- point1(numl + 2) = nump + 2\r
- point2(numl + 2) = nump + 3\r
+ point1Vertex(edgeCount + 2) = vertexCount + 2\r
+ point2Vertex(edgeCount + 2) = vertexCount + 3\r
\r
- point1(numl + 3) = nump + 3\r
- point2(numl + 3) = nump + 4\r
+ point1Vertex(edgeCount + 3) = vertexCount + 3\r
+ point2Vertex(edgeCount + 3) = vertexCount + 4\r
\r
- point1(numl + 4) = nump + 4\r
- point2(numl + 4) = nump + 1\r
+ point1Vertex(edgeCount + 4) = vertexCount + 4\r
+ point2Vertex(edgeCount + 4) = vertexCount + 1\r
\r
' Define the vertices of another square in 3D space\r
- xn(nump + 5) = -150\r
- yn(nump + 5) = -125\r
- zn(nump + 5) = 200\r
+ xVertex(vertexCount + 5) = -150\r
+ yVertex(vertexCount + 5) = -125\r
+ zVertex(vertexCount + 5) = 200\r
\r
- xn(nump + 6) = 150\r
- yn(nump + 6) = -125\r
- zn(nump + 6) = 200\r
+ xVertex(vertexCount + 6) = 150\r
+ yVertex(vertexCount + 6) = -125\r
+ zVertex(vertexCount + 6) = 200\r
\r
- xn(nump + 7) = 150\r
- yn(nump + 7) = 125\r
- zn(nump + 7) = 200\r
+ xVertex(vertexCount + 7) = 150\r
+ yVertex(vertexCount + 7) = 125\r
+ zVertex(vertexCount + 7) = 200\r
\r
- xn(nump + 8) = -150\r
- yn(nump + 8) = 125\r
- zn(nump + 8) = 200\r
+ xVertex(vertexCount + 8) = -150\r
+ yVertex(vertexCount + 8) = 125\r
+ zVertex(vertexCount + 8) = 200\r
\r
' Define the edges of the second square\r
- point1(numl + 5) = nump + 5\r
- point2(numl + 5) = nump + 6\r
+ point1Vertex(edgeCount + 5) = vertexCount + 5\r
+ point2Vertex(edgeCount + 5) = vertexCount + 6\r
\r
- point1(numl + 6) = nump + 6\r
- point2(numl + 6) = nump + 7\r
+ point1Vertex(edgeCount + 6) = vertexCount + 6\r
+ point2Vertex(edgeCount + 6) = vertexCount + 7\r
\r
- point1(numl + 7) = nump + 7\r
- point2(numl + 7) = nump + 8\r
+ point1Vertex(edgeCount + 7) = vertexCount + 7\r
+ point2Vertex(edgeCount + 7) = vertexCount + 8\r
\r
- point1(numl + 8) = nump + 8\r
- point2(numl + 8) = nump + 5\r
+ point1Vertex(edgeCount + 8) = vertexCount + 8\r
+ point2Vertex(edgeCount + 8) = vertexCount + 5\r
\r
' Define the edges connecting the two squares into cube\r
- point1(numl + 9) = nump + 5\r
- point2(numl + 9) = nump + 1\r
+ point1Vertex(edgeCount + 9) = vertexCount + 5\r
+ point2Vertex(edgeCount + 9) = vertexCount + 1\r
\r
- point1(numl + 10) = nump + 6\r
- point2(numl + 10) = nump + 2\r
+ point1Vertex(edgeCount + 10) = vertexCount + 6\r
+ point2Vertex(edgeCount + 10) = vertexCount + 2\r
\r
- point1(numl + 11) = nump + 7\r
- point2(numl + 11) = nump + 3\r
+ point1Vertex(edgeCount + 11) = vertexCount + 7\r
+ point2Vertex(edgeCount + 11) = vertexCount + 3\r
\r
- point1(numl + 12) = nump + 8\r
- point2(numl + 12) = nump + 4\r
+ point1Vertex(edgeCount + 12) = vertexCount + 8\r
+ point2Vertex(edgeCount + 12) = vertexCount + 4\r
\r
' Update the counters for the next set of vertices and edges\r
- nump = nump + 8\r
- numl = numl + 12\r
+ vertexCount = vertexCount + 8\r
+ edgeCount = edgeCount + 12\r
\r
' Define a pyramid in 3D space\r
- xn(nump + 1) = -150\r
- yn(nump + 1) = -125 + 201\r
- zn(nump + 1) = 0\r
+ xVertex(vertexCount + 1) = -150\r
+ yVertex(vertexCount + 1) = -125 + 201\r
+ zVertex(vertexCount + 1) = 0\r
\r
- xn(nump + 2) = -150\r
- yn(nump + 2) = -125 + 201\r
- zn(nump + 2) = 89\r
+ xVertex(vertexCount + 2) = -150\r
+ yVertex(vertexCount + 2) = -125 + 201\r
+ zVertex(vertexCount + 2) = 89\r
\r
- xn(nump + 3) = -150\r
- yn(nump + 3) = -125\r
- zn(nump + 3) = 89\r
+ xVertex(vertexCount + 3) = -150\r
+ yVertex(vertexCount + 3) = -125\r
+ zVertex(vertexCount + 3) = 89\r
\r
- xn(nump + 4) = -150\r
- yn(nump + 4) = -125\r
- zn(nump + 4) = 0\r
+ xVertex(vertexCount + 4) = -150\r
+ yVertex(vertexCount + 4) = -125\r
+ zVertex(vertexCount + 4) = 0\r
\r
' Define the edges of the pyramid\r
- point1(numl + 1) = nump + 1\r
- point2(numl + 1) = nump + 2\r
+ point1Vertex(edgeCount + 1) = vertexCount + 1\r
+ point2Vertex(edgeCount + 1) = vertexCount + 2\r
\r
- point1(numl + 2) = nump + 2\r
- point2(numl + 2) = nump + 3\r
+ point1Vertex(edgeCount + 2) = vertexCount + 2\r
+ point2Vertex(edgeCount + 2) = vertexCount + 3\r
\r
- point1(numl + 3) = nump + 3\r
- point2(numl + 3) = nump + 4\r
+ point1Vertex(edgeCount + 3) = vertexCount + 3\r
+ point2Vertex(edgeCount + 3) = vertexCount + 4\r
\r
- point1(numl + 4) = nump + 4\r
- point2(numl + 4) = nump + 1\r
+ point1Vertex(edgeCount + 4) = vertexCount + 4\r
+ point2Vertex(edgeCount + 4) = vertexCount + 1\r
\r
' Update the counters for the next set of vertices and edges\r
- nump = nump + 4\r
- numl = numl + 4\r
-\r
+ vertexCount = vertexCount + 4\r
+ edgeCount = edgeCount + 4\r
\r
porand\r
\r
END SUB\r
\r
-SUB kuus (x, y, z, s)\r
+SUB renderHexagon (x, y, z, s)\r
\r
b = 0\r
f = .3925\r
y1 = COS(a) * s\r
b = b + 1\r
\r
- xn(nump + b) = x + x1\r
- yn(nump + b) = y\r
- zn(nump + b) = z + y1\r
+ xVertex(vertexCount + b) = x + x1\r
+ yVertex(vertexCount + b) = y\r
+ zVertex(vertexCount + b) = z + y1\r
\r
NEXT a\r
\r
' Define the edges of the hexagon\r
-point1(numl + 1) = nump + 1\r
-point2(numl + 1) = nump + 2\r
-col(numl + 1) = 12\r
+point1Vertex(edgeCount + 1) = vertexCount + 1\r
+point2Vertex(edgeCount + 1) = vertexCount + 2\r
+col(edgeCount + 1) = 12\r
\r
-point1(numl + 2) = nump + 2\r
-point2(numl + 2) = nump + 3\r
-col(numl + 2) = 12\r
+point1Vertex(edgeCount + 2) = vertexCount + 2\r
+point2Vertex(edgeCount + 2) = vertexCount + 3\r
+col(edgeCount + 2) = 12\r
\r
-point1(numl + 3) = nump + 3\r
-point2(numl + 3) = nump + 4\r
-col(numl + 3) = 12\r
+point1Vertex(edgeCount + 3) = vertexCount + 3\r
+point2Vertex(edgeCount + 3) = vertexCount + 4\r
+col(edgeCount + 3) = 12\r
\r
-point1(numl + 4) = nump + 4\r
-point2(numl + 4) = nump + 5\r
-col(numl + 4) = 12\r
+point1Vertex(edgeCount + 4) = vertexCount + 4\r
+point2Vertex(edgeCount + 4) = vertexCount + 5\r
+col(edgeCount + 4) = 12\r
\r
-point1(numl + 5) = nump + 5\r
-point2(numl + 5) = nump + 6\r
-col(numl + 5) = 12\r
+point1Vertex(edgeCount + 5) = vertexCount + 5\r
+point2Vertex(edgeCount + 5) = vertexCount + 6\r
+col(edgeCount + 5) = 12\r
\r
-point1(numl + 6) = nump + 6\r
-point2(numl + 6) = nump + 7\r
-col(numl + 6) = 12\r
+point1Vertex(edgeCount + 6) = vertexCount + 6\r
+point2Vertex(edgeCount + 6) = vertexCount + 7\r
+col(edgeCount + 6) = 12\r
\r
-point1(numl + 7) = nump + 7\r
-point2(numl + 7) = nump + 8\r
-col(numl + 7) = 12\r
+point1Vertex(edgeCount + 7) = vertexCount + 7\r
+point2Vertex(edgeCount + 7) = vertexCount + 8\r
+col(edgeCount + 7) = 12\r
\r
-point1(numl + 8) = nump + 8\r
-point2(numl + 8) = nump + 1\r
-col(numl + 8) = 12\r
+point1Vertex(edgeCount + 8) = vertexCount + 8\r
+point2Vertex(edgeCount + 8) = vertexCount + 1\r
+col(edgeCount + 8) = 12\r
\r
' Update the counters for the next set of vertices and edges\r
-nump = nump + b\r
-numl = numl + 8\r
+vertexCount = vertexCount + b\r
+edgeCount = edgeCount + 8\r
\r
END SUB\r
\r
C2 = COS(Deg2): S2 = SIN(Deg2)\r
\r
' Apply the rotation to each vertex\r
- FOR a = 1 TO nump\r
- xo = xn(a) - myx\r
- yo = -yn(a) - myy\r
- zo = zn(a) - myz\r
+ FOR a = 1 TO vertexCount\r
+ xo = xVertex(a) - myx\r
+ yo = -yVertex(a) - myy\r
+ zo = zVertex(a) - myz\r
\r
x1 = (xo * C1 - zo * S1)\r
z1 = (xo * S1 + zo * C1)\r
z2 = (yo * S2 + z1 * C2)\r
\r
' Project the vertex onto the 2D screen\r
- xo(a) = x(a)\r
- yo(a) = y(a)\r
+ xOriginal(a) = xCoordinate(a)\r
+ yOriginal(a) = yCoordinate(a)\r
IF z2 < 20 THEN\r
- x(a) = -1\r
+ xCoordinate(a) = -1\r
ELSE\r
- x(a) = 320 + (x1 / z2 * 500)\r
- y(a) = 240 + (y1 / z2 * 500)\r
+ xCoordinate(a) = 320 + (x1 / z2 * 500)\r
+ yCoordinate(a) = 240 + (y1 / z2 * 500)\r
END IF\r
NEXT\r
\r
' Draw the edges of each shape\r
- FOR a = 1 TO numl\r
- p1 = point1(a)\r
- p2 = point2(a)\r
- IF xo(p1) = -1 OR xo(p2) = -1 THEN\r
+ FOR a = 1 TO edgeCount\r
+ p1 = point1Vertex(a)\r
+ p2 = point2Vertex(a)\r
+ IF xOriginal(p1) = -1 OR xOriginal(p2) = -1 THEN\r
' Skip drawing if the vertex is off-screen\r
ELSE\r
' erase edge on old coordinates\r
- LINE (xo(p1), yo(p1))-(xo(p2), yo(p2)), 0\r
+ LINE (xOriginal(p1), yOriginal(p1))-(xOriginal(p2), yOriginal(p2)), 0\r
END IF\r
\r
- IF x(p1) = -1 OR x(p2) = -1 THEN\r
+ IF xCoordinate(p1) = -1 OR xCoordinate(p2) = -1 THEN\r
' Skip drawing if the vertex is off-screen\r
ELSE\r
' draw edge on new coordinates\r
- LINE (x(p1), y(p1))-(x(p2), y(p2)), col(a)\r
+ LINE (xCoordinate(p1), yCoordinate(p1))-(xCoordinate(p2), yCoordinate(p2)), col(a)\r
END IF\r
NEXT\r
\r
' Generate a grid of shapes in 3D space\r
FOR x = -100 TO 0 STEP 12.067 + .3\r
FOR z = -100 TO 0 STEP 12.067 + .3\r
- kuus x, -125, z, 6.53\r
- ruut x + 6.033 + .15, -125, z + 6.033 + .15, 3.111 + .3\r
+ renderHexagon x, -125, z, 6.53\r
+ renderSquare x + 6.033 + .15, -125, z + 6.033 + .15, 3.111 + .3\r
NEXT z\r
NEXT x\r
\r
' Generate another grid of shapes in 3D space\r
FOR y = -100 TO 0 STEP 20.3\r
FOR x = -100 TO 0 STEP 20.3\r
- ruut2 x, y, 200, 10\r
+ renderSquare2 x, y, 200, 10\r
NEXT x\r
NEXT y\r
\r
END SUB\r
\r
-SUB ruut (x%, y%, z%, s%)\r
+SUB renderSquare (x%, y%, z%, s%)\r
\r
' Define the vertices of a square in 3D space\r
- xn(nump + 1) = x\r
- yn(nump + 1) = y\r
- zn(nump + 1) = z + s\r
+ xVertex(vertexCount + 1) = x%\r
+ yVertex(vertexCount + 1) = y%\r
+ zVertex(vertexCount + 1) = z% + s%\r
\r
- xn(nump + 2) = x + s\r
- yn(nump + 2) = y\r
- zn(nump + 2) = z\r
+ xVertex(vertexCount + 2) = x% + s%\r
+ yVertex(vertexCount + 2) = y%\r
+ zVertex(vertexCount + 2) = z%\r
\r
- xn(nump + 3) = x\r
- yn(nump + 3) = y\r
- zn(nump + 3) = z - s\r
+ xVertex(vertexCount + 3) = x%\r
+ yVertex(vertexCount + 3) = y%\r
+ zVertex(vertexCount + 3) = z% - s%\r
\r
- xn(nump + 4) = x - s\r
- yn(nump + 4) = y\r
- zn(nump + 4) = z\r
+ xVertex(vertexCount + 4) = x% - s%\r
+ yVertex(vertexCount + 4) = y%\r
+ zVertex(vertexCount + 4) = z%\r
\r
' Define the edges of the square\r
- point1(numl + 1) = nump + 1\r
- point2(numl + 1) = nump + 2\r
- col(numl + 1) = 10\r
+ point1Vertex(edgeCount + 1) = vertexCount + 1\r
+ point2Vertex(edgeCount + 1) = vertexCount + 2\r
+ col(edgeCount + 1) = 10\r
\r
- point1(numl + 2) = nump + 2\r
- point2(numl + 2) = nump + 3\r
- col(numl + 2) = 10\r
+ point1Vertex(edgeCount + 2) = vertexCount + 2\r
+ point2Vertex(edgeCount + 2) = vertexCount + 3\r
+ col(edgeCount + 2) = 10\r
\r
- point1(numl + 3) = nump + 3\r
- point2(numl + 3) = nump + 4\r
- col(numl + 3) = 10\r
+ point1Vertex(edgeCount + 3) = vertexCount + 3\r
+ point2Vertex(edgeCount + 3) = vertexCount + 4\r
+ col(edgeCount + 3) = 10\r
\r
- point1(numl + 4) = nump + 4\r
- point2(numl + 4) = nump + 1\r
- col(numl + 4) = 10\r
+ point1Vertex(edgeCount + 4) = vertexCount + 4\r
+ point2Vertex(edgeCount + 4) = vertexCount + 1\r
+ col(edgeCount + 4) = 10\r
\r
' Update the counters for the next square\r
- nump = nump + 4\r
- numl = numl + 4\r
+ vertexCount = vertexCount + 4\r
+ edgeCount = edgeCount + 4\r
\r
END SUB\r
\r
-SUB ruut2 (x, y, z, s)\r
+SUB renderSquare2 (x, y, z, s)\r
\r
' Define the vertices of a square in 3D space\r
- xn(nump + 1) = x - s\r
- yn(nump + 1) = y - s\r
- zn(nump + 1) = z\r
+ xVertex(vertexCount + 1) = x - s\r
+ yVertex(vertexCount + 1) = y - s\r
+ zVertex(vertexCount + 1) = z\r
\r
- xn(nump + 2) = x + s\r
- yn(nump + 2) = y - s\r
- zn(nump + 2) = z\r
+ xVertex(vertexCount + 2) = x + s\r
+ yVertex(vertexCount + 2) = y - s\r
+ zVertex(vertexCount + 2) = z\r
\r
- xn(nump + 3) = x + s\r
- yn(nump + 3) = y + s\r
- zn(nump + 3) = z\r
+ xVertex(vertexCount + 3) = x + s\r
+ yVertex(vertexCount + 3) = y + s\r
+ zVertex(vertexCount + 3) = z\r
\r
- xn(nump + 4) = x - s\r
- yn(nump + 4) = y + s\r
- zn(nump + 4) = z\r
+ xVertex(vertexCount + 4) = x - s\r
+ yVertex(vertexCount + 4) = y + s\r
+ zVertex(vertexCount + 4) = z\r
\r
' Define the edges of the square\r
- point1(numl + 1) = nump + 1\r
- point2(numl + 1) = nump + 2\r
- col(numl + 1) = 14\r
+ point1Vertex(edgeCount + 1) = vertexCount + 1\r
+ point2Vertex(edgeCount + 1) = vertexCount + 2\r
+ col(edgeCount + 1) = 14\r
\r
- point1(numl + 2) = nump + 2\r
- point2(numl + 2) = nump + 3\r
- col(numl + 2) = 14\r
+ point1Vertex(edgeCount + 2) = vertexCount + 2\r
+ point2Vertex(edgeCount + 2) = vertexCount + 3\r
+ col(edgeCount + 2) = 14\r
\r
- point1(numl + 3) = nump + 3\r
- point2(numl + 3) = nump + 4\r
- col(numl + 3) = 14\r
+ point1Vertex(edgeCount + 3) = vertexCount + 3\r
+ point2Vertex(edgeCount + 3) = vertexCount + 4\r
+ col(edgeCount + 3) = 14\r
\r
- point1(numl + 4) = nump + 4\r
- point2(numl + 4) = nump + 1\r
- col(numl + 4) = 14\r
+ point1Vertex(edgeCount + 4) = vertexCount + 4\r
+ point2Vertex(edgeCount + 4) = vertexCount + 1\r
+ col(edgeCount + 4) = 14\r
\r
' Update the counters for the next square\r
- nump = nump + 4\r
- numl = numl + 4\r
+ vertexCount = vertexCount + 4\r
+ edgeCount = edgeCount + 4\r
\r
END SUB\r
\r
NEXT a\r
\r
' Initialize counters for vertices and edges\r
- nump = 0\r
- numl = 0\r
+ vertexCount = 0\r
+ edgeCount = 0\r
\r
' Generate the initial set of shapes\r
- getcor\r
+ getCornerVertices\r
\r
END SUB\r
-\r