From: Svjatoslav Agejenko Date: Tue, 15 Oct 2024 19:20:21 +0000 (+0300) Subject: Refactoring code for better readability X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=7f78482982d34d4db396f178e43b8d94ea0f3f11;p=qbasicapps.git Refactoring code for better readability --- diff --git a/Graphics/3D/rocket.bas b/Graphics/3D/rocket.bas index 3829882..497f549 100755 --- a/Graphics/3D/rocket.bas +++ b/Graphics/3D/rocket.bas @@ -1,493 +1,525 @@ -' 3D rocket simulator -' made by Svjatoslav Agejenko -' in 2001 -' H-Page: svjatoslav.eu -' E-Mail: svjatoslav@svjatoslav.eu - -' arrow keys - move around -' 2, 6, 4, 8 - look around -' - - fly up -' + - fly down - - -DECLARE SUB addp () -DECLARE SUB addl () -DEFDBL A-Z -DECLARE SUB teerock () -DECLARE SUB teemaa () -DECLARE SUB start () -DECLARE SUB n3d () - -DIM SHARED px(1 TO 1500) -DIM SHARED py(1 TO 1500) -DIM SHARED pz(1 TO 1500) - -DIM SHARED l1(1 TO 3000) -DIM SHARED l2(1 TO 3000) -DIM SHARED lc(1 TO 3000) - -DIM SHARED rpx(1 TO 1900) -DIM SHARED rpy(1 TO 1900) - -DIM SHARED rkx(1 TO 200) -DIM SHARED rky(1 TO 200) -DIM SHARED rkz(1 TO 200) - -DIM SHARED mitp, mitl -DIM SHARED myx, myy, myz -DIM SHARED myxp, myyp, myzp -DIM SHARED my1, my2 - - -DIM SHARED ox1(1 TO 2500) -DIM SHARED oy1(1 TO 2500) -DIM SHARED ox2(1 TO 2500) -DIM SHARED oy2(1 TO 2500) -DIM SHARED frm, frm2, frm3 - -DIM SHARED mk, mks, rs, rst -DIM SHARED pi -DIM SHARED rkb, rke, rkm -DIM SHARED rx, ry, rz, rxp, ryp, rzp - -DIM SHARED tmr$, ts -DIM SHARED ale - -start -my1 = -pi / 2 - -rx = 0 -ry = mk / 2 + .009 -rz = 0 - -myx = 0 -myy = mk / 2 -myz = -.05 - -ts = 0 -frm2 = 999999 -tmr$ = TIME$ -1 -frm = frm + 1 -frm2 = frm2 + 1 - -LOCATE 1, 1 -PRINT mitp, mitl, mk, mks -LOCATE 2, 1 -PRINT rkb, rke, TIMER - - -rx = rx + (rxp * ts) -ry = ry + (ryp * ts) -rz = rz + (rzp * ts) - -ryp = ryp + (.0098 * ts) -rxp = SIN(frm / 20) / 50 -'ryp = .001 - -FOR a = 1 TO rkm -px(a + rkb - 1) = rkx(a) + rx -py(a + rkb - 1) = rky(a) + ry -pz(a + rkb - 1) = rkz(a) + rz -NEXT a - - -myx = myx + (myxp * ts) -myy = myy + (myyp * ts) -myz = myz + (myzp * ts) - -n3d - - - -a$ = INKEY$ -IF a$ <> "" THEN -IF a$ = CHR$(0) + "H" THEN -myzp = myzp - SIN(my1) / 100 -myxp = myxp + COS(my1) / 100 -END IF -IF a$ = CHR$(0) + "P" THEN -myzp = myzp + SIN(my1) / 100 -myxp = myxp - COS(my1) / 100 -END IF - -IF a$ = CHR$(0) + "M" THEN -myzp = myzp + COS(my1) / 100 -myxp = myxp + SIN(my1) / 100 -END IF -IF a$ = CHR$(0) + "K" THEN -myzp = myzp - COS(my1) / 100 -myxp = myxp - SIN(my1) / 100 -END IF - - -IF a$ = CHR$(27) THEN SYSTEM -IF a$ = "4" THEN my1 = my1 + .1 -IF a$ = "6" THEN my1 = my1 - .1 -IF a$ = "2" THEN my2 = my2 + .1 -IF a$ = "8" THEN my2 = my2 - .1 -IF a$ = "-" THEN myyp = myyp + .01 -IF a$ = "+" THEN myyp = myyp - .01 -IF a$ = " " THEN myzp = myzp / 2: myxp = myxp / 2 - -END IF - -v = SQR(rx * rx + ry * ry + rz * rz) -s = SQR(rxp * rxp + ryp * ryp + rzp * rzp) - - -IF tmr$ <> TIME$ THEN -tmr$ = TIME$ - -LOCATE 29, 1 -PRINT "speed"; INT(s * 1000) -LOCATE 30, 1 -PRINT "fps"; frm3; "timeslice"; INT(ts * 1000); "distance"; v; -frm3 = frm2 -ts = 1 / frm3 -frm2 = 0 -addp -addl -END IF -GOTO 1 - -SUB addl -mitp = mitp + 1 -px(mitp) = rx -py(mitp) = ry -pz(mitp) = rz - -IF ale > 0 THEN -mitl = mitl + 1 -l1(mitl) = ale -l2(mitl) = mitp -lc(mitl) = 13 -END IF - -ale = mitp -END SUB - -SUB addp -'DIM SHARED mitp, mitl -mitp = mitp + 1 -px(mitp) = rx -py(mitp) = ry -pz(mitp) = rz - -mitp = mitp + 1 -px(mitp) = rx - .001 -py(mitp) = ry - .001 -pz(mitp) = rz - -mitp = mitp + 1 -px(mitp) = rx + .001 -py(mitp) = ry - .001 -pz(mitp) = rz - -mitl = mitl + 1 -l1(mitl) = mitp -l2(mitl) = mitp - 1 -lc(mitl) = 14 - -mitl = mitl + 1 -l1(mitl) = mitp - 2 -l2(mitl) = mitp - 1 -lc(mitl) = 14 - -mitl = mitl + 1 -l1(mitl) = mitp -l2(mitl) = mitp - 2 -lc(mitl) = 14 - - - -END SUB - -SUB n3d -s1 = SIN(my1) -c1 = COS(my1) - -s2 = SIN(my2) -c2 = COS(my2) - - -FOR a = 1 TO mitp -x = px(a) - myx -y = py(a) - myy -z = pz(a) - myz - -x1 = x * s1 + z * c1 -z1 = x * c1 - z * s1 - -y1 = z1 * s2 + y * c2 -z2 = z1 * c2 - y * s2 - -IF z2 < .00001 THEN -rpx(a) = -1 -ELSE -rpx(a) = x1 / z2 * 200 + 320 -rpy(a) = 240 - y1 / z2 * 200 -IF rpx(a) < -50 OR rpx(a) > 1000 OR rpy(a) < -50 OR rpy(a) > 1000 THEN rpx(a) = -1 -END IF -NEXT a - - - -FOR a = 1 TO mitl -p1 = l1(a) -p2 = l2(a) -x1 = rpx(p1) -y1 = rpy(p1) -x2 = rpx(p2) -y2 = rpy(p2) -IF ox1(a) = -1 OR ox2(a) = -1 THEN ELSE LINE (ox1(a), oy1(a))-(ox2(a), oy2(a)), 0 -IF x1 = -1 OR x2 = -1 THEN GOTO 2 -LINE (x1, y1)-(x2, y2), lc(a) -2 -ox1(a) = x1 -oy1(a) = y1 -ox2(a) = x2 -oy2(a) = y2 - -NEXT a - - -END SUB - -SUB start -SCREEN 12 -VIEW PRINT 1 TO 30 - -mk = 12714 -'mks = 250 -mks = 500 -rst = 4 -pi = 3.142657 -rs = .00002 -frm2 = 0 - -ale = -1 -px(1) = -.001 -py(1) = mk / 2 -pz(1) = -.001 - -px(2) = .001 -py(2) = mk / 2 -pz(2) = -.001 - -px(3) = .001 -py(3) = mk / 2 -pz(3) = .001 - -px(4) = -.001 -py(4) = mk / 2 -pz(4) = .001 - -mitp = 4 - -l1(1) = 1 -l2(1) = 2 -lc(1) = 14 - -l1(2) = 2 -l2(2) = 3 -lc(2) = 14 - -l1(3) = 3 -l2(3) = 4 -lc(3) = 14 - -l1(4) = 4 -l2(4) = 1 -lc(4) = 14 - -mitl = 4 - -myx = 0 -myy = mk * 2 -myz = -35 - -teemaa -myxp = 0 -myyp = 0 -myzp = 0 - -my1 = 0 - -rkb = mitp + 1 -teerock -rke = mitp - -rkm = rke - rkb + 1 -'DIM SHARED rkx(1 TO 1000) -'DIM SHARED rky(1 TO 1000) -'DIM SHARED rkz(1 TO 1000) - -FOR a = 1 TO rkm -p = rkb + a - 1 -rkx(a) = px(p) -rky(a) = py(p) -rkz(a) = pz(p) -NEXT a - - -END SUB - -SUB teemaa -tmpp = mitp -le2 = 0 - -FOR z = -(mk / 3) TO (mk / 3) STEP mks -le = 0 -le2 = le2 + 1 -FOR x = -(mk / 3) TO (mk / 3) STEP mks - - -IF SQR(x * x + z * z) > (mk / 2.5) THEN GOTO 4 -le = le + 1 -IF le = 1 THEN xs = (x / mks) -mitp = mitp + 1 -px(mitp) = x -v = SQR(x * x + z * z) -py(mitp) = SQR((v + (mk / 2)) * ((mk / 2) - v)) -pz(mitp) = z -IF le > 1 THEN -mitl = mitl + 1 -l1(mitl) = mitp -l2(mitl) = mitp - 1 -lc(mitl) = 3 -END IF - -IF le2 > 1 THEN -IF xso > (x / mks) THEN GOTO 4 -IF xso + leo <= (x / mks) THEN GOTO 4 - -mitl = mitl + 1 -l1(mitl) = mitp -l2(mitl) = mitp - leo - xso + xs -lc(mitl) = 3 -END IF -4 - -NEXT x -leo = le -xso = xs -NEXT z - -END SUB - -SUB teerock - - -s = 50 -FOR y = -9 TO 10 STEP rst -st = pi * 2 / 6 -IF y > 5 THEN s = s - 3 -IF y > 8 THEN s = s - 6 -FOR a = 0 TO pi * 2 STEP st -x1 = SIN(a) * s -z1 = COS(a) * s -'DIM SHARED mitp, mitl -'DIM SHARED px(1 TO 4000) -'DIM SHARED py(1 TO 4000) -'DIM SHARED pz(1 TO 4000) -'DIM SHARED l1(1 TO 7000) -'DIM SHARED l2(1 TO 7000) -'DIM SHARED lc(1 TO 7000) - -mitp = mitp + 1 -px(mitp) = x1 * rs -py(mitp) = y * 50 * rs -pz(mitp) = z1 * rs - -IF a > 0 THEN -mitl = mitl + 1 -l1(mitl) = mitp -l2(mitl) = mitp - 1 -lc(mitl) = 10 -END IF - -IF y > -9 THEN -mitl = mitl + 1 -l1(mitl) = mitp -l2(mitl) = mitp - 7 -lc(mitl) = 10 -END IF - -NEXT a -NEXT y - -mitp = mitp + 1 -px(mitp) = 0 -py(mitp) = 11 * 50 * rs -pz(mitp) = 0 - - -FOR a = 1 TO 6 -mitl = mitl + 1 -l1(mitl) = mitp -l2(mitl) = mitp - a -lc(mitl) = 10 -NEXT a - -mitp = mitp + 1 -px(mitp) = -100 * rs -py(mitp) = -450 * rs -pz(mitp) = 0 - -mitp = mitp + 1 -px(mitp) = 100 * rs -py(mitp) = -450 * rs -pz(mitp) = 0 - -mitp = mitp + 1 -px(mitp) = 0 -py(mitp) = -200 * rs -pz(mitp) = 0 - -mitl = mitl + 1 -l1(mitl) = mitp -l2(mitl) = mitp - 1 -lc(mitl) = 12 - -mitl = mitl + 1 -l1(mitl) = mitp - 2 -l2(mitl) = mitp - 1 -lc(mitl) = 12 - -mitl = mitl + 1 -l1(mitl) = mitp -l2(mitl) = mitp - 2 -lc(mitl) = 12 - - - -mitp = mitp + 1 -px(mitp) = 0 -py(mitp) = -450 * rs -pz(mitp) = -100 * rs - -mitp = mitp + 1 -px(mitp) = 0 -py(mitp) = -450 * rs -pz(mitp) = 100 * rs - - -mitl = mitl + 1 -l1(mitl) = mitp -l2(mitl) = mitp - 1 -lc(mitl) = 12 - -mitl = mitl + 1 -l1(mitl) = mitp - 2 -l2(mitl) = mitp - 1 -lc(mitl) = 12 - -mitl = mitl + 1 -l1(mitl) = mitp -l2(mitl) = mitp - 2 -lc(mitl) = 12 - - -END SUB - +' 3D rocket simulator. Rocket takes off from the surface of the planet. +' made by Svjatoslav Agejenko +' in 2001 +' H-Page: svjatoslav.eu +' E-Mail: svjatoslav@svjatoslav.eu + +' arrow keys - move around +' 2, 6, 4, 8 - look around +' - - fly up +' + - fly down + +DECLARE SUB addp () +DECLARE SUB addl () +DEFDBL A-Z +DECLARE SUB teerock () +DECLARE SUB teemaa () +DECLARE SUB start () +DECLARE SUB n3d () + +DIM SHARED px(1 TO 1500) +DIM SHARED py(1 TO 1500) +DIM SHARED pz(1 TO 1500) + +DIM SHARED l1(1 TO 3000) +DIM SHARED l2(1 TO 3000) +DIM SHARED lc(1 TO 3000) + +DIM SHARED rpx(1 TO 1900) +DIM SHARED rpy(1 TO 1900) + +DIM SHARED rkx(1 TO 200) +DIM SHARED rky(1 TO 200) +DIM SHARED rkz(1 TO 200) + +DIM SHARED mitp, mitl +DIM SHARED myx, myy, myz +DIM SHARED myxp, myyp, myzp +DIM SHARED my1, my2 + +DIM SHARED ox1(1 TO 2500) +DIM SHARED oy1(1 TO 2500) +DIM SHARED ox2(1 TO 2500) +DIM SHARED oy2(1 TO 2500) +DIM SHARED frm, frm2, frm3 + +DIM SHARED mk, mks, rs, rst +DIM SHARED pi +DIM SHARED rkb, rke, rkm +DIM SHARED rx, ry, rz, rxp, ryp, rzp + +DIM SHARED tmr$, ts +DIM SHARED ale + +start +my1 = -pi / 2 + +' Initialize the rocket position and velocity +rx = 0 +ry = mk / 2 + .009 +rz = 0 + +myx = 0 +myy = mk / 2 +myz = -.05 + +ts = 0 +frm2 = 999999 +tmr$ = TIME$ +1 +frm = frm + 1 +frm2 = frm2 + 1 + +' Display the current values of some variables +LOCATE 1, 1 +PRINT mitp, mitl, mk, mks +LOCATE 2, 1 +PRINT rkb, rke, TIMER + +' Update rocket position and velocity +rx = rx + (rxp * ts) +ry = ry + (ryp * ts) +rz = rz + (rzp * ts) + +' Update the rocket's pitch and roll rates +ryp = ryp + (.0098 * ts) +rxp = SIN(frm / 20) / 50 + +' Update the points that make up the rocket +FOR a = 1 TO rkm + px(a + rkb - 1) = rkx(a) + rx + py(a + rkb - 1) = rky(a) + ry + pz(a + rkb - 1) = rkz(a) + rz +NEXT a + +' Update the observer position and velocity +myx = myx + (myxp * ts) +myy = myy + (myyp * ts) +myz = myz + (myzp * ts) + +' Draw the 3D scene +n3d + +' Handle user input +a$ = INKEY$ +IF a$ <> "" THEN + IF a$ = CHR$(0) + "H" THEN + ' Move forward + myzp = myzp - SIN(my1) / 100 + myxp = myxp + COS(my1) / 100 + END IF + IF a$ = CHR$(0) + "P" THEN + ' Move backward + myzp = myzp + SIN(my1) / 100 + myxp = myxp - COS(my1) / 100 + END IF + IF a$ = CHR$(0) + "M" THEN + ' Move right + myzp = myzp + COS(my1) / 100 + myxp = myxp + SIN(my1) / 100 + END IF + IF a$ = CHR$(0) + "K" THEN + ' Move left + myzp = myzp - COS(my1) / 100 + myxp = myxp - SIN(my1) / 100 + END IF + + ' Change the viewing angle + IF a$ = CHR$(27) THEN SYSTEM + IF a$ = "4" THEN my1 = my1 + .1 + IF a$ = "6" THEN my1 = my1 - .1 + IF a$ = "2" THEN my2 = my2 + .1 + IF a$ = "8" THEN my2 = my2 - .1 + IF a$ = "-" THEN myyp = myyp + .01 + IF a$ = "+" THEN myyp = myyp - .01 + IF a$ = " " THEN myzp = myzp / 2: myxp = myxp / 2 +END IF + +' Calculate the speed and distance of the rocket +v = SQR(rx * rx + ry * ry + rz * rz) +s = SQR(rxp * rxp + ryp * ryp + rzp * rzp) + +' Display the current frame rate and other information +IF tmr$ <> TIME$ THEN + tmr$ = TIME$ + + LOCATE 29, 1 + PRINT "speed"; INT(s * 1000) + LOCATE 30, 1 + PRINT "fps"; frm3; "timeslice"; INT(ts * 1000); "distance"; v; + + ' Update the frame rate and time slice + frm3 = frm2 + ts = 1 / frm3 + frm2 = 0 + + ' Add new points to the scene + addp + addl +END IF +GOTO 1 + +SUB addl +mitp = mitp + 1 +px(mitp) = rx +py(mitp) = ry +pz(mitp) = rz + +IF ale > 0 THEN + mitl = mitl + 1 + l1(mitl) = ale + l2(mitl) = mitp + lc(mitl) = 13 +END IF + +ale = mitp +END SUB + +SUB addp +' Add new points to the scene +mitp = mitp + 1 +px(mitp) = rx +py(mitp) = ry +pz(mitp) = rz + +mitp = mitp + 1 +px(mitp) = rx - .001 +py(mitp) = ry - .001 +pz(mitp) = rz + +mitp = mitp + 1 +px(mitp) = rx + .001 +py(mitp) = ry - .001 +pz(mitp) = rz + +mitl = mitl + 1 +l1(mitl) = mitp +l2(mitl) = mitp - 1 +lc(mitl) = 14 + +mitl = mitl + 1 +l1(mitl) = mitp - 2 +l2(mitl) = mitp - 1 +lc(mitl) = 14 + +mitl = mitl + 1 +l1(mitl) = mitp +l2(mitl) = mitp - 2 +lc(mitl) = 14 + +END SUB + +SUB n3d +' Convert the 3D points to 2D for drawing +s1 = SIN(my1) +c1 = COS(my1) + +s2 = SIN(my2) +c2 = COS(my2) + +FOR a = 1 TO mitp + x = px(a) - myx + y = py(a) - myy + z = pz(a) - myz + + ' Apply the rotation transformations + x1 = x * s1 + z * c1 + z1 = x * c1 - z * s1 + + y1 = z1 * s2 + y * c2 + z2 = z1 * c2 - y * s2 + + ' Project the 3D point to 2D + IF z2 < .00001 THEN + rpx(a) = -1 + ELSE + rpx(a) = x1 / z2 * 200 + 320 + rpy(a) = 240 - y1 / z2 * 200 + + ' Check if the point is within the screen boundaries + IF rpx(a) < -50 OR rpx(a) > 1000 OR rpy(a) > 1000 THEN + rpx(a) = -1 + END IF + END IF +NEXT a + +' Draw the lines that make up the rocket +FOR a = 1 TO mitl + p1 = l1(a) + p2 = l2(a) + x1 = rpx(p1) + y1 = rpy(p1) + x2 = rpx(p2) + y2 = rpy(p2) + + ' Check if the line is within the screen boundaries. + ' If so, erase line at old locations + IF ox1(a) = -1 OR ox2(a) = -1 THEN + ELSE + LINE (ox1(a), oy1(a))-(ox2(a), oy2(a)), 0 + END IF + + ' Draw the line if both endpoints are within the screen boundaries + IF x1 <> -1 AND x2 <> -1 THEN + LINE (x1, y1)-(x2, y2), lc(a) + END IF + + ' Update the old endpoints of the line for the next frame + ox1(a) = x1 + oy1(a) = y1 + ox2(a) = x2 + oy2(a) = y2 +NEXT a + +END SUB + +SUB start +' Initialize the graphics mode and set up the scene +SCREEN 12 +VIEW PRINT 1 TO 30 + +mk = 12714 +mks = 500 +rst = 4 +pi = 3.142657 +rs = .00002 +frm2 = 0 + +ale = -1 +px(1) = -.001 +py(1) = mk / 2 +pz(1) = -.001 + +px(2) = .001 +py(2) = mk / 2 +pz(2) = -.001 + +px(3) = .001 +py(3) = mk / 2 +pz(3) = .001 + +px(4) = -.001 +py(4) = mk / 2 +pz(4) = .001 + +mitp = 4 + +' Set up the initial lines that make up the rocket +l1(1) = 1 +l2(1) = 2 +lc(1) = 14 + +l1(2) = 2 +l2(2) = 3 +lc(2) = 14 + +l1(3) = 3 +l2(3) = 4 +lc(3) = 14 + +l1(4) = 4 +l2(4) = 1 +lc(4) = 14 + +mitl = 4 + +' Initialize the observer position and velocity +myx = 0 +myy = mk * 2 +myz = -35 + +teemaa +myxp = 0 +myyp = 0 +myzp = 0 + +my1 = 0 + +rkb = mitp + 1 +teerock +rke = mitp + +' Calculate the number of points that make up the rocket +rkm = rke - rkb + 1 + +' Copy the initial points to the arrays for the rocket +FOR a = 1 TO rkm + p = rkb + a - 1 + rkx(a) = px(p) + rky(a) = py(p) + rkz(a) = pz(p) +NEXT a + +END SUB + +SUB teemaa +' Generate the points that make up the earth +tmpp = mitp +le2 = 0 + +FOR z = -(mk / 3) TO (mk / 3) STEP mks + le = 0 + le2 = le2 + 1 + + FOR x = -(mk / 3) TO (mk / 3) STEP mks + ' Check if the point is within the rocket's radius + IF SQR(x * x + z * z) > (mk / 2.5) THEN GOTO 4 + + le = le + 1 + + ' Add the first point of the line + IF le = 1 THEN + xs = x / mks + END IF + + mitp = mitp + 1 + px(mitp) = x + v = SQR(x * x + z * z) + py(mitp) = SQR((v + (mk / 2)) * ((mk / 2) - v)) + pz(mitp) = z + + ' Add the line to the list of lines + IF le > 1 THEN + mitl = mitl + 1 + l1(mitl) = mitp + l2(mitl) = mitp - 1 + lc(mitl) = 3 + END IF + + ' Add the line to the list of lines if it is part of a circle + IF le2 > 1 THEN + IF xso > (x / mks) THEN GOTO 4 + IF xso + leo <= (x / mks) THEN GOTO 4 + + mitl = mitl + 1 + l1(mitl) = mitp + l2(mitl) = mitp - leo - xso + xs + lc(mitl) = 3 + END IF + + 4 + NEXT x + + ' Update the variables for the next circle + leo = le + xso = xs +NEXT z + +END SUB + +SUB teerock +' Generate the points that make up the rocket +s = 50 + +FOR y = -9 TO 10 STEP rst + st = pi * 2 / 6 + + IF y > 5 THEN + s = s - 3 + END IF + + IF y > 8 THEN + s = s - 6 + END IF + + FOR a = 0 TO pi * 2 STEP st + x1 = SIN(a) * s + z1 = COS(a) * s + + mitp = mitp + 1 + px(mitp) = x1 * rs + py(mitp) = y * 50 * rs + pz(mitp) = z1 * rs + + ' Add the line to the list of lines + IF a > 0 THEN + mitl = mitl + 1 + l1(mitl) = mitp + l2(mitl) = mitp - 1 + lc(mitl) = 10 + END IF + + ' Add the line to the list of lines if it is part of a circle + IF y > -9 THEN + mitl = mitl + 1 + l1(mitl) = mitp + l2(mitl) = mitp - 7 + lc(mitl) = 10 + END IF + + NEXT a +NEXT y + +' Add the points that make up the top of the rocket +mitp = mitp + 1 +px(mitp) = 0 +py(mitp) = 11 * 50 * rs +pz(mitp) = 0 + +FOR a = 1 TO 6 + mitl = mitl + 1 + l1(mitl) = mitp + l2(mitl) = mitp - a + lc(mitl) = 10 +NEXT a + +' Add the points that make up the bottom of the rocket +mitp = mitp + 1 +px(mitp) = -100 * rs +py(mitp) = -450 * rs +pz(mitp) = 0 + +mitp = mitp + 1 +px(mitp) = 100 * rs +py(mitp) = -450 * rs +pz(mitp) = 0 + +mitp = mitp + 1 +px(mitp) = 0 +py(mitp) = -200 * rs +pz(mitp) = 0 + +mitl = mitl + 1 +l1(mitl) = mitp +l2(mitl) = mitp - 1 +lc(mitl) = 12 + +mitl = mitl + 1 +l1(mitl) = mitp - 2 +l2(mitl) = mitp - 1 +lc(mitl) = 12 + +mitl = mitl + 1 +l1(mitl) = mitp +l2(mitl) = mitp - 2 +lc(mitl) = 12 + + + +mitp = mitp + 1 +px(mitp) = 0 +py(mitp) = -450 * rs +pz(mitp) = -100 * rs + +mitp = mitp + 1 +px(mitp) = 0 +py(mitp) = -450 * rs +pz(mitp) = 100 * rs + + +mitl = mitl + 1 +l1(mitl) = mitp +l2(mitl) = mitp - 1 +lc(mitl) = 12 + +mitl = mitl + 1 +l1(mitl) = mitp - 2 +l2(mitl) = mitp - 1 +lc(mitl) = 12 + +mitl = mitl + 1 +l1(mitl) = mitp +l2(mitl) = mitp - 2 +lc(mitl) = 12 + +END SUB