From 8ab70c739e68071304b13a629ac083b369eebdeb Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 22 Sep 2003 07:43:13 +0000 Subject: remove LF and add $ --- stern.bas | 229 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 115 insertions(+), 114 deletions(-) (limited to 'stern.bas') diff --git a/stern.bas b/stern.bas index 4c3da70..ee19d1b 100644 --- a/stern.bas +++ b/stern.bas @@ -1,114 +1,115 @@ -'STERN.BAS 29.04.1996 - -DECLARE SUB InitProgram () -DECLARE SUB MainLoop () -DECLARE SUB Calc3D () -DECLARE SUB Rotation () -DECLARE SUB DrawObject () - -DIM SHARED Lines, World(500, 3) -DIM SHARED X, Y, Z, sX, sY, Xa, Ya, Za, sXs, sYs, D -DIM SHARED R1, R2, R3, Sr1, Sr2, Sr3, Cr1, Cr2, Cr3, mX, mY, mZ - - READ Lines - FOR i = 1 TO Lines - FOR J = 1 TO 3 - READ World(i, J) - NEXT - NEXT - - InitProgram - MainLoop - SCREEN 0 -END - -DATA 72 -DATA 90, 0, 0, 10, 10, 10, 90, 0, 0, 10, 10,-10 -DATA 90, 0, 0, 10,-10,-10, 90, 0, 0, 10,-10, 10 -DATA -90, 0, 0, -10, 10, 10, -90, 0, 0, -10, 10,-10 -DATA -90, 0, 0, -10,-10,-10, -90, 0, 0, -10,-10, 10 -DATA 0, 90, 0, 10, 10, 10, 0, 90, 0, -10, 10, 10 -DATA 0, 90, 0, -10, 10,-10, 0, 90, 0, 10, 10,-10 -DATA 0,-90, 0, 10,-10, 10, 0,-90, 0, -10,-10, 10 -DATA 0,-90, 0, -10,-10,-10, 0,-90, 0, 10,-10,-10 -DATA 0, 0, 90, 10, 10, 10, 0, 0, 90, 10,-10, 10 -DATA 0, 0, 90, -10,-10, 10, 0, 0, 90, -10, 10, 10 -DATA 0, 0,-90, 10, 10,-10, 0, 0,-90, 10,-10,-10 -DATA 0, 0,-90, -10,-10,-10, 0, 0,-90, -10, 10,-10 -DATA 10, 10, 10, -10, 10, 10, 10,-10, 10, -10,-10, 10 -DATA 10, 10,-10, -10, 10,-10, 10,-10,-10, -10,-10,-10 -DATA 10, 10, 10, 10,-10, 10, -10, 10, 10, -10,-10, 10 -DATA 10, 10,-10, 10,-10,-10, -10, 10,-10, -10,-10,-10 -DATA 10, 10, 10, 10, 10,-10, 10,-10, 10, 10,-10,-10 -DATA -10,-10, 10, -10,-10,-10, -10, 10, 10, -10, 10,-10 - -SUB Calc3D - X = -1 * X - Xa = Cr1 * X - Sr1 * Z - Za = Sr1 * X + Cr1 * Z - X = Cr2 * Xa + Sr2 * Y - Ya = Cr2 * Y - Sr2 * Xa - Z = Cr3 * Za - Sr3 * Ya - Y = Sr3 * Za + Cr3 * Ya - X = X + mX - Y = Y + mY - Z = Z + mZ - sX = D * X / Z - sY = D * Y / Z -END SUB - -SUB DrawObject - Rotation - FOR i = 1 TO Lines STEP 2 - X = World(i, 1) - Y = World(i, 2) - Z = World(i, 3) - Calc3D - sXs = sX: sYs = sY - - X = World(i + 1, 1) - Y = World(i + 1, 2) - Z = World(i + 1, 3) - Calc3D - - LINE (sXs, sYs)-(sX, sY), 15 - NEXT -END SUB - -SUB InitProgram - SCREEN 9, 1, 0, 1 - WINDOW (-320, -175)-(320, 175) - CLS 'PAGE 0 - - SCREEN 9, 1, 1, 0 - CLS 'PAGE 1 - - D = 1200 'View point and rotation values - mZ = -850 - mX = -5 - R1 = 0 - R2 = 0 - R3 = .3 -END SUB - -SUB MainLoop - WHILE INKEY$ = "" - R1 = R1 + .1: IF R1 > 6.28 THEN R1 = 0 - R2 = R1: R3 = R1 - - WAIT 986, 8 - CLS : DrawObject - Page = ABS(Page = 0) 'Page switching is used to hide the drawing - SCREEN 9, 1, 1 - Page, Page 'process so the image looks smooth. - WEND -END SUB - -SUB Rotation - Sr1 = SIN(R1) - Sr2 = SIN(R2) - Sr3 = SIN(R3) - Cr1 = COS(R1) - Cr2 = COS(R2) - Cr3 = COS(R3) -END SUB - +'$Id$ +'STERN.BAS 29.04.1996 + +DECLARE SUB InitProgram () +DECLARE SUB MainLoop () +DECLARE SUB Calc3D () +DECLARE SUB Rotation () +DECLARE SUB DrawObject () + +DIM SHARED Lines, World(500, 3) +DIM SHARED X, Y, Z, sX, sY, Xa, Ya, Za, sXs, sYs, D +DIM SHARED R1, R2, R3, Sr1, Sr2, Sr3, Cr1, Cr2, Cr3, mX, mY, mZ + + READ Lines + FOR i = 1 TO Lines + FOR J = 1 TO 3 + READ World(i, J) + NEXT + NEXT + + InitProgram + MainLoop + SCREEN 0 +END + +DATA 72 +DATA 90, 0, 0, 10, 10, 10, 90, 0, 0, 10, 10,-10 +DATA 90, 0, 0, 10,-10,-10, 90, 0, 0, 10,-10, 10 +DATA -90, 0, 0, -10, 10, 10, -90, 0, 0, -10, 10,-10 +DATA -90, 0, 0, -10,-10,-10, -90, 0, 0, -10,-10, 10 +DATA 0, 90, 0, 10, 10, 10, 0, 90, 0, -10, 10, 10 +DATA 0, 90, 0, -10, 10,-10, 0, 90, 0, 10, 10,-10 +DATA 0,-90, 0, 10,-10, 10, 0,-90, 0, -10,-10, 10 +DATA 0,-90, 0, -10,-10,-10, 0,-90, 0, 10,-10,-10 +DATA 0, 0, 90, 10, 10, 10, 0, 0, 90, 10,-10, 10 +DATA 0, 0, 90, -10,-10, 10, 0, 0, 90, -10, 10, 10 +DATA 0, 0,-90, 10, 10,-10, 0, 0,-90, 10,-10,-10 +DATA 0, 0,-90, -10,-10,-10, 0, 0,-90, -10, 10,-10 +DATA 10, 10, 10, -10, 10, 10, 10,-10, 10, -10,-10, 10 +DATA 10, 10,-10, -10, 10,-10, 10,-10,-10, -10,-10,-10 +DATA 10, 10, 10, 10,-10, 10, -10, 10, 10, -10,-10, 10 +DATA 10, 10,-10, 10,-10,-10, -10, 10,-10, -10,-10,-10 +DATA 10, 10, 10, 10, 10,-10, 10,-10, 10, 10,-10,-10 +DATA -10,-10, 10, -10,-10,-10, -10, 10, 10, -10, 10,-10 + +SUB Calc3D + X = -1 * X + Xa = Cr1 * X - Sr1 * Z + Za = Sr1 * X + Cr1 * Z + X = Cr2 * Xa + Sr2 * Y + Ya = Cr2 * Y - Sr2 * Xa + Z = Cr3 * Za - Sr3 * Ya + Y = Sr3 * Za + Cr3 * Ya + X = X + mX + Y = Y + mY + Z = Z + mZ + sX = D * X / Z + sY = D * Y / Z +END SUB + +SUB DrawObject + Rotation + FOR i = 1 TO Lines STEP 2 + X = World(i, 1) + Y = World(i, 2) + Z = World(i, 3) + Calc3D + sXs = sX: sYs = sY + + X = World(i + 1, 1) + Y = World(i + 1, 2) + Z = World(i + 1, 3) + Calc3D + + LINE (sXs, sYs)-(sX, sY), 15 + NEXT +END SUB + +SUB InitProgram + SCREEN 9, 1, 0, 1 + WINDOW (-320, -175)-(320, 175) + CLS 'PAGE 0 + + SCREEN 9, 1, 1, 0 + CLS 'PAGE 1 + + D = 1200 'View point and rotation values + mZ = -850 + mX = -5 + R1 = 0 + R2 = 0 + R3 = .3 +END SUB + +SUB MainLoop + WHILE INKEY$ = "" + R1 = R1 + .1: IF R1 > 6.28 THEN R1 = 0 + R2 = R1: R3 = R1 + + WAIT 986, 8 + CLS : DrawObject + Page = ABS(Page = 0) 'Page switching is used to hide the drawing + SCREEN 9, 1, 1 - Page, Page 'process so the image looks smooth. + WEND +END SUB + +SUB Rotation + Sr1 = SIN(R1) + Sr2 = SIN(R2) + Sr3 = SIN(R3) + Cr1 = COS(R1) + Cr2 = COS(R2) + Cr3 = COS(R3) +END SUB + -- cgit v1.2.3