DECLARE SUB nait3d ()
DECLARE SUB calcsin ()
DEFINT A-Y
-DIM SHARED xn(1000), yn(1000), czn(1000) ' original points
-DIM SHARED x(1000), y(1000), cz(1000) ' Rotated points
+DIM SHARED xn(1000), yn(1000), czn(1000) ' points transformed to on-screen coordinates
+DIM SHARED pointX(1000), pointY(1000), pointZ(1000) ' points in 3D space
DIM SHARED Xs1(1000), Ys1(1000), Xe1(1000), Ye1(1000) ' Old rotated points
DIM SHARED pointers1(1000), pointers2(1000) ' Connected points
DIM SHARED cosine&(360), sine&(360) ' SIN & COS table
SUB getcor
' Loading original points and connected points
FOR a = 0 TO 10000
- READ x(a), y(a), cz(a)
- IF x(a) = 999 THEN x(a) = 0: y(a) = 0: cz(a) = 0: GOTO 1
+ READ pointX(a), pointY(a), pointZ(a)
+ IF pointX(a) = 999 THEN pointX(a) = 0: pointY(a) = 0: pointZ(a) = 0: GOTO 1
NEXT
1
np = a
' Rotating points
FOR a = 0 TO np - 1
- x1 = x(a) + myx
- y1 = y(a) + myz
- pz1 = cz(a) + myy
+ x1 = pointX(a) + myx
+ y1 = pointY(a) + myz
+ pz1 = pointZ(a) + myy
' Applying rotation matrix
x2 = (x1 * c1& - pz1 * s1&) \ 1024
b = smes
FOR a = TracksBeginp TO TracksBeginp + 48 STEP 2
- x(a) = Tracksx(b) - Tracksxp
- y(a) = Tracksy(b)
- cz(a) = 50
- x(a + 1) = Tracksx(b) - Tracksxp
- y(a + 1) = Tracksy(b)
- cz(a + 1) = 30
+ pointX(a) = Tracksx(b) - Tracksxp
+ pointY(a) = Tracksy(b)
+ pointZ(a) = 50
+ pointX(a + 1) = Tracksx(b) - Tracksxp
+ pointY(a + 1) = Tracksy(b)
+ pointZ(a + 1) = 30
b = b + 15
NEXT a
b = smes
FOR a = TracksBeginp + 48 TO TracksBeginp + 94 STEP 2
- x(a) = Tracksx(b) - Tracksxp
- y(a) = Tracksy(b)
- cz(a) = -50
- x(a + 1) = Tracksx(b) - Tracksxp
- y(a + 1) = Tracksy(b)
- cz(a + 1) = -30
+ pointX(a) = Tracksx(b) - Tracksxp
+ pointY(a) = Tracksy(b)
+ pointZ(a) = -50
+ pointX(a + 1) = Tracksx(b) - Tracksxp
+ pointY(a + 1) = Tracksy(b)
+ pointZ(a + 1) = -30
b = b + 15
NEXT a
REM Moving the tank
FOR a = 0 TO 84
- x(a) = x(a) - ssu
+ pointX(a) = pointX(a) - ssu
NEXT a
-IF x(84) > 0 THEN ssu = 1
-IF x(83) < -400 THEN ssu = -1
+IF pointX(84) > 0 THEN ssu = 1
+IF pointX(83) < -400 THEN ssu = -1
END SUB
BridgeBeginp = np
5
-READ x(np), y(np), cz(np)
-IF x(np) = 999 THEN x(np) = 0: y(np) = 0: cz(np) = 0: GOTO 3
+READ pointX(np), pointY(np), pointZ(np)
+IF pointX(np) = 999 THEN pointX(np) = 0: pointY(np) = 0: pointZ(np) = 0: GOTO 3
np = np + 1
GOTO 5