From: Svjatoslav Agejenko Date: Mon, 28 Jul 2025 00:41:43 +0000 (+0300) Subject: initial commit X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=92913ff8b74e684c3ca6f4bd428ed036c63e6d57;p=qbasicapps.git initial commit --- 92913ff8b74e684c3ca6f4bd428ed036c63e6d57 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..17a01d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +/qbasicapps.iml +/.idea/ +/VC.COM +/VC.INI +/QB45 +/index.html +/Graphics/3D/3D Synthezier/doc/index.html +/Math/Truth table calculator/doc/index.html +/Graphics/Spirals/index.html +/Graphics/index.html +/2D GFX/Animations/index.html +/3D GFX/3D Synthezier/index.html \ No newline at end of file diff --git a/.project b/.project new file mode 100755 index 0000000..3e5d85f --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + QBasicApps + + + + + + + + diff --git a/2D GFX/Animations/2D rotation.bas b/2D GFX/Animations/2D rotation.bas new file mode 100755 index 0000000..f7e3af4 --- /dev/null +++ b/2D GFX/Animations/2D rotation.bas @@ -0,0 +1,64 @@ +' This program showcases the rotation of points on an X-Y coordinate +' system using trigonometric functions, specifically sine and cosine. By +' simulating the effect of rotating a collection of grid points around +' the origin, it demonstrates the mathematical principles behind 2D +' rotation. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2003.12, Initial version +' 2024, Improved program readability + +DIM SHARED pointXCoordinates(1000) ' Array to store x coordinates of points +DIM SHARED pointYCoordinates(1000) ' Array to store y coordinates of points +DIM SHARED oldPointXCoordinates(1000) ' Array to store previous x coordinates of points +DIM SHARED oldPointYCoordinates(1000) ' Array to store previous y coordinates of points + +SCREEN 13 + +numPoints = 0 ' Initialize the number of points +FOR pointXVal = -10 TO 10 + FOR pointYVal = -10 TO 10 + numPoints = numPoints + 1 + pointXCoordinates(numPoints) = pointXVal + pointYCoordinates(numPoints) = pointYVal + NEXT pointYVal +NEXT pointXVal + +' Main rotation loop +rotationAngle = 0 ' Initialize the rotation angle to 0 + +1 + rotationAngle = rotationAngle + .01 ' Increment the rotation angle by 0.01 radians + + ' Calculate the sine and cosine of the current rotation angle + sineOfRotationAngle = SIN(rotationAngle) + cosineOfRotationAngle = COS(rotationAngle) + + FOR pointIndex = 1 TO numPoints + PSET (oldPointXCoordinates(pointIndex), oldPointYCoordinates(pointIndex)), 0 ' Clear the previous position + + xCoordinate = pointXCoordinates(pointIndex) + yCoordinate = pointYCoordinates(pointIndex) + + ' Calculate the new x and y coordinate after rotation + newXCoordinate = xCoordinate * sineOfRotationAngle + yCoordinate * cosineOfRotationAngle + newYCoordinate = xCoordinate * cosineOfRotationAngle - yCoordinate * sineOfRotationAngle + + ' Scale and translate the new x and y coordinates to the center of the screen + newXCoordinate = newXCoordinate * 7 + 160 + newYCoordinate = newYCoordinate * 7 + 100 + + ' Store x and y on-screen coordinates for clearing on next iteration + oldPointXCoordinates(pointIndex) = newXCoordinate + oldPointYCoordinates(pointIndex) = newYCoordinate + + PSET (newXCoordinate, newYCoordinate), 15 ' Draw the point at the new position + NEXT pointIndex + +IF INKEY$ = "" THEN GOTO 1 ' Continue rotating if no key is pressed + diff --git a/2D GFX/Animations/2D rotation.webm b/2D GFX/Animations/2D rotation.webm new file mode 100644 index 0000000..d3384d3 Binary files /dev/null and b/2D GFX/Animations/2D rotation.webm differ diff --git a/2D GFX/Animations/Bump mapping.bas b/2D GFX/Animations/Bump mapping.bas new file mode 100755 index 0000000..ba65e7d --- /dev/null +++ b/2D GFX/Animations/Bump mapping.bas @@ -0,0 +1,133 @@ +DECLARE SUB paintSurface () +' Program renders bump mapping animation where light source moves around. +' Based on light source location, different parts of the surface become illuminated. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko.' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' ?, Initial version +' 2024, Improved program readability + +DECLARE SUB makeSurface () +DECLARE SUB animate () +DECLARE SUB makeDot (x!, y!) +DECLARE SUB paintImage () +SCREEN 13 + +' surface height map +DIM SHARED imgHeight(0 TO 50, 0 TO 50) + +PAINT (0, 0), 1 + +makeSurface +paintSurface +animate + +SUB animate + + frame = 0 +1 + ' Increment the frame counter + frame = frame + 5 + + ' Calculate light position based on sine functions + lightX = SIN(frame / 100) * 20 + 25 + lightY = SIN(frame / 71.32) * 20 + 25 + lightX = lightX + SIN(frame / 34) * 10 + lightY = lightY + SIN(frame / 45) * 10 + + ' Calculate brightness for each pixel based on distance and angle from light + FOR y = 2 TO 48 + FOR x = 2 TO 48 + distance = SQR((x - lightX) ^ 2 + (y - lightY) ^ 2) + brightness = (30 - distance) / 4 + + ' Calculate surface inclination relative to light location + value = imgHeight(x - 1, y) - imgHeight(x, y) + brightnessX = (lightX - x) * value + + value = imgHeight(x, y - 1) - imgHeight(x, y) + brightnessY = (lightY - y) * value + + brightness = brightness + (brightnessX + brightnessY) / (distance / 2) + + ' Clamp brightness within valid range + IF brightness < 0 THEN brightness = 0 + IF brightness > 15 THEN brightness = 15 + + ' Set pixel color based on brightness + PSET (x + 150, y), 16 + brightness + NEXT x + NEXT y + + ' Draw light source as a circle + CIRCLE (lightX + 150, lightY), 2, 12 + + + ' Loop back to the start of animation until + ' no key has been pressed by the user. + IF INKEY$ = "" THEN GOTO 1 + +END SUB + +' Current subroutine creates somewhat fat round dot. +' Center of the dot is fully elevated. +' There is smooth drop-off in elevation from the center. +SUB makeDot (x, y) + + FOR x1 = -10 TO 10 + FOR y1 = -10 TO 10 + distanceFromCenter = SQR(x1 * x1 + y1 * y1) + height = 4 - distanceFromCenter + IF height < 0 THEN height = 0 + + ' Calculate image coordinates + imgX = x1 + x + imgY = y1 + y + + ' Ensure coordinates are within bounds + IF imgX < 0 THEN imgX = 0 + IF imgY < 0 THEN imgY = 0 + IF imgX > 50 THEN imgX = 50 + IF imgY > 50 THEN imgY = 50 + + ' Add power to the height map + imgHeight(imgX, imgY) = imgHeight(imgX, imgY) + height + NEXT y1 + NEXT x1 + +END SUB + +SUB makeSurface + + ' Generate random dots on the surface + FOR x = 0 TO 10 + CALL makeDot(RND * 50, RND * 50) + NEXT x + + ' Add some lines composed from dots + FOR x = 0 TO 45 STEP 2 + CALL makeDot(x, x / 2 + 5) + NEXT x + + FOR x = 5 TO 30 STEP 2 + CALL makeDot(x, -x / 1.2 + 30) + NEXT x + +END SUB + +SUB paintSurface + + ' Paint the image based on height map + FOR x = 0 TO 50 + FOR y = 0 TO 50 + clr = imgHeight(x, y) + 16 + PSET (x, y), clr + NEXT y + NEXT x + +END SUB + diff --git a/2D GFX/Animations/Bump mapping.webm b/2D GFX/Animations/Bump mapping.webm new file mode 100644 index 0000000..4bf57e0 Binary files /dev/null and b/2D GFX/Animations/Bump mapping.webm differ diff --git a/2D GFX/Animations/DNA.bas b/2D GFX/Animations/DNA.bas new file mode 100755 index 0000000..4d9237d --- /dev/null +++ b/2D GFX/Animations/DNA.bas @@ -0,0 +1,76 @@ +' Program to render animated DNA as seen in the movies. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' ?, Initial version +' 2024, Improved program readability + +DIM SHARED xCoordinates(1 TO 100) +DIM SHARED yCoordinates(1 TO 100) +DIM SHARED zCoordinates(1 TO 100) +DIM SHARED colorCodes(1 TO 100) + +SCREEN 7, , , 1 + +1: +b = 0 +rotationAngle = rotationAngle + 0.1 +FOR a = 1 TO 20 + b = b + 1 + ' Calculate x-coordinate using sine function and add to array + xCoordinates(b) = SIN(a / 2 + rotationAngle) * 30 + 150 + ' Calculate z-coordinate using sine function and add to array + zCoordinates(b) = SIN(a / 2 + rotationAngle + 1.6) * 2 + 2 + ' Calculate y-coordinate by multiplying a with 8 and adding z-coordinate + yCoordinates(b) = a * 8 + zCoordinates(b) + ' Assign color code to the current point + colorCodes(b) = 3 + + b = b + 1 + ' Calculate x-coordinate using sine function and add to array + xCoordinates(b) = SIN(a / 2 + rotationAngle + 2.5) * 30 + 150 + ' Calculate z-coordinate using sine function and add to array + zCoordinates(b) = SIN(a / 2 + rotationAngle + 1.6 + 2.5) * 2 + 2 + ' Calculate y-coordinate by multiplying a with 8 and adding z-coordinate + yCoordinates(b) = a * 8 + zCoordinates(b) + ' Assign color code to the current point + colorCodes(b) = 4 +NEXT a + +' Clear the screen +CLS + +' Draw lines and circles based on z-coordinate +FOR b = 0 TO 4 + IF b = 1 THEN + FOR a = 1 TO 40 STEP 2 + ' Draw line between consecutive points + LINE (xCoordinates(a), yCoordinates(a))-(xCoordinates(a + 1), yCoordinates(a + 1)), 15 + NEXT a + END IF + + FOR a = 1 TO 40 + ' Check if the current z-coordinate matches the loop variable b + IF int(zCoordinates(a)) = b THEN + ' Draw circle with specified color code + CIRCLE (xCoordinates(a), yCoordinates(a)), b + 5, colorCodes(a) + PAINT (xCoordinates(a), yCoordinates(a)), colorCodes(a) + ' Draw an black outline of the circle + CIRCLE (xCoordinates(a), yCoordinates(a)), b + 5, 0 + END IF + NEXT a +NEXT b + +' Copy the screen to buffer and clear the screen +PCOPY 0, 1 +CLS + +' Check if any key is pressed +IF INKEY$ = "" THEN GOTO 1 + +' End the program +SYSTEM diff --git a/2D GFX/Animations/DNA.webm b/2D GFX/Animations/DNA.webm new file mode 100644 index 0000000..794d6ad Binary files /dev/null and b/2D GFX/Animations/DNA.webm differ diff --git a/2D GFX/Animations/Orbiting particles.bas b/2D GFX/Animations/Orbiting particles.bas new file mode 100755 index 0000000..f3653e6 --- /dev/null +++ b/2D GFX/Animations/Orbiting particles.bas @@ -0,0 +1,67 @@ +' Projects animated particles in orbit around a central point. +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' ?, Initial version +' 2024, Improved program readability + +SCREEN 7, , , 1 +RANDOMIZE TIMER + +' Declare shared arrays to store particles +DIM SHARED particleColor(1 TO 100) +DIM SHARED particleX(1 TO 100) +DIM SHARED particleAngle(1 TO 100) + +' Initialize the arrays with random values +FOR a = 1 TO 100 + particleColor(a) = RND * 15 + particleX(a) = RND * 100 + particleAngle(a) = RND * 100 +NEXT a + +' Main loop to draw the animated particles +1 +CLS +FOR a = 1 TO 50 + ' Get current segment data + currentColor = particleColor(a) + currentParticleX = particleX(a) + currentparticleAngle = particleAngle(a) + + ' Calculate the x and y coordinates for the current segment + xCoordinate = SIN(currentparticleAngle) * 25 + yCoordinate = SIN(currentParticleX) * 20 + + ' Scale the coordinates + scaleFactor = (COS(currentparticleAngle) + 2) * 2 + xCoordinate = xCoordinate * scaleFactor + yCoordinate = yCoordinate * scaleFactor + + ' Draw the current particle as a circle + CIRCLE (xCoordinate + 160, yCoordinate + 100), scaleFactor, currentColor + + ' Fill the inside of the circle with color + PAINT (xCoordinate + 160, yCoordinate + 100), currentColor + + ' Draw a line from the center to the current particle + LINE (160, 100)-(xCoordinate + 160, yCoordinate + 100), currentColor + + ' Rotate particle by small amount for next frame + particleAngle(a) = particleAngle(a) + .1 +NEXT a + +' Copy screen buffer 0 to screen buffer 1 +PCOPY 0, 1 + +' Check for user input and exit if any key is pressed +IF INKEY$ <> "" THEN SYSTEM + +' Use sound function with inaudible 0 Hz but fixed delay to slow down animation +SOUND 0, 1 + +' Go back to the main loop +GOTO 1 diff --git a/2D GFX/Animations/Orbiting particles.webm b/2D GFX/Animations/Orbiting particles.webm new file mode 100644 index 0000000..754e33e Binary files /dev/null and b/2D GFX/Animations/Orbiting particles.webm differ diff --git a/2D GFX/Animations/Polygon textured.bas b/2D GFX/Animations/Polygon textured.bas new file mode 100755 index 0000000..12bc91d --- /dev/null +++ b/2D GFX/Animations/Polygon textured.bas @@ -0,0 +1,250 @@ +' Texture mapping demonstration. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.04, Initial version +' 2024.08, Improved program readability + +DECLARE SUB Demo3 () +DECLARE SUB Demo2 () +DECLARE SUB Demo1 () +DECLARE SUB HLine (xCoord1!, yCoord!, xCoord2!, textureX1!, textureY1!, textureX2!, textureY2!) +DECLARE SUB Polygon (xCoord1!, yCoord1!, xCoord2!, yCoord2!, xCoord3!, yCoord3!, textureX1!, textureY1!, textureX2!, textureY2!, textureX3!, textureY3!) +DECLARE SUB PLine (xCoord1!, yCoord1!, xCoord2!, yCoord2!, textureX1!, textureY1!, textureX2!, textureY2!) +DECLARE SUB Start () + +DIM SHARED img(0 TO 100, 0 TO 100) +DIM SHARED bufx(0 TO 199) +DIM SHARED buftx(0 TO 199) +DIM SHARED bufty(0 TO 199) + +Start +Demo1 +Demo2 +Demo3 +SYSTEM + +SUB Demo1 + ' Demonstrates texture mapping by drawing a polygon with predefined vertices and texture coordinates. + ' It waits for user input and then repeatedly draws polygons with random vertices and predefined texture coordinates. + + ' Draw a polygon with predefined vertices and texture coordinates + Polygon 10, 10, 300, 80, 100, 180, 1, 1, 99, 1, 30, 99 + + ' Wait for user input + userInput$ = INPUT$(1) + + ' Label to repeat the polygon drawing +RepeatPolygonDrawing: + ' Generate random vertices for the polygon + vertexX1 = RND * 300 + 10 + vertexX2 = RND * 300 + 10 + vertexX3 = RND * 300 + 10 + vertexY1 = RND * 180 + 10 + vertexY2 = RND * 180 + 10 + vertexY3 = RND * 180 + 10 + + ' Draw a polygon with random vertices and predefined texture coordinates + Polygon vertexX1, vertexY1, vertexX2, vertexY2, vertexX3, vertexY3, 1, 1, 99, 1, 30, 99 + + ' Repeat the process until a key is pressed + IF INKEY$ = "" THEN GOTO RepeatPolygonDrawing + + ' Clear the screen + CLS +END SUB + +SUB Demo2 + ' Demonstrates texture mapping by drawing a polygon with vertices calculated using trigonometric functions. + ' It creates a rotating effect and repeatedly draws polygons with calculated vertices and predefined texture coordinates. + + ' Initialize the angle variable + angle = 0 + + ' Label to repeat the polygon drawing +RepeatRotatingPolygonDrawing: + ' Calculate the vertices of the polygon using trigonometric functions + vertexX1 = SIN(angle) * 80 + 160 + vertexY1 = COS(angle) * 80 + 100 + vertexX2 = SIN(angle + 2) * 80 + 160 + vertexY2 = COS(angle + 2) * 80 + 100 + vertexX3 = SIN(angle + 4) * 90 + 160 + vertexY3 = COS(angle + 4) * 90 + 100 + + ' Draw a polygon with calculated vertices and predefined texture coordinates + Polygon vertexX1, vertexY1, vertexX2, vertexY2, vertexX3, vertexY3, 1, 1, 99, 1, 30, 99 + + ' Increment the angle variable + angle = angle + .1 + + ' Repeat the process until a key is pressed + IF INKEY$ = "" THEN GOTO RepeatRotatingPolygonDrawing + + ' Clear the screen + CLS +END SUB + +SUB Demo3 + ' Demonstrates texture mapping by drawing a polygon with fixed vertices and rotating texture coordinates. + ' It creates a rotating effect for the texture while keeping the polygon location fixed on the screen. + + ' Initialize the angle variable for texture rotation + textureAngle = 0 + + ' Label to repeat the polygon drawing with rotating texture coordinates +RepeatTextureRotation: + ' Calculate the texture coordinates using trigonometric functions to create a rotating effect + textureX1 = SIN(textureAngle) * 40 + 50 + textureY1 = COS(textureAngle) * 40 + 50 + textureX2 = SIN(textureAngle + 2) * 40 + 50 + textureY2 = COS(textureAngle + 2) * 40 + 50 + textureX3 = SIN(textureAngle + 4) * 40 + 50 + textureY3 = COS(textureAngle + 4) * 40 + 50 + + ' Draw a polygon with fixed vertices and rotating texture coordinates + Polygon 1, 50, 300, 1, 100, 180, textureX1, textureY1, textureX2, textureY2, textureX3, textureY3 + + ' Increment the texture angle variable + textureAngle = textureAngle + .1 + + ' Repeat the process until a key is pressed + IF INKEY$ = "" THEN GOTO RepeatTextureRotation + + ' Clear the screen + CLS +END SUB + +SUB HLine (xCoord1, yCoord, xCoord2, textureX1, textureY1, textureX2, textureY2) + ' Draws a horizontal line with texture mapping between two points. + ' It calculates texture coordinates for each pixel along the line and sets the pixel color accordingly. + + ' Exit if the horizontal line has zero length + IF INT(xCoord2) = INT(xCoord1) THEN GOTO ExitHLine + + ' Determine the direction and initialize variables + IF xCoord2 > xCoord1 THEN + normalizedX1 = INT(xCoord1) + normalizedX2 = INT(xCoord2) + normalizedTextureX1 = textureX1 + normalizedTextureY1 = textureY1 + normalizedTextureX2 = textureX2 + normalizedTextureY2 = textureY2 + ELSE + normalizedX1 = INT(xCoord2) + normalizedX2 = INT(xCoord1) + normalizedTextureX1 = textureX2 + normalizedTextureY1 = textureY2 + normalizedTextureX2 = textureX1 + normalizedTextureY2 = textureY1 + END IF + + ' Calculate the line parameters + horizontalLength = normalizedX2 - normalizedX1 + textureDeltaX = normalizedTextureX2 - normalizedTextureX1 + textureDeltaY = normalizedTextureY2 - normalizedTextureY1 + + FOR pixelOffset = 0 TO horizontalLength + ' Calculate the texture coordinates for the current pixel + currentTextureX = textureDeltaX * pixelOffset / horizontalLength + normalizedTextureX1 + currentTextureY = textureDeltaY * pixelOffset / horizontalLength + normalizedTextureY1 + + ' Set the pixel color using texture coordinates + PSET (pixelOffset + normalizedX1, yCoord), img(currentTextureX, currentTextureY) + NEXT pixelOffset + +ExitHLine: +END SUB + +SUB PLine (xCoord1, yCoord1, xCoord2, yCoord2, textureX1, textureY1, textureX2, textureY2) + ' Draws a line with texture mapping between two points. + ' It calculates intermediate points along the line and uses the HLine subroutine to draw horizontal segments. + + ' Calculate the number of vertical steps + verticalSteps = ABS(yCoord2 - yCoord1) + IF verticalSteps = 0 THEN GOTO ExitPLine + + ' Calculate the differences in coordinates and texture coordinates + deltaY = yCoord2 - yCoord1 + deltaX = xCoord2 - xCoord1 + deltaTextureY = textureY2 - textureY1 + deltaTextureX = textureX2 - textureX1 + + ' Loop through each vertical step + FOR stepCounter = 0 TO verticalSteps + ' Calculate the intermediate coordinates and texture coordinates + intermediateX = deltaX * stepCounter / verticalSteps + xCoord1 + intermediateY = deltaY * stepCounter / verticalSteps + yCoord1 + intermediateTextureX = deltaTextureX * stepCounter / verticalSteps + textureX1 + intermediateTextureY = deltaTextureY * stepCounter / verticalSteps + textureY1 + + ' Check if the buffer is empty for this row + IF bufx(intermediateY) = -1 THEN + ' Store the intermediate coordinates and texture coordinates in the buffer + bufx(intermediateY) = intermediateX + buftx(intermediateY) = intermediateTextureX + bufty(intermediateY) = intermediateTextureY + ELSE + ' Draw a horizontal line using the stored and current intermediate coordinates and texture coordinates + HLine bufx(intermediateY), intermediateY, intermediateX, buftx(intermediateY), bufty(intermediateY), intermediateTextureX, intermediateTextureY + END IF + NEXT stepCounter + +ExitPLine: +END SUB + +SUB Polygon (xCoord1, yCoord1, xCoord2, yCoord2, xCoord3, yCoord3, textureX1, textureY1, textureX2, textureY2, textureX3, textureY3) + ' Fills a triangular area by connecting the edges with texture mapping. + ' It uses the PLine subroutine to draw lines connecting the vertices of the polygon. + + ' Initialize the buffer + FOR bufferIndex = 0 TO 199 + bufx(bufferIndex) = -1 + NEXT bufferIndex + + ' Draw three lines connecting the vertices of the polygon + PLine xCoord1, yCoord1, xCoord2, yCoord2, textureX1, textureY1, textureX2, textureY2 + PLine xCoord1, yCoord1, xCoord3, yCoord3, textureX1, textureY1, textureX3, textureY3 + PLine xCoord3, yCoord3, xCoord2, yCoord2, textureX3, textureY3, textureX2, textureY2 +END SUB + +SUB Start + ' Set the screen mode to 320x200 with 256 colors + SCREEN 13 + + ' Prepare sample texture to be used later for textured polygons demonstration: + + ' Draw random circles on the screen + FOR circleCounter = 1 TO 100 + ' Generate random coordinates and color for each circle + xCoord = RND * 150 + yCoord = RND * 150 + circleColor = RND * 255 + + ' Draw a circle with random radius and fill it with the same color + CIRCLE (xCoord, yCoord), RND * 20 + 3, circleColor + PAINT (xCoord, yCoord), circleColor + NEXT circleCounter + + ' Display "Test!" on the screen + LOCATE 8, 8 + PRINT "Test!" + + ' Wait for user input + userInput$ = INPUT$(1) + + ' Copy the screen content to the image array and clear the screen + FOR yPixel = 0 TO 100 + FOR xPixel = 0 TO 100 + ' Copy the color of each pixel to the image array + img(xPixel, yPixel) = POINT(xPixel + 20, yPixel + 20) + ' Clear the pixel on the screen + PSET (xPixel + 20, yPixel + 20), 0 + NEXT xPixel + NEXT yPixel + CLS +END SUB + diff --git a/2D GFX/Animations/Polygon textured.webm b/2D GFX/Animations/Polygon textured.webm new file mode 100644 index 0000000..41c764d Binary files /dev/null and b/2D GFX/Animations/Polygon textured.webm differ diff --git a/2D GFX/Animations/Polygon.bas b/2D GFX/Animations/Polygon.bas new file mode 100755 index 0000000..203e399 --- /dev/null +++ b/2D GFX/Animations/Polygon.bas @@ -0,0 +1,87 @@ +' Program to render polygons at random locations and random colors. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2001, Initial version +' 2024, Improved program readability + +DEFINT A-Z +DECLARE SUB fillPolygon (x1, y1, x2, y2, x3, y3, c) +SCREEN 13 + +MainLoop: + ' Generate random coordinates for the first vertex + x1 = RND * 318 + 1 + y1 = RND * 198 + 1 + + ' Generate random coordinates for the second vertex + x2 = RND * 318 + 1 + y2 = RND * 198 + 1 + + ' Generate random coordinates for the third vertex + x3 = RND * 318 + 1 + y3 = RND * 198 + 1 + + ' Fill the polygon with a random color + fillPolygon x1, y1, x2, y2, x3, y3, RND * 255 + + ' Add delay + SOUND 0, 1 + + ' Check if any key is pressed to exit the loop + IF INKEY$ <> "" THEN SYSTEM +GOTO MainLoop + +SUB fillPolygon (x1, y1, x2, y2, x3, y3, c) + ' Buffer array to store x-coordinates for each y-index + DIM yBuffer(-10 TO 210) + + ' Draw the line between the first and second vertices + tempX1 = x1 + tempY1 = y1 + tempX2 = x2 + tempY2 = y2 + GOSUB makeLine + + ' Draw the line between the first and third vertices + tempX1 = x1 + tempY1 = y1 + tempX2 = x3 + tempY2 = y3 + GOSUB makeLine + + ' Draw the line between the second and third vertices + tempX1 = x3 + tempY1 = y3 + tempX2 = x2 + tempY2 = y2 + GOSUB makeLine + +GOTO FillEnd + +makeLine: + ' Ensure that the start point is always below the end point + IF tempY2 < tempY1 THEN SWAP tempY1, tempY2: SWAP tempX1, tempX2 + + ' Loop through each y-index from the start to the end + FOR yIndex = tempY1 TO tempY2 - 1 + ' Calculate the x-position for the current y-index + xPos = tempX1 + (tempX2 - tempX1) * ((yIndex - tempY1) / (tempY2 - tempY1)) + + ' If the buffer is empty, store the x-position + IF yBuffer(yIndex) = 0 THEN + yBuffer(yIndex) = xPos + ELSE + ' Otherwise, draw a line between the stored and calculated positions + LINE (xPos, yIndex)-(yBuffer(yIndex), yIndex), c + END IF + NEXT yIndex +RETURN + +FillEnd: +END SUB + diff --git a/2D GFX/Animations/Polygon.webm b/2D GFX/Animations/Polygon.webm new file mode 100644 index 0000000..31bf79f Binary files /dev/null and b/2D GFX/Animations/Polygon.webm differ diff --git a/2D GFX/Animations/Screensaver, flying hand fans.bas b/2D GFX/Animations/Screensaver, flying hand fans.bas new file mode 100755 index 0000000..4478601 --- /dev/null +++ b/2D GFX/Animations/Screensaver, flying hand fans.bas @@ -0,0 +1,64 @@ +' Screensaver +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.04, Initial version +' 2024.08, Improved program readability + + +SCREEN 7, , , 1 + +' Main animation loop +1 : + ' Adjust frame counter if it exceeds a certain threshold + IF frameCounter > 10000 THEN frameCounter = -10000 + + ' Update the positions of six points based on the frame counter + FOR pointIndex = 1 TO 6 + OUT &H3C8, pointIndex + OUT &H3C9, SIN(pointIndex + frameCounter * 3) * 30 + 31 + OUT &H3C9, COS(pointIndex * 1 + frameCounter * 5) * 30 + 31 + OUT &H3C9, SIN(pointIndex * .7 + frameCounter * 2.23) * 30 + 31 + NEXT pointIndex + + ' Increment the frame counter for the next iteration + frameCounter = frameCounter + .01 + + ' Render lines connecting points + FOR objectIndex = 1 TO 10 + ' Determine the color based on the remainder of objectIndex divided by 6 + pointColor = (objectIndex MOD 6) + 1 + ' Calculate the X coordinate for the starting point of the line + xCoordinate = SIN(objectIndex + frameCounter) * 100 + 150 + ' Calculate the Y coordinate for the starting point of the line + yCoordinate = COS(objectIndex * 1.2 + frameCounter * 1.81) * 80 + 100 + ' Calculate the sine component for the line's angle + xSineComponent = SIN(objectIndex * frameCounter * 2.3) + ' Draw lines from the starting point with varying lengths and angles + FOR xPositionOffset = -50 TO 50 STEP 10 + ' Calculate the cosine component for the line's angle based on xPositionOffset + yCosineComponent = COS(xPositionOffset / 60 + frameCounter * 1 + objectIndex) * 50 + ' Draw a line segment with varying thickness and color + LINE (xCoordinate, yCoordinate)-(xCoordinate + xPositionOffset * xSineComponent, yCoordinate - yCosineComponent), pointColor + NEXT xPositionOffset + NEXT objectIndex + + ' Copy the graphics from the hidden page to the visible page + PCOPY 0, 1 + + ' Clear the screen for the next frame + CLS + + ' Play a sound at a specific frequency and duration + SOUND 0, .4 + + ' Check if any key is pressed; if so, exit the program + IF INKEY$ <> "" THEN SYSTEM + + ' Loop back to the start of the animation +GOTO 1 + diff --git a/2D GFX/Animations/Screensaver, flying hand fans.webm b/2D GFX/Animations/Screensaver, flying hand fans.webm new file mode 100644 index 0000000..66769f7 Binary files /dev/null and b/2D GFX/Animations/Screensaver, flying hand fans.webm differ diff --git a/2D GFX/Animations/Screensaver.bas b/2D GFX/Animations/Screensaver.bas new file mode 100755 index 0000000..b867ff2 --- /dev/null +++ b/2D GFX/Animations/Screensaver.bas @@ -0,0 +1,46 @@ +' Mystery screensaver +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2004.01, Initial version +' 2024.08, Improved program readability + +SCREEN 7, , , 1 + +' Main loop for animation +DO + ' Increment frame counter + frameCounter = frameCounter + 1 + + ' Calculate scaling factor based on frame counter + scaleFactor = (SIN(frameCounter / 100) + 1.1) * 2 + + ' Draw lines to create animation effect + FOR s = 1 TO 20 STEP .1 + ' Calculate x and y coordinates for the first point + x = SIN(s / 1 + frameCounter / 7) * 100 + y = COS(s / 1 + frameCounter / 10) * 100 + + ' Calculate x and y coordinates for the second point + x1 = SIN(s / 1 - frameCounter / 8) * 100 + y1 = COS(s / 1 + frameCounter / 15) * 100 + + ' Draw a line between the two points with varying thickness + LINE (x + 160, y + 100)-(x1 + 160, y1 + 100), s MOD 15 + NEXT s + + ' Copy screen buffer to display the animation + PCOPY 0, 1 + + ' Generate a sound effect + SOUND 0, 1 + + ' Clear the screen for the next frame + CLS + + ' Check if a key is pressed and exit if so + IF INKEY$ <> "" THEN SYSTEM +LOOP diff --git a/2D GFX/Animations/Screensaver.webm b/2D GFX/Animations/Screensaver.webm new file mode 100644 index 0000000..fd41592 Binary files /dev/null and b/2D GFX/Animations/Screensaver.webm differ diff --git a/2D GFX/Animations/Snowfall.bas b/2D GFX/Animations/Snowfall.bas new file mode 100755 index 0000000..528724e --- /dev/null +++ b/2D GFX/Animations/Snowfall.bas @@ -0,0 +1,96 @@ +' Svjatoslav Agejenko 2003.04 + +DEFINT A-Z +DECLARE SUB fall (particleIndex) +DECLARE SUB start () + +amo = 500 + +DIM SHARED fx(1 TO amo) +DIM SHARED fy(1 TO amo) + +' Initialize particle positions +FOR a = 1 TO amo + fx(a) = RND * 300 + 10 + fy(a) = RND * 100 + 10 +NEXT a + +start + +1 +' Main loop to simulate snowfall +FOR b = 1 TO 100 + a = INT(RND * amo) + 1 + fall a +NEXT b +SOUND 0, .1 +IF INKEY$ <> "" THEN SYSTEM +GOTO 1 + +SUB fall (particleIndex) + +t = 0 +2 +' Draw the particle at its current position +PSET (fx(particleIndex), fy(particleIndex)), 0 + +ny = fy(particleIndex) + 1 +nx = fx(particleIndex) + INT(RND * 3) - 1 + +' Check for collision with another particle +IF POINT(nx, ny) > 0 THEN + ' If collision detected and t is less than 10, increment t and retry + IF t < 10 THEN + t = t + 1 + GOTO 2 + END IF + ' If collision persists, change particle color to indicate collision + PSET (fx(particleIndex), fy(particleIndex)), 15 + nx = RND * 300 + 10 + ny = 1 +END IF + +' Check if the particle has reached the bottom of the screen +IF fy(particleIndex) > 198 THEN + PSET (fx(particleIndex), fy(particleIndex)), 15 + nx = RND * 300 + 10 + ny = 1 +END IF + +' Update particle position +fx(particleIndex) = nx +fy(particleIndex) = ny + +' Draw the particle at its new position +PSET (fx(particleIndex), fy(particleIndex)), 15 + +END SUB + +DEFSNG A-Z +SUB start +SCREEN 13 + +' Create nice and curvy surface for snow particles to fall onto. +' Here we draw "SNOW" with big and wobbly letters to the screen +' to serve as an obstacle for snow particles. + +LOCATE 1, 1 +PRINT "SNOW" + +FOR y = 0 TO 15 STEP .2 + xp = SIN(y / 1) * 3 + 65 + FOR x = 0 TO 30 STEP .1 + ys = 4 + COS(x / 5) + yp = COS(x / 4 + 3) * 5 + 130 + c = POINT(x, y) + ' Draw a line if the point is not black + IF c > 0 THEN + LINE (x * 6 + xp, y * ys + yp)-(x * 6 + xp + 1, y * ys + yp + 1), 11, BF + END IF + NEXT x +NEXT y + +LOCATE 1, 1 +PRINT " " + +END SUB diff --git a/2D GFX/Animations/Snowfall.webm b/2D GFX/Animations/Snowfall.webm new file mode 100644 index 0000000..64ced88 Binary files /dev/null and b/2D GFX/Animations/Snowfall.webm differ diff --git a/2D GFX/Animations/Tree.bas b/2D GFX/Animations/Tree.bas new file mode 100755 index 0000000..15e78bb --- /dev/null +++ b/2D GFX/Animations/Tree.bas @@ -0,0 +1,116 @@ +DECLARE SUB setPalette () +' Render tree that starts with single root and then branches out. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2001, Initial version +' 2024.08, Improved program readability + + +DECLARE SUB start () +DECLARE SUB show (d%) +DECLARE SUB setpal () +DECLARE SUB showpal () +DEFINT A-Y + +DIM SHARED x(1 TO 500) +DIM SHARED y(1 TO 500) +DIM SHARED s(1 TO 500) + +DIM SHARED x4(1 TO 500) +DIM SHARED y4(1 TO 500) + +DIM SHARED z(1 TO 500) +DIM SHARED mitu + + +start + +1 +mitu = 1 + +x4(1) = -1 +y4(1) = -1 +x(1) = 420 +y(1) = 340 +s(1) = 70 * 100 +z(1) = 1 + +' Main loop to render the tree branches +FOR tr = 1 TO 6 + FOR b = 1 TO 50 + FOR a = 1 TO mitu + show a + NEXT a + NEXT b + + ' Duplicate existing branches and add randomness + FOR a = 1 TO mitu + x(mitu + a) = x(a) + y(mitu + a) = y(a) + s(mitu + a) = s(a) + z(mitu + a) = z(a) + x4(mitu + a) = RND * 4 - 2 + y4(mitu + a) = RND * 4 - 2 + NEXT a + mitu = mitu * 2 + +NEXT tr + +' Exit application if any key was pressed by user +IF INKEY$ <> "" THEN SYSTEM + + +SLEEP 2 +CLS +GOTO 1 + +SUB setPalette + ' Set the palette colors to grayscale + FOR a = 0 TO 16 + OUT &H3C8, a + OUT &H3C9, a * 4 + OUT &H3C9, a * 4 + OUT &H3C9, a * 4 + NEXT +END SUB + +SUB show (d) + ' Retrieve current branch properties + x1 = x(d) + y1 = y(d) + s1 = s(d) + z1 = z(d) + + ' Calculate color based on angle + c = SIN(z1) * 7 + 9 + + ' Draw and fill the circle representing the branch + CIRCLE (x1, y1), s1 / 100, c + PAINT (x1, y1), c + + ' Update position based on current angle and size + x(d) = x(d) + (SIN(z1) * 1000) / (s1 + 15) + y(d) = y(d) + (COS(z1) * 1000) / (s1 + 15) + + ' Decay the size slightly + s(d) = s(d) / 1.01 + + ' Update angle based on direction + IF x4(d) >= 0 THEN z(d) = z(d) + .1 ELSE z(d) = z(d) - .1 + + ' Move branch in its random direction + x(d) = x(d) + x4(d) + y(d) = y(d) + y4(d) +END SUB + +SUB start + SCREEN 12 + setPalette + RANDOMIZE TIMER +END SUB + diff --git a/2D GFX/Animations/Tree.webm b/2D GFX/Animations/Tree.webm new file mode 100644 index 0000000..a3d8b66 Binary files /dev/null and b/2D GFX/Animations/Tree.webm differ diff --git a/2D GFX/Animations/Yin and yang.bas b/2D GFX/Animations/Yin and yang.bas new file mode 100755 index 0000000..bca4394 --- /dev/null +++ b/2D GFX/Animations/Yin and yang.bas @@ -0,0 +1,57 @@ +' Yin and yang animation. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2000, Initial version +' 2024.08, Improved program readability + +DECLARE SUB Cir (x!, y!, r!, c!) +SCREEN 13 +pi = 3.141592599999999# +PAINT (1, 1), 1 + +' Main animation loop +DO + ' Calculate the x and y positions for both circles using sine and cosine functions + x = SIN(a) * 40 + 160 + x1 = SIN(a + pi) * 40 + 160 + y = COS(a) * 34 + 100 + y1 = COS(a + pi) * 34 + 100 + + ' Draw the first circle with color 0 (black) + Cir x, y, 40, 0 + ' Draw the second circle with color 1 (blue) + Cir x1, y1, 40, 1 + + ' Increment the angle to animate the circles + a = a + .05 + + ' Check for user input to exit the program + IF INKEY$ <> "" THEN SYSTEM + + ' delay to slow down animation + SOUND 0, 1 +LOOP + +' Subroutine to draw a circle with specified center (x, y), radius r, and color c +SUB Cir (x, y, r, c) + ' Define colors for the circle outline + cc1 = 0 ' Black + cc2 = 15 ' White + + ' Swap colors if the second color is desired for the inner part of the circle + IF c = 1 THEN SWAP cc1, cc2 + + ' Draw the circle from radius 1 to r + FOR a = 1 TO r + ' Determine the color for the current circle segment + IF a < r / 2 THEN c1 = cc1 ELSE c1 = cc2 + ' Draw the circle segment with the determined color + CIRCLE (x, y), a, c1 + NEXT a +END SUB + diff --git a/2D GFX/Animations/Yin and yang.webm b/2D GFX/Animations/Yin and yang.webm new file mode 100644 index 0000000..9c78c91 Binary files /dev/null and b/2D GFX/Animations/Yin and yang.webm differ diff --git a/2D GFX/Animations/circular patterns.bas b/2D GFX/Animations/circular patterns.bas new file mode 100644 index 0000000..b68024e --- /dev/null +++ b/2D GFX/Animations/circular patterns.bas @@ -0,0 +1,58 @@ +' Program generates fractal animation that looks like atoms. +' While it uses a simple formula to calculate the color of every pixel, +' visual effect is quite impressive. Formula was accidentally discovered. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2002, Original version +' 2024 - 2025, Improved program readability + +SCREEN 13 +DIM SHARED pixelByte AS STRING * 1 + +zoomFactor = 100 +frameNumber = 0 +fileNameChar1 = 97 +fileNameChar2 = 97 + +1 +frameNumber = frameNumber + 1 + +' Calculate transformed screen dimensions based on current zoom level +transformedScreenWidth = 320 * zoomFactor / 30 +transformedScreenHeight = 200 * zoomFactor / 30 + +' Calculate starting coordinates to center the fractal pattern +startCoordinateX = 160 - (transformedScreenWidth / 2) +startCoordinateY = 100 - (transformedScreenHeight / 2) + +' CLS + +' Generate fractal pattern pixel by pixel +FOR currentY = 0 TO 199 + FOR currentX = 0 TO 319 + ' Calculate new coordinates with current zoom level + newX = startCoordinateX + (transformedScreenWidth * currentX / 320) + newY = startCoordinateY + (transformedScreenHeight * currentY / 200) + + ' Calculate color value using fractal formula + ' Formula: sin((x² + y²) / 10) * 6 + 23 + colorValue = SIN((newX ^ 2 + newY ^ 2) / 10) * 6 + 23 + + ' Clamp color values to valid range (16-31) + IF colorValue < 16 THEN colorValue = 16 + IF colorValue > 31 THEN colorValue = 31 + PSET (currentX, currentY), colorValue + NEXT currentX +NEXT currentY + + +' Decrease zoom factor for next frame to create zooming effect +zoomFactor = zoomFactor / 1.1 + +' Continue generating frames while zoom factor is above minimum threshold +IF zoomFactor > 5 THEN GOTO 1 diff --git a/2D GFX/Animations/circular patterns.webm b/2D GFX/Animations/circular patterns.webm new file mode 100644 index 0000000..99243c8 Binary files /dev/null and b/2D GFX/Animations/circular patterns.webm differ diff --git a/2D GFX/Animations/hacker.bas b/2D GFX/Animations/hacker.bas new file mode 100755 index 0000000..48a2ddb --- /dev/null +++ b/2D GFX/Animations/hacker.bas @@ -0,0 +1,244 @@ +' Program to render animation inspired by Matrix movie. +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.04, Initial version +' 2024.08, Improved program readability + + +DECLARE FUNCTION getCharacter% () +DECLARE SUB makeSound () +DEFINT A-Z +DECLARE SUB displayScreen () +DECLARE SUB showPalette () +DECLARE SUB initializeGame () + +DIM SHARED screenBuffer(1 TO 40, 1 TO 25) AS INTEGER +DIM SHARED colorBuffer(1 TO 40, 1 TO 25) AS INTEGER +DIM SHARED soundArray(1 TO 20) +DIM SHARED soundPointer + +initializeGame +'showPalette() + +' Initialize the screen buffer with random characters +FOR row = 1 TO 25 + FOR col = 1 TO 40 + screenBuffer(col, row) = getCharacter + NEXT col +NEXT row + +' Initialize the color buffer with a default color +FOR row = 1 TO 25 + FOR col = 1 TO 40 + colorBuffer(col, row) = 1 + NEXT col +NEXT row + +actionCounter = 0 + +10 ' Main game loop +makeSound +frameCounter = frameCounter + 1 +IF frameCounter > 10000 THEN frameCounter = 1 + +' Shift the screen buffer contents down by one row +FOR row = 25 TO 2 STEP -1 + FOR col = 1 TO 40 + screenBuffer(col, row) = screenBuffer(col, row - 1) + NEXT col +NEXT row +makeSound + +' Move the top row to the bottom +FOR col = 1 TO 40 + screenBuffer(col, 1) = screenBuffer(col, 25) +NEXT col + +' Randomly change a character in the buffer +screenBuffer(INT(RND * 39 + 1), INT(RND * 10 + 1)) = getCharacter +actionCounter = actionCounter + 1 +displayScreen + +SELECT CASE actionCounter +CASE 1 + ' Initialize sound array with random values + FOR a = 1 TO 20 + soundArray(a) = 0 + IF RND * 100 < 2 THEN soundArray(a) = INT(RND * 4000 + 4000) + NEXT a + ' Set sound frequencies based on sine wave + b = SIN(frameCounter / 100) * 3 + 6 + FOR a = 1 TO 20 STEP b + soundArray(a) = 10000 + NEXT a + +CASE 2 + ' Draw a horizontal line with random color + c = INT(RND * 5) + x1 = INT(RND * 38 + 1) + y = INT(RND * 23 + 1) + x2 = INT(RND * 38 + 1) + IF x1 > x2 THEN SWAP x1, x2 + FOR x = x1 TO x2 + colorBuffer(x, y) = c + NEXT x + +CASE 3 + ' Draw a vertical line with random color + c = INT(RND * 5) + y1 = INT(RND * 23 + 1) + x = INT(RND * 38 + 1) + y2 = INT(RND * 23 + 1) + IF y1 > y2 THEN SWAP y1, y2 + FOR y = y1 TO y2 + colorBuffer(x, y) = c + NEXT y + +CASE 4 + ' Decrease the intensity of colors on the screen + IF RND * 100 < 20 THEN + FOR y = 1 TO 25 + FOR x = 1 TO 40 + IF colorBuffer(x, y) > 1 THEN colorBuffer(x, y) = colorBuffer(x, y) - 1 + NEXT x + NEXT y + END IF + +CASE 5 + ' Reset every second row to default color + IF RND * 100 < 5 THEN + FOR y = 1 TO 25 STEP 2 + FOR x = 1 TO 40 + colorBuffer(x, y) = 1 + NEXT x + NEXT y + END IF + +CASE 6 + ' Reset every second column to default color + IF RND * 100 < 5 THEN + FOR x = 1 TO 40 STEP 2 + FOR y = 1 TO 25 + colorBuffer(x, y) = 1 + NEXT y + NEXT x + END IF + +CASE 7 + ' Randomly set some characters to random colors + FOR a = 1 TO 30 + colorBuffer(INT(RND * 39 + 1), INT(RND * 23 + 1)) = INT(RND * 4 + 1) + NEXT a + +CASE 8 + ' Check for user input to exit the game + IF INKEY$ <> "" THEN SYSTEM + actionCounter = 0 +END SELECT + +GOTO 10 + +SYSTEM: +' Exit the game +END + +SUB displayScreen + +makeSound +LOCATE 1, 1 + +' Display the top half of the screen +FOR y = 1 TO 10 + FOR x = 1 TO 40 + COLOR colorBuffer(x, y), 0 + PRINT CHR$(screenBuffer(x, y)); + NEXT x +NEXT y + +makeSound +' Display the middle part of the screen +FOR y = 11 TO 20 + FOR x = 1 TO 40 + COLOR colorBuffer(x, y), 0 + PRINT CHR$(screenBuffer(x, y)); + NEXT x +NEXT y + +makeSound +' Display the bottom half of the screen +FOR y = 21 TO 25 + FOR x = 1 TO 40 + COLOR colorBuffer(x, y), 0 + PRINT CHR$(screenBuffer(x, y)); + NEXT x +NEXT y + +makeSound + +END SUB + +FUNCTION getCharacter +' Generate a random character based on probability +IF RND * 100 > 50 THEN + getCharacter = INT(RND * 9 + 48) +ELSE + getCharacter = INT(RND * 25 + 65) +END IF +IF RND * 100 < 15 THEN getCharacter = 32 ' 15% chance to return a space +END FUNCTION + +SUB initializeGame + +RANDOMIZE TIMER ' Seed the random number generator +CLS ' Clear the screen +WIDTH 40, 25 ' Set screen dimensions +VIEW PRINT 1 TO 25 ' Set the print area + +' Initialize palette registers for color text mode +OUT &H3C8, 0 +OUT &H3C9, 0 +OUT &H3C9, 0 +OUT &H3C9, 0 + +' Set up color palettes +FOR a = 1 TO 5 + OUT &H3C8, a + + b = a * 5 + g = a * 10 + 20 + r = a * 0 + + ' Ensure RGB values do not exceed the maximum value + IF r > 63 THEN r = 63 + IF g > 63 THEN g = 63 + IF b > 63 THEN b = 63 + OUT &H3C9, r + OUT &H3C9, g + OUT &H3C9, b +NEXT a + +END SUB + +SUB makeSound +' Update the sound pointer and play a sound +soundPointer = soundPointer + 1 +IF soundPointer > 20 THEN soundPointer = 1 +SOUND soundArray(soundPointer), .07 +' SOUND 0, .07 ' Uncomment to play a continuous tone +END SUB + +SUB showPalette + +' Display a palette test on the screen +FOR a = 0 TO 15 + COLOR a + PRINT a; " Palette test" +NEXT a +a$ = INPUT$(1) ' Wait for user input + +END SUB + diff --git a/2D GFX/Animations/hacker.webm b/2D GFX/Animations/hacker.webm new file mode 100644 index 0000000..553dc27 Binary files /dev/null and b/2D GFX/Animations/hacker.webm differ diff --git a/2D GFX/Animations/index.org b/2D GFX/Animations/index.org new file mode 100644 index 0000000..867f7ae --- /dev/null +++ b/2D GFX/Animations/index.org @@ -0,0 +1,272 @@ +#+TITLE: Graphics demos +#+LANGUAGE: en +#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry} +#+LATEX_HEADER: \usepackage{parskip} +#+LATEX_HEADER: \usepackage[none]{hyphenat} + +#+OPTIONS: H:20 num:20 +#+OPTIONS: author:nil + +#+begin_export html + +#+end_export + + +* Bump mapping + +Light source moves around. Based on light source location, different +parts of the surface become illuminated. + +#+begin_export html +
+ +
+#+end_export + +[[file:Bump mapping.bas][Source code]] + +* Tree + +Tree grows and branches out. + +#+begin_export html +
+ +
+#+end_export + +[[file:Tree.bas][Source code]] + +#+INCLUDE: "Tree.bas" src basic-qb45 + +* Rotation in 2D space using trigonometry functions + +Grid of dots is rotated on the screen. + +#+begin_export html +
+ +
+#+end_export + +[[file:2D rotation.bas][Source code]] + +#+INCLUDE: "2D rotation.bas" src basic-qb45 + +* Various text mode animation effects + +Program demonstrates various animation effects that can be +accomplished using text-mode rendering. + +#+begin_export html +
+ +
+ #+end_export + +[[file:text mode animation.bas][Source code]] + +* Snowfall + +Program simulates falling of snow particles. Particles fall towards +the ground because of the gravity. Once particle falls on the surface, +it tries to skid around a bit, bit ultimately freezes in-place. + +#+begin_export html +
+ +
+#+end_export + +[[file:Snowfall.bas][Source code]] + +#+INCLUDE: "Snowfall.bas" src basic-qb45 + +* Screensaver + +Application of trigonometry functions is explored here to calculate +line coordinates. + +#+begin_export html +
+ +
+#+end_export + +[[file:Screensaver.bas][Source code]] + +#+INCLUDE: "Screensaver.bas" src basic-qb45 + +* Screensaver - flying hand fans + +Quick implementation for colorful flying hand fans. + +#+begin_export html +
+ +
+#+end_export + +[[file:Screensaver, flying hand fans.bas][Source code]] + +#+INCLUDE: "Screensaver, flying hand fans.bas" src basic-qb45 + +* Polygon rendering + +Algorithm to demonstrate rendering or polygons across arbitrary +coordinates. + +#+begin_export html +
+ +
+#+end_export + +[[file:Polygon.bas][Source code]] + +#+INCLUDE: "Polygon.bas" src basic-qb45 + +* Textured polygon rendering + +Algorithm to demonstrate rendering or textured polygons across +arbitrary coordinates. + +#+begin_export html +
+ +
+#+end_export + +[[file:Polygon textured.bas][Source code]] + +* Yin and yang animation + +Yin and yang is a concept that originated in Chinese philosophy, +describing an opposite but interconnected, self-perpetuating +cycle. Yin and yang can be thought of as complementary and at the same +time opposing forces that interact to form a dynamic system in which +the whole is greater than the assembled parts and the parts are +important for cohesion of the whole. + +#+begin_export html +
+ +
+#+end_export + +[[file:Yin and yang.bas][Source code]] + +#+INCLUDE: "Yin and yang.bas" src basic-qb45 + +* Orbiting particles + +Trivial to implement but interesting looking effect. Various particles +are orbiting central point. Each particle is connected to the center. + +#+begin_export html +
+ +
+#+end_export + +[[file:Orbiting particles.bas][Source code]] + +#+INCLUDE: "Orbiting particles.bas" src basic-qb45 + +* DNA animation + +Animated DNA. Nowhere close to being anatomically correct, but +resembles animation as seen in the movies :) + +#+begin_export html +
+ +
+#+end_export + +[[file:DNA.bas][Source code]] + +#+INCLUDE: "DNA.bas" src basic-qb45 + +* Matrix + +Effect inspired by "The Matrix" movie. + +#+begin_export html +
+ +
+#+end_export + +[[file:matrix.bas][Source code]] + +* Hacker + +Ultra-realistic hacker screen simulator! Behold da glory of a true +hacker's terminal, brimming wif mystical green text that cascades like +a waterfall of knowledge across thy monitor. + +#+begin_export html +
+ +
+#+end_export + +[[file:hacker.bas][Source code]] diff --git a/2D GFX/Animations/logo.png b/2D GFX/Animations/logo.png new file mode 100644 index 0000000..bda2751 Binary files /dev/null and b/2D GFX/Animations/logo.png differ diff --git a/2D GFX/Animations/matrix.bas b/2D GFX/Animations/matrix.bas new file mode 100755 index 0000000..e49784d --- /dev/null +++ b/2D GFX/Animations/matrix.bas @@ -0,0 +1,417 @@ +' Program renders animation/screensaver. +' It is inspired by The Matrix movie. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2002, Initial version +' 2024 - 2025, Improved program readability + + +DECLARE SUB initializeStream(streamIndex%) +DECLARE SUB drawPixel(x%, y%) +DECLARE SUB addNewPixel(x%, y%) +DECLARE SUB smoothPixels(x1%, y1%, x2%, y2%, recursionDepth%) +DECLARE SUB drawSymbol(x%, y%, symbol%) +DECLARE SUB setColorPalette(paletteIndex%) +DECLARE SUB initializeScreen() +DECLARE SUB loadFonts() +DEFINT A-Z + +' Arrays to store font data and pixel information +DIM SHARED font1(1 TO 400, 1 TO 10) +DIM SHARED font2(1 TO 400, 1 TO 10) +DIM SHARED font3(1 TO 400, 1 TO 10) +DIM SHARED pixelFont(0 TO 20, 0 TO 20) +DIM SHARED pixelPalette(0 TO 20, 0 TO 20) +DIM SHARED pixelAge(0 TO 20, 0 TO 20) +DIM SHARED streamX(0 TO 20) +DIM SHARED streamY(0 TO 20) +DIM SHARED streamUsage(0 TO 20) +DIM SHARED timerValue AS DOUBLE + +' Number of streams or objects in the animation +numberOfStreams = 8 + +' Initialize the screen and start the animation +initializeScreen + +' Main loop of the program +MainLoop: + FOR streamIndex = 1 TO numberOfStreams + ' Check if the usage count is zero + IF streamUsage(streamIndex) = 0 THEN initializeStream streamIndex + ' Add new position to the current object + addNewPixel streamX(streamIndex), streamY(streamIndex) + ' Update the y-coordinate of the current object + streamY(streamIndex) = streamY(streamIndex) + 1 + ' Check if the y-coordinate exceeds the screen height + IF streamY(streamIndex) > 13 THEN streamY(streamIndex) = 0 + ' Decrease the usage count of the current object + streamUsage(streamIndex) = streamUsage(streamIndex) - 1 + NEXT streamIndex + + ' Update the screen + FOR y = 0 TO 13 + FOR x = 0 TO 18 + ' Get the current pixel value + currentAge = pixelAge(x, y) + ' Increment the pixel value + currentAge = currentAge + 1 + ' Check if the pixel value is equal to 2 + IF currentAge = 2 THEN + pixelPalette(x, y) = 2 + drawPixel x, y + ' Check if the pixel value is equal to 5 + ELSEIF currentAge = 5 THEN + pixelPalette(x, y) = 3 + drawPixel x, y + ' Check if the pixel value is equal to 30 + ELSEIF currentAge = 30 THEN + pixelFont(x, y) = 0 + drawPixel x, y + END IF + ' Update the pixel value + pixelAge(x, y) = currentAge + NEXT x + NEXT y + + ' Wait for a short period of time + WaitLoop: + IF ABS(timerValue - TIMER) < .1 THEN GOTO WaitLoop + ' Update the timer + timerValue = TIMER + ' Check if any key is pressed + IF INKEY$ <> "" THEN SYSTEM + ' Go back to the main loop + GOTO MainLoop + +SUB addNewPixel(x, y) + ' Set a random font for the new pixel + pixelFont(x, y) = RND * 8 + 1 + ' Set the palette index for the new pixel + pixelPalette(x, y) = 1 + ' Initialize the pixel value + pixelAge(x, y) = 0 + ' Draw the new pixel on the screen + drawPixel x, y +END SUB + +SUB initializeStream(streamIndex) + ' Set random initial positions for the object + streamX(streamIndex) = RND * 18 + streamY(streamIndex) = RND * 13 + ' Set a random usage count for the object + streamUsage(streamIndex) = RND * 5 + 3 +END SUB + +SUB loadFonts + ' Load fonts from the screen + FOR symbolIndex = 1 TO 9 + LOCATE 1, 1 + ' Print the loading progress + PRINT "Loading: " + STR$(symbolIndex * 10) + "%" + ' Draw a square on the screen + LINE (49, 49)-(83, 83), 0, BF + ' Draw a symbol on the screen + drawSymbol 50, 50, symbolIndex + ' Smooth the symbol + smoothPixels 50, 50, 82, 82, 1 + ' Get the smoothed symbol from the screen + GET (50, 50)-(82, 82), font1(1, symbolIndex) + ' Draw another square on the screen + LINE (49, 49)-(83, 83), 0, BF + ' Draw another symbol on the screen + drawSymbol 50, 50, symbolIndex + ' Smooth the other symbol + smoothPixels 50, 50, 82, 82, 2 + ' Get the smoothed symbol from the screen + GET (50, 50)-(82, 82), font2(1, symbolIndex) + ' Draw yet another square on the screen + LINE (49, 49)-(83, 83), 0, BF + ' Draw yet another symbol on the screen + drawSymbol 50, 50, symbolIndex + ' Smooth the last symbol + smoothPixels 50, 50, 82, 82, 3 + ' Get the smoothed symbol from the screen + GET (50, 50)-(82, 82), font3(1, symbolIndex) + NEXT symbolIndex + ' Clear the screen + CLS +END SUB + +SUB drawPixel(x, y) + ' Calculate the screen coordinates for the pixel + x1 = x * 32 + 12 + y1 = y * 32 + 15 + ' Get the current font and palette index + currentFont = pixelFont(x, y) + currentPalette = pixelPalette(x, y) + ' Check if the pixel is empty + IF currentFont = 0 THEN + ' Draw an empty square on the screen + LINE (x1, y1)-(x1 + 32, y1 + 32), 0, BF + ELSE + ' Select the appropriate font based on the palette index + SELECT CASE currentPalette + CASE 1 + ' Draw the pixel using the first font + PUT (x1, y1), font1(1, currentFont), PSET + CASE 2 + ' Draw the pixel using the second font + PUT (x1, y1), font2(1, currentFont), PSET + CASE 3 + ' Draw the pixel using the third font + PUT (x1, y1), font3(1, currentFont), PSET + END SELECT + END IF +END SUB + +SUB drawSymbol(x, y, symbol) + ' Select the appropriate symbol based on the input value + SELECT CASE symbol + CASE 1 + ' Draw the first symbol + LINE (x + 10, y + 5)-(x + 10, y + 20), 14 + LINE (x + 5, y + 15)-(x + 20, y + 15), 14 + LINE (x + 15, y + 25)-(x + 20, y + 25), 14 + LINE (x + 20, y + 25)-(x + 25, y + 20), 14 + LINE (x + 25, y + 20)-(x + 25, y + 5), 14 + CASE 2 + ' Draw the second symbol + LINE (x + 5, y + 15)-(x + 25, y + 10), 14 + LINE (x + 15, y + 5)-(x + 10, y + 25), 14 + LINE (x + 25, y + 5)-(x + 20, y + 20), 14 + LINE (x + 20, y + 30)-(x + 30, y + 20), 14 + CASE 3 + ' Draw the third symbol + LINE (x + 5, y + 5)-(x + 5, y + 25), 14 + LINE (x + 5, y + 5)-(x + 25, y + 25), 14 + LINE (x + 5, y + 25)-(x + 25, y + 25), 14 + LINE (x + 10, y + 10)-(x + 25, y + 5), 14 + CASE 4 + ' Draw the fourth symbol + LINE (x + 10, y + 5)-(x + 20, y + 5), 14 + LINE (x + 20, y + 5)-(x + 25, y + 10), 14 + LINE (x + 25, y + 20)-(x + 20, y + 25), 14 + LINE (x + 20, y + 25)-(x + 10, y + 25), 14 + LINE (x + 10, y + 25)-(x + 10, y + 5), 14 + LINE (x + 5, y + 15)-(x + 20, y + 15), 14 + CASE 5 + ' Draw the fifth symbol + LINE (x + 5, y + 5)-(x + 10, y + 10), 14 + LINE (x + 10, y + 10)-(x + 10, y + 25), 14 + LINE (x + 10, y + 25)-(x + 5, y + 30), 14 + LINE (x + 10, y + 25)-(x + 15, y + 30), 14 + LINE (x + 15, y + 30)-(x + 25, y + 30), 14 + LINE (x + 10, y + 20)-(x + 25, y + 20), 14 + CASE 6 + ' Draw the sixth symbol + LINE (x + 5, y + 5)-(x + 10, y + 5), 14 + LINE (x + 5, y + 5)-(x + 5, y + 10), 14 + LINE (x + 10, y + 10)-(x + 10, y + 15), 14 + LINE (x + 10, y + 15)-(x + 20, y + 30), 14 + LINE (x + 20, y + 30)-(x + 25, y + 30), 14 + LINE (x + 5, y + 30)-(x + 10, y + 30), 14 + LINE (x + 25, y + 15)-(x + 10, y + 30), 14 + CASE 7 + ' Draw the seventh symbol + LINE (x + 5, y + 15)-(x + 10, y + 15), 14 + LINE (x + 10, y + 15)-(x + 25, y + 5), 14 + LINE (x + 5, y + 25)-(x + 10, y + 25), 14 + LINE (x + 10, y + 25)-(x + 15, y + 5), 14 + LINE (x + 20, y + 5)-(x + 20, y + 20), 14 + PSET (x + 15, y + 25), 14 + PSET (x + 22, y + 25), 14 + CASE 8 + ' Draw the eighth symbol + LINE (x + 15, y + 10)-(x + 15, y + 25), 14 + LINE (x + 20, y + 15)-(x + 20, y + 25), 14 + LINE (x + 5, y + 20)-(x + 10, y + 25), 14 + LINE (x + 10, y + 25)-(x + 25, y + 25), 14 + CASE 9 + ' Draw the ninth symbol + LINE (x + 5, y + 5)-(x + 25, y + 5), 14 + LINE (x + 15, y + 5)-(x + 5, y + 20), 14 + LINE (x + 15, y + 5)-(x + 25, y + 20), 14 + LINE (x + 15, y + 5)-(x + 15, y + 25), 14 + LINE (x + 5, y + 30)-(x + 20, y + 20), 14 + END SELECT +END SUB + +SUB setColorPalette(paletteIndex) + ' Set the color palette based on the input value + SELECT CASE paletteIndex + CASE 2 + ' Set the colors for palette 2 + FOR colorIndex = 0 TO 14 + OUT &H3C8, colorIndex + OUT &H3C9, colorIndex * 2 + OUT &H3C9, colorIndex * 4.5 + OUT &H3C9, colorIndex * 3 + NEXT colorIndex + CASE 1 + ' Set the colors for palette 1 + FOR colorIndex = 0 TO 14 + OUT &H3C8, colorIndex + OUT &H3C9, 0 + OUT &H3C9, 0 + OUT &H3C9, 0 + NEXT colorIndex + ' Set the color for the background + OUT &H3C8, 15 + OUT &H3C9, 20 + OUT &H3C9, 63 + OUT &H3C9, 63 + END SELECT +END SUB + +SUB smoothPixels(x1, y1, x2, y2, recursionDepth) + ' Initialize the smoothing variable + smoothingValue = 0 + ' Perform horizontal smoothing + FOR y = y1 TO y2 + FOR x = x1 TO x2 + ' Get the current pixel value + currentPixelValue = POINT(x, y) + ' Update the smoothing variable + smoothingValue = smoothingValue - 5 + ' Ensure the smoothing variable is non-negative + IF smoothingValue < 0 THEN smoothingValue = 0 + ' Update the smoothing variable if the current pixel value is greater + IF currentPixelValue > smoothingValue THEN smoothingValue = currentPixelValue + ' Set the smoothed pixel value + PSET (x, y), smoothingValue + NEXT x + NEXT y + ' Perform vertical smoothing + FOR x = x1 TO x2 + smoothingValue = 0 + FOR y = y1 TO y2 + ' Get the current pixel value + currentPixelValue = POINT(x, y) + ' Update the smoothing variable + smoothingValue = smoothingValue - 5 + ' Ensure the smoothing variable is non-negative + IF smoothingValue < 0 THEN smoothingValue = 0 + ' Update the smoothing variable if the current pixel value is greater + IF currentPixelValue > smoothingValue THEN smoothingValue = currentPixelValue + ' Set the smoothed pixel value + PSET (x, y), smoothingValue + NEXT y + NEXT x + ' Perform diagonal smoothing + FOR y = y1 TO y2 + smoothingValue = 0 + FOR x = x1 TO x2 + ' Get the current pixel value + currentPixelValue = POINT(x, y) + ' Update the smoothing variable + smoothingValue = smoothingValue - 5 + ' Ensure the smoothing variable is non-negative + IF smoothingValue < 0 THEN smoothingValue = 0 + ' Update the smoothing variable if the current pixel value is greater + IF currentPixelValue > smoothingValue THEN smoothingValue = currentPixelValue + ' Set the smoothed pixel value + PSET (x, y), smoothingValue + NEXT x + NEXT y + ' Perform diagonal smoothing in the opposite direction + FOR x = x1 TO x2 + smoothingValue = 0 + FOR y = y2 TO y1 STEP -1 + ' Get the current pixel value + currentPixelValue = POINT(x, y) + ' Update the smoothing variable + smoothingValue = smoothingValue - 5 + ' Ensure the smoothing variable is non-negative + IF smoothingValue < 0 THEN smoothingValue = 0 + ' Update the smoothing variable if the current pixel value is greater + IF currentPixelValue > smoothingValue THEN smoothingValue = currentPixelValue + ' Set the smoothed pixel value + PSET (x, y), smoothingValue + NEXT y + NEXT x + ' Check if the recursion depth is equal to 1 + IF recursionDepth = 1 THEN GOTO ExitSmoothing + ' Increment the recursion depth + newRecursionDepth = recursionDepth + 1 + ' Perform horizontal smoothing with averaging + FOR y = y1 TO y2 + smoothingValue = 0 + FOR x = x1 TO x2 + ' Get the current pixel value + currentPixelValue = POINT(x, y) + ' Update the smoothed pixel value using averaging + smoothingValue = (smoothingValue * recursionDepth + currentPixelValue) / newRecursionDepth + ' Ensure the smoothed pixel value is non-negative + finalSmoothingValue = smoothingValue - recursionDepth + IF finalSmoothingValue < 0 THEN finalSmoothingValue = 0 + ' Set the final smoothed pixel value + PSET (x, y), finalSmoothingValue + NEXT x + NEXT y + ' Perform vertical smoothing with averaging + FOR x = x1 TO x2 + smoothingValue = 0 + FOR y = y1 TO y2 + ' Get the current pixel value + currentPixelValue = POINT(x, y) + ' Update the smoothing variable + smoothingValue = smoothingValue - 5 + ' Ensure the smoothing variable is non-negative + IF smoothingValue < 0 THEN smoothingValue = 0 + ' Update the smoothing variable if the current pixel value is greater + IF currentPixelValue > smoothingValue THEN smoothingValue = currentPixelValue + ' Set the smoothed pixel value + PSET (x, y), smoothingValue + NEXT y + NEXT x + ' Perform diagonal smoothing with averaging + FOR y = y1 TO y2 + smoothingValue = 0 + FOR x = x2 TO x1 STEP -1 + ' Get the current pixel value + currentPixelValue = POINT(x, y) + ' Update the smoothing variable + smoothingValue = smoothingValue - 5 + ' Ensure the smoothing variable is non-negative + IF smoothingValue < 0 THEN smoothingValue = 0 + ' Update the smoothing variable if the current pixel value is greater + IF currentPixelValue > smoothingValue THEN smoothingValue = currentPixelValue + ' Set the smoothed pixel value + PSET (x, y), smoothingValue + NEXT x + NEXT y + ' Perform diagonal smoothing in the opposite direction with averaging + FOR x = x1 TO x2 + smoothingValue = 0 + FOR y = y2 TO y1 STEP -1 + ' Get the current pixel value + currentPixelValue = POINT(x, y) + ' Update the smoothing variable + smoothingValue = smoothingValue - 5 + ' Ensure the smoothing variable is non-negative + IF smoothingValue < 0 THEN smoothingValue = 0 + ' Update the smoothing variable if the current pixel value is greater + IF currentPixelValue > smoothingValue THEN smoothingValue = currentPixelValue + ' Set the smoothed pixel value + PSET (x, y), smoothingValue + NEXT y + NEXT x +ExitSmoothing: +END SUB + +SUB initializeScreen + ' Set the screen mode to 12 + SCREEN 12 + ' Set the color palette to 1 + setColorPalette 1 + ' Load the fonts + loadFonts + ' Set the color palette to 2 + setColorPalette 2 +END SUB diff --git a/2D GFX/Animations/matrix.webm b/2D GFX/Animations/matrix.webm new file mode 100644 index 0000000..2b10e3f Binary files /dev/null and b/2D GFX/Animations/matrix.webm differ diff --git a/2D GFX/Animations/matrix2.bas b/2D GFX/Animations/matrix2.bas new file mode 100755 index 0000000..5b1787d --- /dev/null +++ b/2D GFX/Animations/matrix2.bas @@ -0,0 +1,103 @@ +' Program to render animation inspired by opening scene from The Matrix movie. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2002, Initial version +' 2024, Improved program readability + +DEFINT A-Z +DECLARE SUB DisplayMatrix () +DIM SHARED matrixArray(1 TO 20) +DIM SHARED lineLength +DIM SHARED displayMessage$ +RANDOMIZE 2 + +CLS +COLOR 10, 0 +displayMessage$ = "" +frameCounter = 0 +iterationCount = 0 +DisplayMatrix + +1 : ' Label for looping + +' Creates high-pitch pulsing sound by toggling it on and off while iterating +soundFrequency = 0 +IF iterationCount >= 3 THEN soundFrequency = 10000: iterationCount = 0 +SOUND soundFrequency, .2 +iterationCount = iterationCount + 1 + +frameCounter = frameCounter + 1 +IF frameCounter > 100 THEN DisplayMatrix: frameCounter = 0 + +displayLine$ = "" +lineIndex = 1 +FOR column = 1 TO 80 + lineIndex = lineIndex + 1 + randomCharacter$ = CHR$(INT(RND * 9) + 48) + IF lineIndex > lineLength THEN lineIndex = 1: randomCharacter$ = " " + displayLine$ = displayLine$ + randomCharacter$ +NEXT column +LOCATE 25, 1 +PRINT displayLine$ +IF INKEY$ <> "" THEN COLOR 7, 0: CLS : SYSTEM +GOTO 1 + +SUB DisplayMatrix + ' Set the viewport to print from line 1 to line 25 + VIEW PRINT 1 TO 25 + + ' Display a message based on the code decoding progress + SELECT CASE lineLength + CASE 13 + displayMessage$ = "Are you sure the line is clear?" + CASE 6 + displayMessage$ = " Then I'll go ..." + END SELECT + + ' Clear and print the message at position (1, 30) + LOCATE 1, 30 + PRINT " " + LOCATE 1, 30 + PRINT displayMessage$ + + randomValue = INT(RND * 9) + 1 + FOR pass = 1 TO 3 + FOR value = randomValue TO 10 + IF matrixArray(value) = -1 THEN + ' Assign a random value between 1 and 8 to the array element + matrixArray(value) = INT(RND * 8) + 1 + lineLength = lineLength - 1 + GOTO 2 + END IF + NEXT value + ' Reset randomValue if no valid position is found + randomValue = 1 + NEXT pass + + ' Reset the length and initialize the array + lineLength = 13 + FOR index = 1 TO 20 + matrixArray(index) = -1 + NEXT index + + CLS + IF displayMessage$ <> "" THEN SYSTEM + +2 : ' Label for continuing after GOTO + FOR index = 1 TO 20 + LOCATE 1, index + ' Display a space if the array element is -1, otherwise display the value + IF matrixArray(index) = -1 THEN displayChar$ = " " ELSE displayChar$ = STR$(matrixArray(index)) + displayChar$ = RIGHT$(displayChar$, 1) + PRINT displayChar$ + NEXT index + + ' Set the viewport to print from line 2 to line 25 + VIEW PRINT 2 TO 25 +END SUB + diff --git a/2D GFX/Animations/matrix2.webm b/2D GFX/Animations/matrix2.webm new file mode 100644 index 0000000..fb8d08d Binary files /dev/null and b/2D GFX/Animations/matrix2.webm differ diff --git a/2D GFX/Animations/maze.BAS b/2D GFX/Animations/maze.BAS new file mode 100755 index 0000000..b903011 --- /dev/null +++ b/2D GFX/Animations/maze.BAS @@ -0,0 +1,144 @@ +' Render animated 3D maze. +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2002, Initial version +' 2024 - 2025, Improved program readability + +DECLARE FUNCTION getWord& (memoryAddress!) +DECLARE FUNCTION getByte! (memoryAddress!) +DECLARE SUB displayIntroText () +DECLARE SUB handleUserInput () +DECLARE SUB writeByteToMemory (memoryAddress!, dataValue!) +DECLARE SUB writeWordToMemory (memoryAddress!, dataValue!) +DECLARE SUB initializeProgram () +DECLARE SUB renderMaze () + +DIM SHARED pointX(1 TO 5000) +DIM SHARED pointY(1 TO 5000) +DIM SHARED pointZ(1 TO 5000) +DIM SHARED rotatedPointX(1 TO 5000) +DIM SHARED rotatedPointY(1 TO 5000) +DIM SHARED rotatedPointE(1 TO 5000) +DIM SHARED lineStartIndex(1 TO 5000) +DIM SHARED lineEndIndex(1 TO 5000) +DIM SHARED lineColor(1 TO 5000) +DIM SHARED numberOfLines, numberOfPoints +DIM SHARED angleXZ, angleYZ +DIM SHARED externalSegment, externalAddress +DIM SHARED viewerX, viewerY, viewerZ +DIM SHARED buttonLeft, buttonRight +DIM SHARED maxMovement + +numberOfLines = 0 +numberOfPoints = 0 + +' Initialize the program and set up the screen +initializeProgram + +' Initialize maze starting point +mazeX = 0 +mazeY = 0 +mazeZ = 0 +numberOfPoints = 1 +pointX(1) = 0 +pointY(1) = 0 +pointZ(1) = 0 + +' Main loop +1 +frameCounter = frameCounter + 1 +viewerX = SIN(frameCounter / 30) * 100 +viewerZ = COS(frameCounter / 59) * 100 +viewerY = SIN(frameCounter / 300) +angleXZ = SIN(frameCounter / 60) +angleYZ = SIN(frameCounter / 36) / 3 + +' Add a new point to the maze +numberOfPoints = numberOfPoints + 1 +pointX(numberOfPoints) = mazeX +pointY(numberOfPoints) = mazeY +pointZ(numberOfPoints) = mazeZ + +' Add a new line to the maze +numberOfLines = numberOfLines + 1 +lineStartIndex(numberOfLines) = numberOfPoints +lineEndIndex(numberOfLines) = numberOfPoints - 1 +lineColor(numberOfLines) = INT(RND * 15) + 1 + +' Pick random axis (dimension) where next segment of the maze should appear +mazeGrowthDirection = INT(RND * 3) +SELECT CASE mazeGrowthDirection + CASE 0 + mazeX = RND * 500 - 250 + CASE 1 + mazeY = RND * 100 - 50 + CASE 2 + mazeZ = RND * 500 - 250 +END SELECT + +' Render the maze +renderMaze + +' Copy and clear the screen +PCOPY 0, 1 +CLS + +' Limit animation speed by making 0 Hz sound with fixed duration +SOUND 0, 1 + +' Exit condition +IF frameCounter > 1200 THEN GOTO 200 +GOTO 1 + +200 + +SUB renderMaze + ' Calculate sine and cosine values for the rotation angles + sinAngleXZ = SIN(angleXZ) + sinAngleYZ = SIN(angleYZ) + cosAngleXZ = COS(angleXZ) + cosAngleYZ = COS(angleYZ) + + ' Rotate and project points + FOR index = 1 TO numberOfPoints + x = pointX(index) - viewerX + y = pointY(index) - viewerY + z = pointZ(index) - viewerZ + + ' First rotation around Y axis + rotatedXAfterFirstRotation = x * cosAngleXZ + z * sinAngleXZ + rotatedZAfterFirstRotation = z * cosAngleXZ - x * sinAngleXZ + + ' Second rotation around X axis + rotatedYAfterSecondRotation = y * cosAngleYZ + rotatedZAfterFirstRotation * sinAngleYZ + rotatedZAfterSecondRotation = rotatedZAfterFirstRotation * cosAngleYZ - y * sinAngleYZ + + ' Check if point is behind the viewer + IF rotatedZAfterSecondRotation > 3 THEN + rotatedPointE(index) = 1 + rotatedPointX(index) = rotatedXAfterFirstRotation / rotatedZAfterSecondRotation * 130 + 160 + rotatedPointY(index) = rotatedYAfterSecondRotation / rotatedZAfterSecondRotation * 130 + 100 + ELSE + rotatedPointE(index) = 0 + END IF + NEXT index + + ' Draw lines between visible points + FOR index = 1 TO numberOfLines + lineStart = lineStartIndex(index) + lineEnd = lineEndIndex(index) + IF (rotatedPointE(lineStart) = 1) AND (rotatedPointE(lineEnd) = 1) THEN + LINE (rotatedPointX(lineStart), rotatedPointY(lineStart))-(rotatedPointX(lineEnd), rotatedPointY(lineEnd)), lineColor(index) + END IF + NEXT index +END SUB + +SUB initializeProgram + ' Set the screen mode and initialize maximum movement value + SCREEN 7, , , 1 + maxMovement = 50 +END SUB diff --git a/2D GFX/Animations/maze.webm b/2D GFX/Animations/maze.webm new file mode 100644 index 0000000..1e8e253 Binary files /dev/null and b/2D GFX/Animations/maze.webm differ diff --git a/2D GFX/Animations/programming is fun.BAS b/2D GFX/Animations/programming is fun.BAS new file mode 100755 index 0000000..4ef4268 --- /dev/null +++ b/2D GFX/Animations/programming is fun.BAS @@ -0,0 +1,48 @@ +SCREEN 7, , , 1 + +1 +FOR a = 1 TO SIN(frame / 30) * 3 + 4 + LOCATE a * 2, a * 4 + COLOR RND * 5 + 10 + PRINT "Programming is fun!" +NEXT a + +' Update frame and calculate new values for x, y and step size. +frame = frame + 1 +stepSize = (SIN(frame / 10) + 2) / 3 +xPos = SIN(frame / 30) * 50 +yPos = COS(frame / 42) * 30 + +' Draw circles with varying arc sizes. +FOR a = .1 TO 10 STEP stepSize + CIRCLE (160 + xPos, 100 + yPos), 80, 2, , , a +NEXT a + +' Generate random color value for lines. +randomColor = RND * 2 + 12 +FOR a = 0 TO 10 + f1 = (a + frame) / 12 + f2 = (a + frame) / 7 + x1 = SIN(f1) * 50 + y1 = COS(f1) * 30 + x2 = SIN(f2 + 6) * 50 + y2 = COS(f2 + 6) * 30 + ' Draw line between calculated points. + LINE (x1 + 180, y1 + 150)-(x2 + 180, y2 + 150), randomColor +NEXT a + +' Draw random pixels on the screen. Like colorful stars in the night sky. +FOR a = 0 TO 50 + xRand = RND * 320 + yRand = RND * 320 + PSET (xRand, yRand), RND * 15 +NEXT a + +' Copy the current screen to the next page and clear the current screen. +PCOPY 0, 1 +CLS + +' Check if frame count has exceeded the limit; if so, chain to another program. +IF INKEY$ <> "" THEN SYSTEM +GOTO 1 + diff --git a/2D GFX/Animations/programming is fun.webm b/2D GFX/Animations/programming is fun.webm new file mode 100644 index 0000000..1da56eb Binary files /dev/null and b/2D GFX/Animations/programming is fun.webm differ diff --git a/2D GFX/Animations/sun&eart.bas b/2D GFX/Animations/sun&eart.bas new file mode 100755 index 0000000..8e5dc0f --- /dev/null +++ b/2D GFX/Animations/sun&eart.bas @@ -0,0 +1,96 @@ +' Projects animation of the sun, earth and moon. +' The moon orbits the earth, and the earth orbits the sun. +' The program uses clever trickery to determine +' the drawing order of the objects based on their y-coordinates. + +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 1999, Initial version +' 2024, Improved program readability + + +DECLARE SUB drawEarthMoonSystem (a2!, b2!, c2!) + +DIM SHARED moonX +DIM SHARED moonY +SCREEN 7, , , 1 + +' Initialize the earth rotation angle +earthRotationAngle = 0 + +' Main loop to update and draw the objects +1 : + ' Increment the earthRotationAngle for every frame + earthRotationAngle = earthRotationAngle + .01 + + ' Calculate the x and y coordinates of the earth + earthX = SIN(earthRotationAngle) * 100 + 100 + earthY = COS(earthRotationAngle) * 30 + 100 + + ' Because we dont do proper earth, moon and sun Z-sorting, + ' instead we implement clever trickery to determine, should + ' sun be drawn before earth-moon system, or after. + IF earthY >= 100 THEN + ' Draw the sun + CIRCLE (100, 100), 50, 12 + PAINT (100, 100), 12 + END IF + + ' Call the subroutine to draw the earth-moon system + drawEarthMoonSystem earthX, earthY, (earthY - 70) / 2 + 2 + + IF earthY < 100 THEN + ' Draw the sun + CIRCLE (100, 100), 50, 12 + PAINT (100, 100), 12 + END IF + + ' Copy the screen to buffer + PCOPY 0, 1 + + ' Clear the screen + CLS + + ' Check if a key is pressed + IF INKEY$ = "" THEN GOTO 1 + +' End the program +SYSTEM + +SUB drawEarthMoonSystem (a2, b2, c2) + moonSize = (b2 - 70) / 2 + 2 + + ' Increment the moon's x and y coordinates + moonX = moonX + .1 + moonY = moonY + .01 + + ' Calculate the x and y offsets for the moon + moonOffsetX = SIN(moonX) * moonSize * 2 + moonOffsetY = COS(moonX) * 10 + + ' Because we don't do proper earth and moon Z-sorting, + ' instead we implement clever trickery to determine, should + ' earth be drawn before moon or after. + IF moonOffsetY > 0 THEN + ' Draw the earth + CIRCLE (a2, b2), c2, 1 + PAINT (a2, b2), 1 + END IF + + ' Calculate the x and y coordinates of the moon and draw it + moonXCoord = moonOffsetX + a2 + moonYCoord = moonOffsetY + b2 + CIRCLE (moonXCoord, moonYCoord), ((moonOffsetY + 20) * moonSize) \ 50, 14 + PAINT (moonXCoord, moonYCoord), 14 + + IF moonOffsetY <= 0 THEN + ' Draw the earth + CIRCLE (a2, b2), c2, 1 + PAINT (a2, b2), 1 + END IF +END SUB + diff --git a/2D GFX/Animations/text mode animation.bas b/2D GFX/Animations/text mode animation.bas new file mode 100755 index 0000000..6f8206e --- /dev/null +++ b/2D GFX/Animations/text mode animation.bas @@ -0,0 +1,202 @@ +' Program to render fancy looking text mode animations. +' Various effects are overlaid on top of each other +' while program scrolls it's own source code in the background. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.10, Initial version +' 2024, Improved program readability + +DECLARE SUB displayScreen () +DECLARE SUB drawCircle () +DECLARE SUB drawLines () +DECLARE SUB fillBuffer () +DECLARE SUB updateDisplay () +DIM SHARED pi +DIM SHARED angle +DIM SHARED frameCounter +DIM SHARED buffer2(1 TO 50, 1 TO 80) AS STRING * 1 +DIM SHARED buffer(1 TO 50, 1 TO 80) AS STRING * 1 +DIM SHARED colors(1 TO 50, 1 TO 80) AS INTEGER + +DIM SHARED verticalLinePosition, horizontalLinePosition +DIM SHARED verticalLineSpeed, horizontalLineSpeed + +WIDTH 80, 50 +VIEW PRINT 1 TO 50 +pi = 3.14159 +OPEN "mkcircle.bas" FOR INPUT AS #1 + +CLS + +horizontalLinePosition = 20 +horizontalLineSpeed = 1 +verticalLinePosition = 20 +verticalLineSpeed = 1 + +1 +frameCounter = frameCounter + 1 + +displayScreen +fillBuffer +drawLines +drawCircle +updateDisplay +IF INKEY$ <> "" THEN GOTO 2 +GOTO 1 +2 +CLOSE #1 +SYSTEM + +SUB updateDisplay +' This subroutine updates the display with the contents of the buffer +COLOR 7, 0 +LOCATE 1, 1 +FOR y = 1 TO 50 + FOR x = 1 TO 80 + COLOR colors(y, x) + PRINT buffer(y, x); + ' Swap the contents of buffer and buffer2 + buffer(y, x) = buffer2(y, x) + colors(y, x) = 4 + NEXT x +NEXT y + +END SUB + +SUB fillBuffer +' This subroutine fills the buffer with a pattern +COLOR 4, 0 +sizeMultiplier = SIN(frameCounter / 7) + 1.1 + +angle = angle + SIN(frameCounter / 30) / 10 +radiusXPosition = 50 - SIN(angle + pi / 4) * 12 * 20 * sizeMultiplier +radiusYPosition = 50 - COS(angle + pi / 4) * 12 * 20 * sizeMultiplier + +stepXPosition = SIN(angle) * 6 * sizeMultiplier +stepYPosition = COS(angle) * 6 * sizeMultiplier +radiusStepXPosition = SIN(angle + pi / 2) * 6 * sizeMultiplier +radiusStepYPosition = COS(angle + pi / 2) * 6 * sizeMultiplier + +FOR y = 1 TO 50 + radiusXPosition = radiusXPosition + radiusStepXPosition + radiusYPosition = radiusYPosition + radiusStepYPosition + +4 +IF radiusXPosition > 100 THEN radiusXPosition = radiusXPosition - 100: GOTO 4 +IF radiusXPosition < 0 THEN radiusXPosition = radiusXPosition + 100: GOTO 4 +IF radiusYPosition > 100 THEN radiusYPosition = radiusYPosition - 100: GOTO 4 +IF radiusYPosition < 0 THEN radiusYPosition = radiusYPosition + 100: GOTO 4 + +currentXPosition = radiusXPosition +currentYPosition = radiusYPosition + +FOR x = 1 TO 80 + characterCode = 0 + currentXPosition = currentXPosition + stepXPosition + currentYPosition = currentYPosition + stepYPosition + +3 +IF currentXPosition > 100 THEN currentXPosition = currentXPosition - 100: GOTO 3 +IF currentXPosition < 0 THEN currentXPosition = currentXPosition + 100: GOTO 3 +IF currentYPosition > 100 THEN currentYPosition = currentYPosition - 100: GOTO 3 +IF currentYPosition < 0 THEN currentYPosition = currentYPosition + 100: GOTO 3 + +IF currentXPosition < 12 OR currentYPosition < 12 THEN buffer(y, x) = "*": colors(y, x) = 9 +NEXT x +NEXT y +END SUB + +SUB drawCircle +' This subroutine draws a circle on the screen +circleSize = (SIN(frameCounter / 10) + 1.01) * 30 +circleYPosition = SIN(frameCounter / 12) * 30 + 40 +circleXPosition = COS(frameCounter / 17) * 15 + 25 + +FOR y = 1 TO 50 + xPositionOffset = SIN(y / 5 + frameCounter / 30) * circleSize / 10 + +IF (y >= circleYPosition - circleSize) AND (y <= circleYPosition + circleSize) THEN + +halfHeight1 = SQR((y - (circleYPosition - circleSize)) * ((circleYPosition + circleSize) - y)) +IF (y >= circleYPosition - circleSize / 2) AND (y <= circleYPosition + circleSize / 2) THEN halfHeight2 = SQR((y - (circleYPosition - circleSize / 2)) * ((circleYPosition + circleSize / 2) - y)) ELSE halfHeight2 = 0 + +startXPosition = circleXPosition - halfHeight1 + xPositionOffset +IF startXPosition < 1 THEN startXPosition = 1 +endXPosition = circleXPosition - halfHeight2 + xPositionOffset +IF endXPosition > 80 THEN endXPosition = 80 + +FOR x = startXPosition TO endXPosition + buffer(y, x) = CHR$(RND * 40 + 48) + colors(y, x) = RND * 15 +NEXT x + +startXPosition = circleXPosition + halfHeight2 + xPositionOffset +IF startXPosition < 1 THEN startXPosition = 1 +endXPosition = circleXPosition + halfHeight1 + xPositionOffset +IF endXPosition > 80 THEN endXPosition = 80 + +FOR x = startXPosition TO endXPosition + buffer(y, x) = CHR$(RND * 200 + 32) + colors(y, x) = RND * 15 +NEXT x + +END IF + +NEXT y + +END SUB + +SUB drawLines +' This subroutine draws vertical and horizontal lines on the screen +verticalLinePosition = verticalLinePosition + verticalLineSpeed +IF verticalLinePosition > 49 THEN verticalLineSpeed = -1 +IF verticalLinePosition < 2 THEN verticalLineSpeed = 1 + +horizontalLinePosition = horizontalLinePosition + horizontalLineSpeed +IF horizontalLinePosition > 79 THEN horizontalLineSpeed = -1 +IF horizontalLinePosition < 2 THEN horizontalLineSpeed = 1 + +FOR x = 1 TO 80 + IF buffer(verticalLinePosition, x) = "*" THEN characterCode = 31 ELSE characterCode = 10 + buffer(verticalLinePosition, x) = "#" + colors(verticalLinePosition, x) = characterCode +NEXT x + +FOR y = 1 TO 50 + IF buffer(y, horizontalLinePosition) = "*" THEN characterCode = 31 ELSE characterCode = 10 + buffer(y, horizontalLinePosition) = "#" + colors(y, horizontalLinePosition) = characterCode +NEXT y +END SUB + +SUB displayScreen +' This subroutine displays the text from a file on the screen +IF EOF(1) <> 0 THEN + CLOSE 1 + OPEN "mkcircle.bas" FOR INPUT AS #1 +END IF + +LINE INPUT #1, lineText$ + +FOR y = 1 TO 49 +FOR x = 1 TO 80 + buffer2(y, x) = buffer2(y + 1, x) +NEXT x +NEXT y + +FOR x = 1 TO 80 + buffer2(50, x) = " " +NEXT x + +IF LEN(lineText$) > 80 THEN lineText$ = LEFT$(lineText$, 80) +FOR b = 1 TO LEN(lineText$) + character$ = RIGHT$(LEFT$(lineText$, b), 1) + buffer2(50, b) = character$ +NEXT b + +END SUB diff --git a/2D GFX/Animations/text mode animation.webm b/2D GFX/Animations/text mode animation.webm new file mode 100644 index 0000000..0dc2a21 Binary files /dev/null and b/2D GFX/Animations/text mode animation.webm differ diff --git a/2D GFX/Animations/txtpal.bas b/2D GFX/Animations/txtpal.bas new file mode 100755 index 0000000..21f1ae8 --- /dev/null +++ b/2D GFX/Animations/txtpal.bas @@ -0,0 +1,102 @@ +' This application produces beautiful colorful horizontal rainbows on the screen in text mode. +' It works only on CRT monitors, because it accomplishes the effect by changing the color palette +' while the CRT monitor is drawing the screen. As a result, unlimited number of colors can be +' displayed on the screen simultaneously, regardless of the video card's color depth. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2003.01, Initial version +' 2024, Improved program readability + +DEFINT A-Z +CLS +COLOR 7 + +' Fill background with random colored random numbers. +FOR b = 1 TO 500 + COLOR RND * 15 + PRINT RND; +NEXT b + +' Set the background and text colors +COLOR 0, 1 + +' Clear rectangular area +FOR y = 5 TO 20 + FOR x = 20 TO 50 + LOCATE y, x + PRINT " " + NEXT x +NEXT y + +' Print "[ TEST ]" at position (10, 25) +LOCATE 10, 25 +PRINT "[ TEST ]" + +' Print "[ TEST ]" in color 2 at position (15, 37) +LOCATE 15, 37 +COLOR 2 +PRINT "[ TEST ]" + +' Initialize variables +wa = 1 +p = &H3DA + +' Loop to wait until CRT monitor has drawn single frame +1 +' measure how much time was spent waiting for screen redraw to complete +w = w + 1 + +' Check if monitor is still drawing frame +a = INP(p) +IF a >= 128 THEN a = a - 128 +IF a >= 64 THEN a = a - 64 +IF a >= 32 THEN a = a - 32 +IF a >= 16 THEN a = a - 16 +IF a < 8 THEN GOTO 1 + +frm = frm + 1 +IF frm > 10000 THEN frm = -10000 + +' Adjust the color palette change speed so that it takes approximately all of the time +' when Ray is actually moving along screen surface and is drawing pixels. +' So if we had to wait too long for drawing to complete at the end, it means +' next frame we can be slower with our palette updates. +IF w > 300 THEN wa = wa + 1 ELSE wa = wa - 1 +IF w < 250 THEN wa = wa - 5 +IF w > 3000 THEN wa = wa + 30 +IF w > 1000 THEN wa = wa + 5 + +' Check if a key has been pressed +IF INKEY$ <> "" THEN + ' Reset color palette + OUT &H3C8, 0 + OUT &H3C9, 0 + OUT &H3C9, 0 + OUT &H3C9, 0 + ' exit application + SYSTEM +END IF + +' Alter video graphics color palette while CRT screen in drawing scanlines simultaneously +FOR a = 0 TO 70 + + b = a * 6 + frm + + ' Alter palette within video card + OUT &H3C8, 0 + OUT &H3C9, SIN(b / 20) * 30 + 30 + OUT &H3C9, SIN(b / 27) * 30 + 30 + OUT &H3C9, SIN(b / 31) * 30 + 30 + + ' Delay to give time for CRT screen to complete horizontal scanlines + FOR u = 1 TO wa + NEXT u +NEXT a + +w = 0 +GOTO 1 diff --git a/2D GFX/Fractals/fractal circles animated.bas b/2D GFX/Fractals/fractal circles animated.bas new file mode 100755 index 0000000..56a48a0 --- /dev/null +++ b/2D GFX/Fractals/fractal circles animated.bas @@ -0,0 +1,442 @@ +DECLARE SUB playSoundEffect (soundEffect$) +DECLARE SUB initializeGraphics () +DECLARE SUB drawEllipse (xCoord!, yCoord!, size!, colorValue!, aspectRatio!) +DECLARE SUB printMessage (xCoord!, yCoord!, message$, size!, colr!) +DECLARE SUB addTimerElement (elementIndex!, time!, value!) +DECLARE SUB initializeTimers () +DECLARE SUB processTimers () +DECLARE SUB drawFractal (xCoord!, yCoord!, angle!, size!, direction!) + +' Program that renders animation that contains fractal composed from circles. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + + +' Shared variables for global state +DIM SHARED recursionDepth +DIM SHARED pi + +' Variables to store shapes and timers +DIM SHARED shapeSize1, shapeSize2, sizeValue1, sizeValue2, horizontalPosition, verticalPosition +DIM SHARED timerTime(0 TO 50, 0 TO 100) +DIM SHARED timerValue(0 TO 50, 0 TO 100) + +' Variables to store current timer states +DIM SHARED timerCurrentPlace(0 TO 50) +DIM SHARED timerCurrentTime(0 TO 50) +DIM SHARED timerCurrentValue(0 TO 50) +DIM SHARED timerLastFrameTime + +' Initialize pi with a constant value +pi = 3.14128 + +' Turn on the screen and initialize timers +initializeGraphics + +' Set up graphics mode +SCREEN 7, , , 1 + +' Initialize the timer system +initializeTimers + +' Main loop variable +frameSize = 50 + +' Main loop label +MainLoop: + ' Calculate sine and cosine values for animation + sinValue = SIN(timerCurrentValue(1) * 1.3) * .5 + 1.1 + cosValue = COS(timerCurrentValue(1) * 1.3) * .5 + 1.1 + + ' Increment frame counter + frameCounter = frameCounter + 1 + + ' Calculate shape sizes and positions + sizeValue1 = 5 * sinValue + sizeValue2 = 2 + verticalPosition = SIN(timerCurrentValue(1) * 1.3) + shapeSize1 = 2 * cosValue + shapeSize2 = 1.4 + horizontalPosition = SIN(timerCurrentValue(1)) * .7 + + ' Draw the main fractal object + drawFractal timerCurrentValue(2), timerCurrentValue(3), timerCurrentValue(4), timerCurrentValue(0), 0 + + ' Draw ellipses + drawEllipse 100, timerCurrentValue(6), timerCurrentValue(7) + 4, 14, .5 + drawEllipse 100, timerCurrentValue(6), timerCurrentValue(7) + 2, 10, .5 + drawEllipse 100, timerCurrentValue(6), timerCurrentValue(7), 0, .5 + + ' Print messages + printMessage timerCurrentValue(5), 10, "KHK", 7, 250 + printMessage timerCurrentValue(8), 130, "Infotehno-", 2, 0 + printMessage timerCurrentValue(8), 150, " loogia", 2, 0 + + ' Process the timers + processTimers + LOCATE 1, 1 + + ' Check if the main loop should exit + IF timerCurrentTime(0) > 26 THEN SYSTEM + + ' Make off-screen buffer visible + PCOPY 0, 1 + + ' Clear off-screen buffer with white background color in preparation to draw new frame + LINE (0, 0)-(319, 199), 15, BF + + ' Go back to the main loop + GOTO MainLoop + +' Subroutine to draw an ellipse +SUB drawEllipse (xCoord!, yCoord!, size!, colorValue!, aspectRatio!) + ' Draw an ellipse if xCoord and yCoord are positive + IF xCoord > 0 THEN + IF yCoord > 0 THEN + CIRCLE (xCoord, yCoord), size, colorValue, , , aspectRatio + PAINT (xCoord, yCoord), colorValue + END IF + END IF +END SUB + +' Subroutine to draw animated fractal +SUB drawFractal (xCoord!, yCoord!, angle!, size!, direction!) + ' Variables: + ' direction - indicates fractal branch direction + ' size - fractal fragment current size + ' angle - fractal twist angle + ' xCoord and yCoord - fractal fragment current position + + ' Increment fragment depth counter + recursionDepth = recursionDepth + 1 + + ' If size is less than .2, skip drawing + IF size < .2 THEN GOTO SkipDrawing + + ' Determine color based on depth + IF recursionDepth / 2 = recursionDepth \ 2 THEN + colr = 1 + ELSE + colr = 3 + END IF + + ' Draw the circle and fill it with the determined color + CIRCLE (xCoord, yCoord), size, colr + PAINT (xCoord, yCoord), colr + + ' Recursively draw child objects of the fractal if direction is not equal to 1 + IF direction <> 1 THEN + x1 = SIN(angle) * size * 2.5 + xCoord + y1 = COS(angle) * size * 2.5 + yCoord + ' Change size based on the value of direction + IF direction = 3 THEN + newSize = size / sizeValue2 + ELSE + newSize = size / sizeValue1 + END IF + drawFractal x1, y1, angle + verticalPosition, newSize, 3 + END IF + + ' Recursively draw child objects if direction is not equal to 2 + IF direction <> 2 THEN + x1 = SIN(angle - pi / 2) * size * 2.5 + xCoord + y1 = COS(angle - pi / 2) * size * 2.5 + yCoord + ' Change size based on the value of direction + IF direction = 4 THEN + newSize = size / shapeSize2 + ELSE + newSize = size / shapeSize1 + END IF + drawFractal x1, y1, angle + horizontalPosition, newSize, 4 + END IF + + ' Recursively draw child objects if direction is not equal to 3 + IF direction <> 3 THEN + x1 = SIN(angle - pi) * size * 2.5 + xCoord + y1 = COS(angle - pi) * size * 2.5 + yCoord + ' Change size based on the value of direction + IF direction = 1 THEN + newSize = size / sizeValue2 + ELSE + newSize = size / sizeValue1 + END IF + drawFractal x1, y1, angle + verticalPosition, newSize, 1 + END IF + + ' Recursively draw child objects if direction is not equal to 4 + IF direction <> 4 THEN + x1 = SIN(angle - pi * 1.5) * size * 2.5 + xCoord + y1 = COS(angle - pi * 1.5) * size * 2.5 + yCoord + ' Change size based on the value of direction + IF direction = 2 THEN + newSize = size / shapeSize2 + ELSE + newSize = size / shapeSize1 + END IF + drawFractal x1, y1, angle + horizontalPosition, newSize, 2 + END IF + +SkipDrawing: + ' Decrement depth counter + recursionDepth = recursionDepth - 1 +END SUB + +' Subroutine to print a message on the screen +SUB printMessage (xCoord!, yCoord!, message$, size!, colr!) + ' Check if xCoord is out of bounds + IF xCoord < 0 THEN GOTO PrintMessageExit + IF xCoord > 319 THEN GOTO PrintMessageExit + + ' Buffer to save a portion of the screen + DIM screenBuffer(10000) + + ' Save a portion of the screen to buffer + GET (0, 0)-(100, 7), screenBuffer + + ' Print the message on the screen + LOCATE 1, 1 + PRINT message$ + + ' Determine the color for the text + textColor = colr + + ' Loop through each character in the message + FOR x = 0 TO LEN(message$) * 8 - 1 + ' Loop through each pixel in the character + FOR y = 0 TO 7 + ' Check if the pixel is part of the character + IF POINT(x, y) > 0 THEN + ' Calculate the coordinates for the enlarged pixel + resizedX = x * size + xCoord + resizedY = y * size + yCoord + ' Draw the pixel based on the color value + IF colr > 100 THEN + textColor = RND * 4 + 10 + ' Draw a solid box or outlined box based on the color value + IF colr > 200 THEN + LINE (resizedX, resizedY)-(resizedX + size - 1, resizedY + size - 1), textColor, B + ELSE + LINE (resizedX, resizedY)-(resizedX + size - 1, resizedY + size - 1), textColor, BF + END IF + END IF + END IF + NEXT y + NEXT x + + ' Restore the saved portion of the screen + PUT (0, 0), screenBuffer, PSET + +PrintMessageExit: +END SUB + +' Subroutine to add a timer element +SUB addTimerElement (elementIndex!, time!, value!) + ' Loop through each element in the timer array + FOR index = 0 TO 100 + ' Check if the current element is empty + IF (timerTime(elementIndex, index) = 0) AND (timerValue(elementIndex, index) = 0) THEN GOTO AddTimerElement + NEXT index + +AddTimerElement: + ' Add the new timer element + timerTime(elementIndex, index) = time + timerValue(elementIndex, index) = value +END SUB + +' Subroutine to initialize the timer system +SUB initializeTimers + ' Store the current time + timerLastFrameTime = TIMER + + ' Set the pause duration + pauseDuration = 24 + + ' Initialize size values + addTimerElement 0, 0, 50 + addTimerElement 0, 7, 10 + addTimerElement 0, 20, 10 + addTimerElement 0, 24, 0 + addTimerElement 0, 1000, 0 + + ' Initialize speed values + addTimerElement 1, 0, .1 + addTimerElement 1, 1000, 1000 + + ' Initialize X & Y positions + addTimerElement 2, 0, 160 + addTimerElement 3, 0, 100 + addTimerElement 2, 5, 160 + addTimerElement 3, 5, 100 + addTimerElement 2, 9, 280 + addTimerElement 3, 9, 160 + addTimerElement 2, 10, 280 + addTimerElement 3, 10, 160 + addTimerElement 2, 20, 40 + addTimerElement 3, 20, 160 + addTimerElement 2, 1000, 40 + addTimerElement 3, 1000, 160 + + ' Initialize rotation values + addTimerElement 4, 0, .1 + addTimerElement 4, 10, .1 + addTimerElement 4, 22, 18 + addTimerElement 4, 2000, 10000 + + ' Initialize KHK message X position + addTimerElement 5, 0, -1 + addTimerElement 5, 5, -1 + addTimerElement 5, 9, 50 + addTimerElement 5, 10, 30 + addTimerElement 5, pauseDuration, 30 + addTimerElement 5, pauseDuration + 2, 321 + + ' Initialize ellips Y & radius + addTimerElement 6, 0, -1 + addTimerElement 6, 4, -1 + addTimerElement 6, 10, 30 + addTimerElement 6, 1000, 50 + addTimerElement 7, 0, 1 + addTimerElement 7, 6, 1 + addTimerElement 7, 12, 130 + addTimerElement 7, pauseDuration, 130 + addTimerElement 7, pauseDuration + 2, 1 + + ' Initialize "Infotehnoloogia" message X position + addTimerElement 8, 0, 320 + addTimerElement 8, 11, 320 + addTimerElement 8, 20, 100 + addTimerElement 8, pauseDuration, 100 + addTimerElement 8, pauseDuration + 1, -1 +END SUB + +' Subroutine to process the timers +SUB processTimers + ' Store the current time + currentTime = TIMER + + ' Calculate the time difference since last frame + timeDifference = currentTime - timerLastFrameTime + + ' Update the last frame time + timerLastFrameTime = currentTime + + ' Loop through each timer element + FOR elementIndex = 0 TO 50 + ' Calculate the current time and value of each element + currentElementTime = timerCurrentTime(elementIndex) + timeDifference + currentElementPlace = timerCurrentPlace(elementIndex) + +ProcessTimerElement: + ' Check if the next timer element is empty + IF timerTime(elementIndex, currentElementPlace + 1) = -1 THEN + ' Reset the current time and value + currentElementTime = 0 + currentElementPlace = 0 + END IF + + ' Update the current time and value of each element + IF timerTime(elementIndex, currentElementPlace + 1) < currentElementTime THEN + ' Check if the next timer element is empty + IF timerTime(elementIndex, currentElementPlace + 1) = 0 THEN + ' Set the current value to the current timer value + timerCurrentValue(elementIndex) = timerValue(elementIndex, currentElementPlace) + GOTO UpdateTimerElement + END IF + ' Move to the next timer element + currentElementPlace = currentElementPlace + 1 + GOTO ProcessTimerElement + END IF + + ' Interpolate the current value based on time difference + value1 = timerValue(elementIndex, currentElementPlace) + time1 = timerTime(elementIndex, currentElementPlace) + value2 = timerValue(elementIndex, currentElementPlace + 1) + time2 = timerTime(elementIndex, currentElementPlace + 1) + + IF value1 = value2 THEN + ' Set the current value to the first value + timerCurrentValue(elementIndex) = value1 + ELSE + ' Calculate the time difference and value difference + timeDiff1 = time2 - time1 + timeDiff2 = currentElementTime - time1 + valueDiff = value2 - value1 + ' Interpolate the current value + timerCurrentValue(elementIndex) = timeDiff2 / timeDiff1 * valueDiff + value1 + END IF + +UpdateTimerElement: + ' Update the current place and time of each element + timerCurrentPlace(elementIndex) = currentElementPlace + timerCurrentTime(elementIndex) = currentElementTime + NEXT elementIndex +END SUB + +' Subroutine to turn on the screen +SUB initializeGraphics + ' Set up graphics mode + SCREEN 7, , , 1 + + ' Draw initial shapes + FOR x = 0 TO 160 STEP 15 + LINE (160 - x - 5, 90 - 5)-(160 + x + 5, 110 + 5), 1, BF + LINE (160 - x - 3, 90 - 3)-(160 + x + 3, 110 + 3), 3, BF + LINE (160 - x, 90)-(160 + x, 110), 15, BF + + ' Copy screen buffer and clear the screen + PCOPY 0, 1 + CLS + + ' Use sound function to create delay, to limit animation speed + SOUND 0, .5 + NEXT x + + ' Draw additional shapes + FOR y = 10 TO 100 STEP 15 + CLS + LINE (160 - x - 5, 90 - y - 5)-(160 + x + 5, 110 + y + 5), 1, BF + LINE (160 - x - 3, 90 - y - 3)-(160 + x + 3, 110 + y + 3), 3, BF + LINE (160 - x, 90 - y)-(160 + x, 110 + y), 15, BF + PCOPY 0, 1 + SOUND 0, .5 + NEXT y + + ' Draw zeroes and ones at random locations for decoration + FOR counter = 1 TO 25 + printMessage RND * 250, RND * 180, STR$(INT(RND * 2)), 3, 0 + + ' Copy screen buffer and clear the screen + PCOPY 0, 1 + + ' Use sound function to create delay, to limit animation speed + SOUND 0, 1 + NEXT counter + + ' Buffer to save parts of the screen + DIM screenPartBuffer(1 TO 1000) + + ' Shift parts of the screen randomly + FOR shiftCounter = 1 TO 30 + FOR lineCounter = 0 TO 195 + threshold = ABS(100 - lineCounter) + + ' Check if a random condition is met + IF RND * 50 < threshold THEN + GET (1, lineCounter)-(318, lineCounter + 1), screenPartBuffer + + ' Shift the screen buffer + IF lineCounter > 100 THEN + PUT (0, lineCounter), screenPartBuffer, PSET + ELSE + PUT (2, lineCounter), screenPartBuffer, PSET + END IF + END IF + NEXT lineCounter + + ' Copy screen buffer and clear the screen + PCOPY 0, 1 + NEXT shiftCounter +END SUB diff --git a/2D GFX/Fractals/fractal circles animated.webm b/2D GFX/Fractals/fractal circles animated.webm new file mode 100644 index 0000000..f112e49 Binary files /dev/null and b/2D GFX/Fractals/fractal circles animated.webm differ diff --git a/2D GFX/Fractals/fractal circles.bas b/2D GFX/Fractals/fractal circles.bas new file mode 100755 index 0000000..f5c1665 --- /dev/null +++ b/2D GFX/Fractals/fractal circles.bas @@ -0,0 +1,121 @@ +DECLARE SUB drawFractal (x!, y!, angle AS SINGLE, size AS SINGLE, w AS INTEGER) +' Renders a spiral fractal made up of circles using recursion. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024.08, Improved program readability + +' Declare shared variables to be used across the program +DIM SHARED depth AS INTEGER +DIM SHARED pi AS SINGLE + +' Define scaling factors for horizontal and vertical directions +DIM SHARED scaleH1 AS SINGLE, scaleH2 AS SINGLE, scaleV1 AS SINGLE, scaleV2 AS SINGLE +DIM SHARED hp AS SINGLE, vp AS SINGLE + +' Initialize constants +pi = 3.14159 + +SCREEN 12 ' Set the screen mode to 12 for better graphics quality + +' Define scaling factors and direction variables +scaleV1 = 5 ' Vertical scale factor for one direction +scaleV2 = 2 ' Vertical scale factor for another direction +vp = .2 ' Vertical angle increment + +scaleH1 = 2 ' Horizontal scale factor for one direction +scaleH2 = 1.4 ' Horizontal scale factor for another direction +hp = .2 ' Horizontal angle increment + +' Start the fractal drawing process from the center of the screen +drawFractal 320, 240, pi - .9, 50, 0 + +' Wait for user input to exit the program gracefully +a$ = INPUT$(1) +SYSTEM ' Terminate the program + +SUB drawFractal (x, y, angle AS SINGLE, size AS SINGLE, w AS INTEGER) + depth = depth + 1 ' Increment the recursion depth + + IF size < .2 THEN GOTO 1 ' Base case for recursion termination + + ' Determine color based on the current depth + IF depth MOD 2 = 0 THEN + c = 15 ' White + ELSE + c = 10 ' Light green + END IF + + CIRCLE (x, y), size, c ' Draw a circle at the current position and size with specified color + PAINT (x, y), c ' Fill the circle to create a solid shape + + ' Recursive calls for different directions based on the parameter w + IF w <> 1 THEN + ' Calculate new coordinates after rotating angle + vp degrees + x1 = SIN(angle) * size * 2.5 + x + y1 = COS(angle) * size * 2.5 + y + + ' Determine scaling factor based on the direction + IF w = 3 THEN + newSize = size / scaleV2 + ELSE + newSize = size / scaleV1 + END IF + + drawFractal x1, y1, angle + vp, newSize, 3 ' Recursive call to the same subroutine with updated parameters + END IF + + IF w <> 2 THEN + ' Calculate new coordinates after rotating angle - pi/2 degrees + x1 = SIN(angle - .5 * pi) * size * 2.5 + x + y1 = COS(angle - .5 * pi) * size * 2.5 + y + + ' Determine scaling factor based on the direction + IF w = 4 THEN + newSize = size / scaleH2 + ELSE + newSize = size / scaleH1 + END IF + + drawFractal x1, y1, angle + hp, newSize, 4 ' Recursive call to the same subroutine with updated parameters + END IF + + IF w <> 3 THEN + ' Calculate new coordinates after rotating angle - pi degrees + x1 = SIN(angle - pi) * size * 2.5 + x + y1 = COS(angle - pi) * size * 2.5 + y + + ' Determine scaling factor based on the direction + IF w = 1 THEN + newSize = size / scaleV2 + ELSE + newSize = size / scaleV1 + END IF + + drawFractal x1, y1, angle + vp, newSize, 1 ' Recursive call to the same subroutine with updated parameters + END IF + + IF w <> 4 THEN + ' Calculate new coordinates after rotating angle - pi*3/2 degrees + x1 = SIN(angle - 1.5 * pi) * size * 2.5 + x + y1 = COS(angle - 1.5 * pi) * size * 2.5 + y + + ' Determine scaling factor based on the direction + IF w = 2 THEN + newSize = size / scaleH2 + ELSE + newSize = size / scaleH1 + END IF + + drawFractal x1, y1, angle + hp, newSize, 2 ' Recursive call to the same subroutine with updated parameters + END IF + +1 + depth = depth - 1 ' Decrement recursion depth after all recursive calls are made +END SUB + diff --git a/2D GFX/Fractals/fractal circles.png b/2D GFX/Fractals/fractal circles.png new file mode 100644 index 0000000..5d03f87 Binary files /dev/null and b/2D GFX/Fractals/fractal circles.png differ diff --git a/2D GFX/Fractals/fractal squares animated.bas b/2D GFX/Fractals/fractal squares animated.bas new file mode 100755 index 0000000..6b62704 --- /dev/null +++ b/2D GFX/Fractals/fractal squares animated.bas @@ -0,0 +1,44 @@ +' Animated fractal that is made of size shifting squares. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.04, Initial version +' 2024.08, Improved program readability + + +DECLARE SUB drawFractal (x!, y!, s!) +DIM SHARED recursionDepth +DIM SHARED factor1, factor2, factor3, factor4 +SCREEN 7, , , 1 + +recursionDepth = 1 + +1 +frameCount = frameCount + 1 +factor1 = SIN(frameCount / 19) * 1 + 3 +factor2 = SIN(frameCount / 12) * 1 + 3 +factor3 = SIN(frameCount / 17) * 1 + 3 +factor4 = SIN(frameCount / 22) * 1 + 3 +PCOPY 0, 1 +CLS +drawFractal 160, 100, 40 +SOUND 0, .4 +userInput$ = INKEY$ +IF userInput$ <> "" THEN SYSTEM +GOTO 1 + +SUB drawFractal (x, y, s) + IF s > 1 THEN + recursionDepth = recursionDepth + 1 + LINE (x - s, y - s)-(x + s, y + s), recursionDepth, BF + drawFractal x - s, y - s, s / factor1 + drawFractal x + s, y - s, s / factor2 + drawFractal x + s, y + s, s / factor3 + drawFractal x - s, y + s, s / factor4 + recursionDepth = recursionDepth - 1 + END IF +END SUB diff --git a/2D GFX/Fractals/fractal squares animated.webm b/2D GFX/Fractals/fractal squares animated.webm new file mode 100644 index 0000000..b29f1b4 Binary files /dev/null and b/2D GFX/Fractals/fractal squares animated.webm differ diff --git a/2D GFX/Fractals/fractal squares, 1.png b/2D GFX/Fractals/fractal squares, 1.png new file mode 100644 index 0000000..4aab922 Binary files /dev/null and b/2D GFX/Fractals/fractal squares, 1.png differ diff --git a/2D GFX/Fractals/fractal squares, 2.png b/2D GFX/Fractals/fractal squares, 2.png new file mode 100644 index 0000000..f2fcbcb Binary files /dev/null and b/2D GFX/Fractals/fractal squares, 2.png differ diff --git a/2D GFX/Fractals/fractal squares.bas b/2D GFX/Fractals/fractal squares.bas new file mode 100755 index 0000000..638b02b --- /dev/null +++ b/2D GFX/Fractals/fractal squares.bas @@ -0,0 +1,53 @@ +DECLARE SUB drawFractalPattern (centerX!, centerY!, size!) +DIM SHARED currentColor ' This variable holds the color of the fractal and is accessible within submodules. + +' Program renders fractal that is made from squares. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + + +' Set the screen to high-resolution graphics mode. +SCREEN 12 + +' Initialize the fractal color. +currentColor = 10 + +' Draw a single fractal pattern at the center of the screen with a size of 127. +drawFractalPattern 320, 240, 127 + +' Loop to create a delay using the SOUND command. +FOR iterationCounter = 1 TO 50 + SOUND 0, 1 ' This creates a short delay by generating an inaudible sound. +NEXT iterationCounter + +' Clear the screen to prepare for the next set of drawings. +CLS + +' Loop to draw a series of fractal patterns with varying sizes and random colors. +FOR iterationCounter = 1 TO 128 STEP 5 + currentColor = RND * 7 + 7 ' Set the fractal color to a random value between 7 and 14. + drawFractalPattern 320, 240, iterationCounter ' Draw the fractal pattern with the current size. +NEXT iterationCounter + +' Loop to create another delay using the SOUND command. +FOR iterationCounter = 1 TO 50 + SOUND 0, 1 ' This creates a short delay by generating an inaudible sound. +NEXT iterationCounter + +' Subroutine to draw a fractal pattern using recursion. +SUB drawFractalPattern (centerX, centerY, size) + ' Check if the size is greater than or equal to 1 to continue drawing. + IF size >= 1 THEN + ' Draw a square (box) centered at (centerX, centerY) with the current color. + LINE (centerX - size, centerY - size)-(centerX + size, centerY + size), currentColor, B + + ' Recursively call the subroutine to draw smaller fractal patterns at the corners of the current square. + drawFractalPattern centerX - size, centerY - size, size / 2.3 + drawFractalPattern centerX + size, centerY - size, size / 2.3 + drawFractalPattern centerX + size, centerY + size, size / 2.3 + drawFractalPattern centerX - size, centerY + size, size / 2.3 + END IF +END SUB diff --git a/2D GFX/Fractals/fractal trees.bas b/2D GFX/Fractals/fractal trees.bas new file mode 100755 index 0000000..fe74278 --- /dev/null +++ b/2D GFX/Fractals/fractal trees.bas @@ -0,0 +1,54 @@ +' Animated tree fractal. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.04, Initial version +' 2024.08, Improved program readability + +DECLARE SUB generateFractal (x!, y!, s!) + +DECLARE SUB generateArt (x!, y!, s!) +DIM SHARED modifier1, modifier2, modifier3 +DIM SHARED vector1X, vector1Y +DIM SHARED vector2X, vector2Y +DIM SHARED vector3X, vector3Y +SCREEN 7, , , 1 + +1 +frame = frame + 1 +modifier1 = SIN(frame / 19) + 3 +modifier2 = SIN(frame / 12) + 3 +modifier3 = SIN(frame / 17) + 3 + +vector1X = SIN(frame / 13) / 3 + 1 +vector1Y = SIN(frame / 18) / 3 + 1 + +vector2X = SIN(frame / 20) / 3 + 1 +vector2Y = SIN(frame / 28) / 3 + 1 + +vector3X = SIN(frame / 31) / 3 + 1 +vector3Y = SIN(frame / 24) / 3 + 1 + +PCOPY 0, 1 +CLS +generateFractal 160, 180, 80 +SOUND 0, .5 +inputKey$ = INKEY$ +IF inputKey$ <> "" THEN SYSTEM +GOTO 1 + +SUB generateFractal (x, y, s) + IF s > 1 THEN + LINE (x, y)-(x - s * vector1X, y - s * vector1Y), 15 + LINE (x, y)-(x + s * vector2X, y - s * vector2Y), 15 + LINE (x, y)-(x, y - s), 15 + generateFractal x - s * vector1X, y - s * vector1Y, s / modifier1 + generateFractal x + s * vector2X, y - s * vector2Y, s / modifier2 + generateFractal x, y - s, s / modifier3 + END IF +END SUB + diff --git a/2D GFX/Fractals/fractal trees.webm b/2D GFX/Fractals/fractal trees.webm new file mode 100644 index 0000000..9d4fa52 Binary files /dev/null and b/2D GFX/Fractals/fractal trees.webm differ diff --git a/2D GFX/Fractals/index.html b/2D GFX/Fractals/index.html new file mode 100644 index 0000000..96269ef --- /dev/null +++ b/2D GFX/Fractals/index.html @@ -0,0 +1,321 @@ + + + + + + + +Fractals + + + + + + +
+

Fractals

+ + + + +
+

1. Fractal circles

+
+ +
+

fractal%20circles.png +

+
+ +

+Source code +

+
+
+ +
+

2. Fractal circles animated

+
+
+ +
+

+Source code +

+
+
+ +
+

3. Fractal of squares

+
+ +
+

fractal%20squares,%201.png +

+
+ + +
+

fractal%20squares,%202.png +

+
+
+
+ +
+

4. Fractal of squares animated

+
+
+ +
+

+Source code +

+
+
+ +
+

5. Fractal of trees

+
+
+ +
+

+Source code +

+
+
+
+
+

Created: 2025-07-28 ma 03:32

+

Validate

+
+ + diff --git a/2D GFX/Fractals/index.org b/2D GFX/Fractals/index.org new file mode 100644 index 0000000..0480898 --- /dev/null +++ b/2D GFX/Fractals/index.org @@ -0,0 +1,79 @@ +#+TITLE: Fractals +#+LANGUAGE: en +#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry} +#+LATEX_HEADER: \usepackage{parskip} +#+LATEX_HEADER: \usepackage[none]{hyphenat} + +#+OPTIONS: H:20 num:20 +#+OPTIONS: author:nil + +#+begin_export html + +#+end_export + + +* Fractal circles + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:fractal circles.bas][file:fractal%20circles.png]] + +[[file:fractal circles.bas][Source code]] + +* Fractal circles animated +#+begin_export html +
+ +
+#+end_export +[[file:fractal circles animated.bas][Source code]] + +* Fractal of squares + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:fractal squares.bas][file:fractal%20squares,%201.png]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:fractal squares.bas][file:fractal%20squares,%202.png]] + +* Fractal of squares animated +#+begin_export html +
+ +
+#+end_export +[[file:fractal squares animated.bas][Source code]] + +* Fractal of trees +#+begin_export html +
+ +
+#+end_export +[[file:fractal trees.bas][Source code]] diff --git a/2D GFX/Hello friend.bas b/2D GFX/Hello friend.bas new file mode 100755 index 0000000..93dade2 --- /dev/null +++ b/2D GFX/Hello friend.bas @@ -0,0 +1,39 @@ +' 2D graphics demonstration. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + + +SCREEN 13 + +LOCATE 1, 1 +PRINT " Hello friend!" + +' Loop through each pixel in the screen to create an enlarged version of the current screen +FOR x = 0 TO 160 + FOR y = 0 TO 32 + colorVal = POINT(x, y) + x1 = x * 2 + y1 = y * 2 + 90 + LINE (x1, y1)-(x1 + 1, y1 + 1), colorVal, BF + NEXT y +NEXT x + +LOCATE 1, 1 +PRINT " " + +' Draw a series of circles along the screen +FOR x = 0 TO 320 + CIRCLE (x, 130), 10, 9 + SOUND 0, .1 +NEXT x + +' Draw horizontal lines creating an X pattern +FOR y = 0 TO 70 + SOUND 0, .1 + LINE (160 - 70 + y, y)-(160 + 70 - y, y), 9 +NEXT y + + diff --git a/2D GFX/Hello friend.png b/2D GFX/Hello friend.png new file mode 100644 index 0000000..c75768f Binary files /dev/null and b/2D GFX/Hello friend.png differ diff --git a/2D GFX/People.bas b/2D GFX/People.bas new file mode 100755 index 0000000..60161a5 --- /dev/null +++ b/2D GFX/People.bas @@ -0,0 +1,895 @@ +' Example slideshow presentation. Includes animated transitions. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2001, Initial version +' 2024 - 2025, Improved program readability + + +DECLARE SUB displaySlide1 () +DECLARE SUB setink (a!) +DECLARE SUB inke (a$) +DECLARE SUB mkjuku (x!, y!, a!, c!) +DECLARE SUB pr (x!, y!, s!, c!, n!, a$) +DECLARE SUB wpr () +DECLARE SUB displayEffect7 () +DECLARE SUB displaySlide6 () +DECLARE SUB displaySlide5 () +DECLARE SUB pal4 (c, r!, g!, b!) +DECLARE SUB displaySlide4 () +DECLARE SUB inpur () +DECLARE SUB displayEffect5 () +DECLARE SUB displaySlide3 () +DECLARE SUB prin (x1!, y1!, s!, c, a$) +DECLARE SUB pal3 (r!, g!, b!) +DECLARE SUB mkfont () +DECLARE SUB pal2 (r!, g!, b!) +DECLARE SUB box1 (x1!, y1!, x2!, y2!, c!) +DECLARE SUB mkback () +DECLARE SUB displaySlide2 () +DECLARE SUB resiz () +DECLARE SUB pri (x!, y!, a$, c!) +DECLARE SUB deca (xs!, ys!, fx!, fy!) +DECLARE SUB box (xs!, ys!) +DECLARE SUB displayEffect4 () +DECLARE SUB displayEffect3 () +DECLARE SUB displayEffect2 () +DECLARE SUB displayEffect1 () +DECLARE SUB start () +DECLARE SUB sc1 () +DECLARE SUB pal (x!) +DIM SHARED fontt(0 TO 7, 0 TO 7, 0 TO 255) +DIM SHARED tim +DIM SHARED tim2 +DIM SHARED jas(1 TO 500) +DIM SHARED pii +DIM SHARED tmr +DIM SHARED ink +DIM SHARED tim$ + +start + +CLS +'GOTO 8 + +displaySlide1 +displayEffect1 +displayEffect2 +displayEffect3 + +displayEffect4 +displaySlide2 +displaySlide4 +8 +displaySlide5 +displaySlide6 + +displayEffect7 +displaySlide3 +displayEffect5 + +SYSTEM + +SUB box (xs, ys) +' Draws a 3D style box border at the top-left corner of the screen +' Parameters: +' xs - width of the box +' ys - height of the box + +LINE (0, 186)-(0 + xs, 186 - ys), 15, B +LINE (1, 187)-(-1 + xs, 187 - ys), 25, B +LINE (2, 188)-(-2 + xs, 188 - ys), 15, B +PSET (0, 188), 0 +PSET (0 + xs, 188), 0 +PSET (0, 186 - ys), 0 +PSET (0 + xs, 186 - ys), 0 +END SUB + +DEFINT Z +SUB box1 (x1, y1, x2, y2, c) + +' Draws a shaded box with a 3D effect +' Parameters: +' x1, y1 - top-left corner coordinates +' x2, y2 - bottom-right corner coordinates +' c - type of shading + +IF c = 1 THEN za = 51 ELSE za = 102 + +FOR zy = y1 + 7 TO y2 + 7 +FOR zx = x1 + 7 TO x2 + 7 +zc = POINT(zx, zy) +IF zc < 51 THEN +IF zc > 25 THEN zc = 50 - zc +zc = zc / 2 +PSET (zx, zy), zc +END IF +NEXT zx +NEXT zy + +FOR zy = y1 TO y2 +FOR zx = x1 TO x2 +zc = POINT(zx, zy) +IF zc > 50 THEN zc = zc - 51 +PSET (zx, zy), zc + za +NEXT zx +NEXT zy + +END SUB + +DEFSNG Z +SUB deca (xs, ys, fx, fy) +LINE (0, 185 - ys)-(xs, 185 - ys + fy), 0, BF +LINE (xs, 18 - ys)-(xs - fx, 188), 0, BF +xs = xs - fx +ys = ys - fy +box xs, ys +END SUB + +SUB displayEffect1 + +pal 3 + +DIM buf1(1 TO 10000) +DIM buf2(1 TO 10000) +DIM buf3(1 TO 400) + +FOR a = 1 TO 320 +buf3(a) = 200 +NEXT a + +b = 0 +c1 = 1 +setink 10 +1 +c1 = c1 + 1 +IF c1 > 50 THEN c1 = 1 +LINE (0, 40)-(0, 43), c1 +c2 = c1 +IF c2 > 25 THEN c2 = 50 - c2 +c2 = c2 - 5 +IF c2 < 0 THEN c2 = 0 +PSET (0, 39), c2 +PSET (0, 44), c2 +LINE (319, 76)-(319, 79), c1 +PSET (319, 75), c2 +PSET (319, 80), c2 + +GET (0, 39)-(318, 44), buf1(1) +PUT (1, 39), buf1(1), PSET + +GET (1, 75)-(319, 80), buf1(1) +PUT (0, 75), buf1(1), PSET + +b = b + 1 +buf3(271) = SIN(b / 50 + 1.57) * 30 + 160 +FOR x = 50 TO 270 +PSET (x, buf3(x) - 1), 0 +IF x > 50 THEN +PSET (x, buf3(x)), 15 +PSET (x, buf3(x) + 1), 20 +PSET (x, buf3(x) + 2), 25 +END IF +buf3(x) = buf3(x + 1) +NEXT x + +a = 50 +FOR x = 65 + 18 TO 270 STEP 40 +a = a + 1 +IF buf3(x - 1) < 190 THEN +mkjuku x, buf3(x - 1) - 27, x, 0 +mkjuku x, buf3(x) - 27, x, a +END IF +NEXT x + +inke a$ +SOUND 0, .4 +IF a$ = "" THEN GOTO 1 + +END SUB + +SUB displayEffect2 + +FOR a = 1 TO 30 +e = 0 +c = (3.8 * (30 - a)) / 30 + +FOR f = 0 TO 50 +IF f < 25 THEN e = e + 4 ELSE e = e - c +OUT &H3C8, f +OUT &H3C9, e / 4 +OUT &H3C9, e / 1.9 +OUT &H3C9, e / 3 +NEXT f + +FOR b = 1 TO 3 +SOUND 0, .3 +NEXT b +NEXT a + +FOR a = 20 TO 0 STEP -1 +b = (a * 4) / 20 +e = 0 +FOR f = 0 TO 60 +IF f < 25 THEN e = e + b +OUT &H3C8, f +OUT &H3C9, e / 4 +OUT &H3C9, e / 1.9 +OUT &H3C9, e / 3 +NEXT f + +FOR b = 1 TO 2 +SOUND 0, .3 +NEXT b + +NEXT a + +END SUB + +SUB displayEffect3 +SCREEN 7 +SCREEN 7, , , 1 + +OUT &H3C8, 1 +OUT &H3C9, 64 / 4 +OUT &H3C9, 64 / 1.9 +OUT &H3C9, 64 / 3 + +b = 2 +c = .01 +2 +x = x + 1 +y = y + 1 +c = c + .01 +b = b + c + +FOR a = 0 TO 160 STEP b +LINE (160 + a, 0)-(160 + a, 199), 1 +LINE (160 - a, 0)-(160 - a, 199), 1 +LINE (0, 100 + a)-(319, 100 + a), 1 +LINE (0, 100 - a)-(319, 100 - a), 1 +NEXT a + +PCOPY 0, 1 +CLS +SOUND 0, .4 +IF b < 50 THEN GOTO 2 + +SCREEN 13 +pal 2 + +FOR a = 0 TO 160 STEP b +LINE (160 + a, 0)-(160 + a, 199), 25 +LINE (160 - a, 0)-(160 - a, 199), 25 +LINE (0, 100 + a)-(319, 100 + a), 25 +LINE (0, 100 - a)-(319, 100 - a), 25 +NEXT a + +resiz +pal 3 + +pri 11, 8, "-* A U T H O R S *-", 55 +pri 10, 11, CHR$(254) + " John Doe", 55 +pri 10, 13, CHR$(254) + " Jane Doe", 55 +pri 10, 15, CHR$(254) + " Anonymous", 55 +pri 20, 19, "year 2001", 55 + +inpur +CLS +END SUB + +SUB displayEffect4 +pal 2 +xs = 317 +ys = 185 +box xs, ys +tey = 20 + +DIM buf4(1 TO 10000) + +b = 0 +setink 10 +COLOR 25 +4 +b = b + 1 + +SELECT CASE b +CASE 50 TO 200 +deca xs, ys, 1, 1 + +CASE 201 +'pal4 255, 63, 45, 0 +'prin 10, tey, 2, 255, "Sources:" +tey = tey + 20 + +CASE 290 +pal4 254, 20, 20, 63 +prin 70, tey, 7, 254, "TEST" +tey = tey + 60 + +CASE 350 +pal4 254, 20, 20, 63 +prin 100, tey, 2, 254, "www.12345.com" +tey = tey + 20 + +CASE 400 +pal4 254, 20, 20, 63 +prin 100, tey, 2, 254, CHR$(16) + "Subject 1" +tey = tey + 10 + +END SELECT + +FOR a = 2 TO (xs - 5) / 8 +LOCATE 23, a +PRINT CHR$(RND * 1 + 48) +NEXT a + +FOR x = 3 TO xs - 3 STEP 8 +GET (x, 183 - ys + 14)-(x + 7, 183), buf4(1) +PUT (x, 183 - ys + 6), buf4(1), PSET +NEXT x + +inke a$ + +IF a$ <> "" THEN GOTO 3 +wpr +GOTO 4 + +3 +END SUB + +SUB displayEffect5 +DIM buf(1 TO 5000) + +FOR a = 1 TO 1000 +x = RND * 298 + 1 +y = RND * 178 + 1 +GET (x, y)-(x + 19, y + 19), buf(1) +IF RND * 100 < 50 THEN x = x + 1 ELSE x = x - 1 +IF RND * 100 < 50 THEN y = y + 1 +PUT (x, y), buf(1), PSET +SOUND 0, .05 +NEXT a + +FOR a = 0 TO 100 +LINE (0, a)-(319, a), 0 +LINE (0, 200 - a)-(319, 200 - a), 0 +SOUND 0, .4 +NEXT a + +END SUB + +SUB displayEffect7 +pal 4 +mkback + +pal2 0, 0, 32 +box1 3, 3, 300, 50, 1 + +pal4 255, 50, 50, 0 +prin 10, 10, 2, 255, "Et dolore magna" +prin 50, 30, 1, 255, "www.utenimadminim.org" + +pal3 20, 32, 63 +box1 20, 40, 290, 180, 2 + +pal4 254, 63, 45, 0 +b = 25 +prin 40, 60, 1, 254, CHR$(254) + " Ut enim ad minim veniam" +a = b +prin 40, 60 + a, 1, 254, CHR$(254) + " Quis nostrud exercitation" +a = a + b +prin 40, 60 + a, 1, 254, CHR$(254) + " Laboris nisi ut aliquip ex" +a = a + b +prin 40, 60 + a, 1, 254, CHR$(254) + " Sed ut perspiciatis unde" + +inpur + +END SUB + +SUB displaySlide1 + +pal 2 +LOCATE 1, 1 +COLOR 1 +PRINT "HEADER" + +FOR x = 0 TO 80 +FOR y = 0 TO 16 +c = POINT(x, y) +IF c > 0 THEN c1 = 50 ELSE c1 = 0 +LINE (x * 5 + 35, y * 3 + 50)-(x * 5 + 4 + 35, y * 3 + 2 + 50), c1, BF +NEXT y +NEXT x + +LOCATE 1, 1 +PRINT " " + +FOR y = 30 TO 80 +FOR x = 0 TO 319 +c = POINT(x, y) +c1 = (c1 * 1 + c) / 2 +PSET (x, y), c1 +NEXT x +NEXT y + +FOR x = 0 TO 319 +FOR y = 30 TO 80 +c = POINT(x, y) +c1 = (c1 * 1 + c) / 2 +PSET (x, y), c1 +NEXT y +NEXT x + +FOR y = 30 TO 80 +FOR x = 319 TO 0 STEP -1 +c = POINT(x, y) +c1 = (c1 * 1 + c) / 2 +PSET (x, y), c1 +NEXT x +NEXT y + +FOR x = 0 TO 319 +FOR y = 80 TO 30 STEP -1 +c = POINT(x, y) +c1 = (c1 * 1 + c) / 2 +PSET (x, y), c1 +NEXT y +NEXT x + +END SUB + +SUB displaySlide2 + +CLS +pal 4 +mkback + +pal2 40, 64, 63 +pal3 0, 0, 0 + +box1 30, 30, 290, 170, 1 + +prin 65, 50, 3, 0, "Goal:" + +prin 40, 100, 1, 0, CHR$(254) + " Random text" +prin 40, 108, 1, 0, " goes here to test" +prin 40, 116, 1, 0, " text layout." +prin 40, 130, 1, 0, CHR$(254) + " Testing 123." + +inpur + +END SUB + +SUB displaySlide3 +mkback + +pal2 64, 64, 0 +box1 30, 30, 290, 150, 1 + +prin 57, 50, 3, 0, "Thank you" +prin 45, 74, 3, 0, " for" +prin 45, 98, 3, 0, "attention" +inpur + +END SUB + +SUB displaySlide4 + +pal 4 +mkback + +pal2 0, 0, 32 +box1 3, 3, 260, 50, 1 + +pal4 255, 50, 50, 0 +prin 10, 10, 2, 255, "Random header" +prin 50, 30, 1, 255, "www.randomsite.org" + +pal3 10, 20, 0 +box1 20, 40, 290, 180, 2 + +pal4 254, 63, 45, 0 + +b = 25 +prin 40, 60, 1, 254, CHR$(254) + " Lorem ipsum dolor sit amet," +a = b +prin 40, 60 + a, 1, 254, CHR$(254) + " consectetur adipiscing elit," +a = a + b +prin 40, 60 + a, 1, 254, CHR$(254) + " sed do eiusmod" +a = a + b +prin 40, 60 + a, 1, 254, CHR$(254) + " tempor incididunt ut labore" + +inpur + +END SUB + +SUB displaySlide5 +pal 4 +mkback + +pal2 0, 0, 32 +box1 3, 3, 300, 50, 1 + +pal4 255, 50, 50, 0 +prin 10, 10, 2, 255, "Totam rem aperiam" +prin 50, 30, 1, 255, "www.randomurl.org" + +pal3 20, 32, 63 +box1 20, 40, 290, 180, 2 + +pal4 254, 63, 45, 0 +b = 25 +prin 40, 60, 1, 254, CHR$(254) + " Nemo enim ipsam voluptatem" +a = b +prin 40, 60 + a, 1, 254, CHR$(254) + " Sed quia consequuntur" +a = a + b +prin 40, 60 + a, 1, 254, CHR$(254) + " Magni dolores eos" +a = a + b +prin 40, 60 + a, 1, 254, CHR$(254) + " Qui ratione voluptatem" + +inpur + +END SUB + +SUB displaySlide6 +pal 4 +mkback + +pal2 0, 0, 32 +box1 3, 3, 300, 50, 1 + +pal4 255, 50, 50, 0 +prin 10, 10, 2, 255, "H E L L O !" +prin 50, 30, 1, 255, "www.hello.net" + +pal3 30, 20, 10 +box1 20, 40, 290, 180, 2 + +pal4 254, 63, 45, 0 +b = 25 +prin 40, 60, 1, 254, CHR$(254) + " Quis autem vel eum" +a = b +prin 40, 60 + a, 1, 254, CHR$(254) + " Iure reprehenderit qui" +a = a + b +prin 40, 60 + a, 1, 254, CHR$(254) + " In ea voluptate velit" +a = a + b +prin 40, 60 + a, 1, 254, CHR$(254) + " Esse quam nihil molestiae" + +inpur + +END SUB + +SUB inke (a$) +IF tim$ <> TIME$ THEN +ink = ink - 1 +tim$ = TIME$ +END IF +IF (ink <= 0) AND (tmr = 1) THEN a$ = " " ELSE a$ = "" +IF INKEY$ <> "" THEN a$ = " " +END SUB + +SUB inpur +setink 10 +11 +inke a$ +IF a$ = "" THEN GOTO 11 +END SUB + +DEFINT A-Z +SUB mkback +CLS +lm1 = 0 +lm2 = 50 + +s = 2 ^ 7 + +7 +s = s \ 2 + +FOR y = 0 TO 199 STEP s +FOR x = 0 TO 319 STEP s + +c1 = POINT(x, y) +c2 = POINT(x + s, y) +c3 = POINT(x, y + s) +c4 = POINT(x + s, y + s) + +sp = s \ 2 + +c5 = (c1 + c2 + c3 + c4) / 4 + RND * s - sp +IF c5 > lm2 THEN c5 = lm2 +IF c5 < lm1 THEN c5 = lm1 + +c6 = (c2 + c4) / 2 + RND * s - sp +IF c6 > lm2 THEN c6 = lm2 +IF c6 < lm1 THEN c6 = lm1 + +c7 = (c3 + c4) / 2 + RND * s - sp +IF c7 > lm2 THEN c7 = lm2 +IF c7 < lm1 THEN c7 = lm1 + +IF INT(RND * 30) = 2 THEN c5 = 50 +PSET (x + sp, y + sp), c5 +PSET (x + s, y + sp), c6 +PSET (x + sp, y + s), c7 + +NEXT x +NEXT y +IF s > 2 THEN GOTO 7 +END SUB + +DEFSNG A-Z +SUB mkfont +SCREEN 13 +FOR a = 0 TO 255 +LOCATE 1, 1 +IF a <> 7 THEN PRINT CHR$(a) + +FOR y = 0 TO 7 +FOR x = 0 TO 7 +fontt(x, y, a) = POINT(x, y) +NEXT x +NEXT y +NEXT a + +END SUB + +SUB mkjuku (x, y, a, c) +jas(a) = jas(a) + .08 +IF jas(a) > 30000 THEN jas(a) = 0 +b = jas(a) +IF c = 0 THEN b = jas(a) - .08 +x1 = x + COS(b) * 10 +y1 = y + SIN(b) * 5 + 20 + +x2 = x + COS(b) * 5 + 2 +y2 = y + SIN(b) * 3 + 10 + +x3 = x + COS(b + 1) * 2 +y3 = y + SIN(b + 1) * 2 + 2 + +LINE (x2, y2)-(x1, y1), c +LINE (x2, y2)-(x3, y3), c + +x1 = x + COS(b + pii) * 10 +y1 = y + SIN(b + pii) * 5 + 20 + +x2 = x + COS(b + pii) * 5 + 2 +y2 = y + SIN(b + pii) * 3 + 10 + +LINE (x2, y2)-(x1, y1), c +LINE (x2, y2)-(x3, y3), c + +x4 = x + COS(b + 1.2) * 3 - 1 +y4 = y + SIN(b + 1.2) * 1 - 10 + +LINE (x4, y4)-(x3, y3), c + +x5 = x + COS(b + .5) * 13 - 3 +y5 = y + SIN(b + .5) * 2 + 1 + +x6 = x + COS(b + .5) * 15 - 1 +y6 = y + SIN(b + .5) * 3 + 4 + +LINE (x5, y5)-(x4, y4), c +LINE (x5, y5)-(x6, y6), c + +x5 = x + COS(b + pii) * 13 - 3 +y5 = y + SIN(b + pii) * 2 + 1 + +x6 = x + COS(b + pii) * 15 - 1 +y6 = y + SIN(b + pii) * 3 + 4 + +LINE (x5, y5)-(x4, y4), c +LINE (x5, y5)-(x6, y6), c + +x7 = x + COS(b + 1.2) * 2 +y7 = y + SIN(b + 1.2) * 1 - 14 + +LINE (x7, y7 + 2)-(x4, y4), c + +CIRCLE (x7, y7), 3, c + + + +END SUB + +SUB pal (x) +SELECT CASE x +CASE 1 + +FOR f = 0 TO 25 +OUT &H3C8, f +OUT &H3C9, f * 4.1 +OUT &H3C9, f * 4.1 +OUT &H3C9, f * 4.1 +NEXT f + +CASE 2 +e = 0 +FOR f = 0 TO 50 +IF f < 25 THEN e = e + 4 ELSE e = e - 3.8 +OUT &H3C8, f +OUT &H3C9, e / 4 +OUT &H3C9, e / 1.9 +OUT &H3C9, e / 3 +NEXT f +CASE 3 + +FOR f = 51 TO 60 +OUT &H3C8, f +OUT &H3C9, SIN(f) * 30 + 30 +OUT &H3C9, SIN(f * 2) * 30 + 30 +OUT &H3C9, SIN(f * 3) * 30 + 30 +NEXT f + +CASE 4 +FOR f = 0 TO 25 +OUT &H3C8, f +OUT &H3C9, f * 2.5 +OUT &H3C9, f * 2.5 +OUT &H3C9, f * 1.5 +NEXT f +FOR f = 26 TO 50 +OUT &H3C8, f +OUT &H3C9, (50 - f) * 2.5 +OUT &H3C9, (50 - f) * 2.5 +OUT &H3C9, (50 - f) * 1.5 +NEXT f + +END SELECT + +END SUB + +SUB pal2 (r, g, b) +FOR f = 0 TO 25 +OUT &H3C8, f + 51 +OUT &H3C9, (f * 2.5 + r * 1) / 2 +OUT &H3C9, (f * 2.5 + g * 1) / 2 +OUT &H3C9, (f * 1.5 + b * 1) / 2 +NEXT f +FOR f = 26 TO 50 +OUT &H3C8, f + 51 +OUT &H3C9, ((50 - f) * 2.5 + r * 1) / 2 +OUT &H3C9, ((50 - f) * 2.5 + g * 1) / 2 +OUT &H3C9, ((50 - f) * 1.5 + b * 1) / 2 +NEXT f +END SUB + +SUB pal3 (r, g, b) +FOR f = 0 TO 25 +OUT &H3C8, f + 102 +OUT &H3C9, (f * 2.5 + r * 1) / 2 +OUT &H3C9, (f * 2.5 + g * 1) / 2 +OUT &H3C9, (f * 1.5 + b * 1) / 2 +NEXT f +FOR f = 26 TO 50 +OUT &H3C8, f + 102 +OUT &H3C9, ((50 - f) * 2.5 + r * 1) / 2 +OUT &H3C9, ((50 - f) * 2.5 + g * 1) / 2 +OUT &H3C9, ((50 - f) * 1.5 + b * 1) / 2 +NEXT f +END SUB + +SUB pal4 (c, r!, g!, b!) +OUT &H3C8, c +OUT &H3C9, r +OUT &H3C9, g +OUT &H3C9, b +END SUB + +SUB pr (x, y, s, c, n, a$) +IF n > LEN(a$) THEN GOTO 10 +a$ = RIGHT$(LEFT$(a$, n), 1) +x1 = n * 8 * s + x +prin x1, y, s, c, a$ +10 +END SUB + +SUB pri (x, y, a$, c) +COLOR c +FOR a = 1 TO LEN(a$) +b$ = RIGHT$(LEFT$(a$, a), 1) +LOCATE y, x + a +PRINT b$ +SOUND 0, 1 +NEXT a + +END SUB + +SUB prin (x1, y1, s, c1, a$) + +FOR a = 1 TO LEN(a$) +b = ASC(RIGHT$(LEFT$(a$, a), 1)) +c = (a - 1) * 8 * s + x1 +FOR y = 0 TO 7 +FOR x = 0 TO 7 +IF fontt(x, y, b) > 0 THEN +LINE (x * s + c, y * s + y1)-(x * s + s - 1 + c, y * s + s - 1 + y1), c1, BF +END IF +NEXT x +NEXT y + +NEXT a + +END SUB + +SUB resiz + +FOR a = 1 TO 10 +CIRCLE (160, 100), a, a * 2 + 5 +NEXT a +PSET (160, 100), 0 + +DIM buff1(1 TO 10000) +DIM buff2(1 TO 10000) + +a = 10 +GET (160 - a, 90)-(160, 110), buff1(1) +GET (160, 90)-(160 + a, 110), buff2(1) +5 +PUT (159 - a, 90), buff1(1), PSET +PUT (150 + a, 90), buff2(1), PSET +a = a + 1 +SOUND 0, .2 +IF a < 140 THEN GOTO 5 + +a = 1 + +GET (20, 90)-(300, 100), buff1(1) +GET (20, 100)-(300, 110), buff2(1) +6 +PUT (20, 90 - a), buff1(1), PSET +PUT (20, 100 + a), buff2(1), PSET + +a = a + 1 +SOUND 0, .2 +IF a < 60 THEN GOTO 6 +END SUB + +SUB setink (a!) +ink = a +tim$ = TIME$ +END SUB + +SUB start +SCREEN 13 +RANDOMIZE TIMER + +mkfont +tim = 0 +tim2 = 0 + +FOR a = 1 TO 500 +jas(a) = RND * 10 +NEXT a + +pii = 3.14 +IF COMMAND$ = "t" OR COMMAND$ = "T" THEN +tmr = 1 +PRINT "timer is on" +SLEEP 1 +ELSE +tmr = 0 +END IF +END SUB + +SUB wpr +tim = tim + 1 +IF tim \ 10 = tim / 10 THEN +a = tim / 10 +SELECT CASE tim2 +CASE 0 +IF a = 10 THEN tim2 = 1: tim = 0: pal4 255, 63, 45, 0 +CASE 1 +pr 10, 10, 2, 255, a, "Sources:" + +END SELECT +END IF +END SUB + diff --git a/2D GFX/People.webm b/2D GFX/People.webm new file mode 100644 index 0000000..a86b52f Binary files /dev/null and b/2D GFX/People.webm differ diff --git a/2D GFX/Spirals/index.html b/2D GFX/Spirals/index.html new file mode 100644 index 0000000..15c9c96 --- /dev/null +++ b/2D GFX/Spirals/index.html @@ -0,0 +1,944 @@ + + + + + + + +Spiral series + + + + + + +
+

Spiral series

+ + + +
+

1. Spiral with increasing density

+
+ +
+

spiral.png +

+
+ +

+From every point in the spiral, subdivided line is traced. Line +segments are connected between the neighbors. Line segment count +progressively increases towards the center. +

+ +

+spiral.bas +

+ +
+
DECLARE SUB DrawLine (startX AS DOUBLE, startY AS DOUBLE, endX AS DOUBLE, endY AS DOUBLE, col AS INTEGER)
+
+' Program to render fancy looking spiral.
+'
+' This program is free software: released under Creative Commons Zero (CC0) license
+' by Svjatoslav Agejenko.
+' Email: svjatoslav@svjatoslav.eu
+' Homepage: http://www.svjatoslav.eu
+'
+' Changelog:
+' 2003.12, Initial version
+' 2024.08, Improved program readability
+
+DIM SHARED lineVertexX(1 TO 100) AS DOUBLE
+DIM SHARED lineVertexY(1 TO 100) AS DOUBLE
+DIM SHARED depth AS INTEGER
+DIM SHARED tempDepth AS INTEGER
+SCREEN 12
+
+' Initialize the scale factor for the spiral
+spiralScaleFactor = 200
+depth = 0
+
+' Generate the spiral by iterating through angles and scaling appropriately
+FOR angle = 1 TO 30 STEP .1
+    ' Calculate the current scale based on the remaining distance to the center
+    spiralScaleFactor = (30 - angle) * 7
+    ' Convert polar coordinates to cartesian for the current point
+    xPosition = SIN(angle) * spiralScaleFactor + 200
+    yPosition = COS(angle) * spiralScaleFactor + 200
+    ' Store the current depth (z-axis value)
+    tempDepth = angle
+    ' Draw a line from the previous point to the current point with a color based on depth
+    DrawLine xPosition + (xPosition / 2) + (angle * 3), (yPosition - (xPosition / 3)) + (angle * 3), xPosition + 25, yPosition + 25 - (angle * 3), depth
+    ' Set the color for the next segment
+    depth = 15
+NEXT angle
+
+' Wait for user input to close the program
+userInput$ = INPUT$(1)
+
+SUB DrawLine (startX AS DOUBLE, startY AS DOUBLE, endX AS DOUBLE, endY AS DOUBLE, col AS INTEGER)
+    ' Calculate the step increments for x and y based on the depth
+    deltaX = (endX - startX) / tempDepth
+    deltaY = (endY - startY) / tempDepth
+
+    FOR segmentIndex = 1 TO tempDepth
+        ' If there is a previous vertex, draw a line to the new starting point
+        IF lineVertexX(segmentIndex) > 0 THEN LINE (lineVertexX(segmentIndex), lineVertexY(segmentIndex))-(startX, startY), col
+        ' Store the current starting point as the next vertex
+        lineVertexX(segmentIndex) = startX
+        lineVertexY(segmentIndex) = startY
+        ' Increment the starting point by the calculated deltas
+        startX = startX + deltaX
+        startY = startY + deltaY
+        ' Draw a line from the stored vertex to the new starting point
+        LINE (lineVertexX(segmentIndex), lineVertexY(segmentIndex))-(startX, startY), col
+    NEXT segmentIndex
+END SUB
+
+
+
+
+ +
+

2. Spiral with varying height

+
+ +
+

spiral, 2.png +

+
+ +

+From every point in the spiral, subdivided line is traced. Line +segments are connected between the neighbors. This creates effect +where lines run from edges towards the center. Center is vertically +displaced by sinus function where input is the distance to the center. +

+ +

+spiral, 2.bas +

+ +
+
' Program to render fancy looking spiral.
+'
+' This program is free software: released under Creative Commons Zero (CC0) license
+' by Svjatoslav Agejenko.
+' Email: svjatoslav@svjatoslav.eu
+' Homepage: http://www.svjatoslav.eu
+'
+' Changelog:
+' 2003.12, Initial version
+' 2024.08, Improved program readability
+
+DIM SHARED spiralX(1 TO 10000) AS SINGLE ' X coordinates of the spiral points
+DIM SHARED spiralY(1 TO 10000) AS SINGLE ' Y coordinates of the spiral points
+DIM SHARED pointCount AS INTEGER ' Total number of points plotted
+SCREEN 12 ' Set screen resolution to 640x480 with 16 colors
+
+' Initialize the scale factor for the spiral
+scaleFactor = 200
+pointCount = 0
+
+' Calculate and plot each point on the spiral
+FOR angle = 1 TO 100 STEP .05
+    pointCount = pointCount + 1
+    scaleFactor = 100 - angle ' Update the scaling factor as the loop progresses
+
+    ' Calculate the X and Y coordinates based on the sine and cosine of the angle
+    spiralX(pointCount) = SIN(angle) * scaleFactor * 3 + 320
+    spiralY(pointCount) = COS(angle) * scaleFactor + 300
+
+    ' Apply a vertical displacement to create a more dynamic effect
+    spiralY(pointCount) = spiralY(pointCount) + (SIN((angle + 20) / 10) * angle)
+
+    ' Plot the point on the screen
+    PSET (spiralX(pointCount), spiralY(pointCount)), 15
+NEXT angle
+
+' Draw lines between points to create the spiral effect
+FOR segmentStart = 1 TO pointCount - 125
+    LINE (spiralX(segmentStart), spiralY(segmentStart)) - _
+         (spiralX(segmentStart + 125), spiralY(segmentStart + 125)), 15
+NEXT segmentStart
+
+' Wait for user input before exiting
+a$ = INPUT$(1)
+END ' Exit the program
+
+
+
+
+ +
+

3. Shaded spiral

+
+ +
+

spiral, 3.png +

+
+ +

+Similar to previous spiral, Line segments are connected between the +neighbors and sinus from the center decides vertical +displacement. Attempt of shading is made where brighter areas have +more detail. +

+ +

+spiral, 3.bas +

+ +
+
' Program to render fancy looking spiral with shaded surface.
+'
+' This program is free software: released under Creative Commons Zero (CC0) license
+' by Svjatoslav Agejenko.
+' Email: svjatoslav@svjatoslav.eu
+' Homepage: http://www.svjatoslav.eu
+'
+' Changelog:
+' 2003.12, Initial version
+' 2024.08, Improved program readability
+
+' Declare shared arrays for storing coordinates and sine values
+DIM SHARED spiralX(1 TO 10000)
+DIM SHARED spiralY(1 TO 10000)
+DIM SHARED sineValue1(1 TO 10000)
+DIM SHARED sineValue2(1 TO 10000)
+
+
+' Set the screen mode to 640x480 with 16 colors
+SCREEN 12
+
+' Initialize the spiral rotation parameter
+DIM spiralRotation AS SINGLE
+spiralRotation = 0
+
+' Generate and draw the spiral points
+FOR angle = 0 TO 150 STEP .05
+    spiralRotation = spiralRotation + 1
+    scaleFactor = 150 - angle
+
+    ' Calculate the X and Y coordinates for the current point
+    spiralX(spiralRotation) = SIN(angle) * scaleFactor * 3 + 320
+    spiralY(spiralRotation) = COS(angle) * scaleFactor + 300
+
+    ' Apply additional vertical displacement based on a secondary sine function
+    spiralY(spiralRotation) = spiralY(spiralRotation) + (SIN((angle + 20) / 10) * (angle / 5 + 1))
+
+    ' Store the current sine values for later use
+    sineValue1(spiralRotation) = SIN(angle)
+    sineValue2(spiralRotation) = SIN((angle + 20) / 10)
+
+    ' Draw the current point on the screen
+    PSET (spiralX(spiralRotation), spiralY(spiralRotation)), 15
+NEXT angle
+
+' Connect the points to form a continuous line
+FOR index = 1 TO spiralRotation - 127
+    ' Draw a line segment between points 126 steps apart
+    LINE (spiralX(index), spiralY(index))-(spiralX(index + 126), spiralY(index + 126)), 15
+
+    ' Initialize the line drawing flag
+    DIM drawLine AS INTEGER
+    drawLine = 1
+
+    ' Check conditions to determine if a line segment should be drawn
+    IF sineValue1(index) > .8 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 0
+    IF sineValue1(index) < -.2 AND (sineValue2(index) - .4) > sineValue2(index + 125) THEN drawLine = 0
+
+    ' Draw a line segment if the conditions are met
+    IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 1), spiralY(index + 1)), 15
+
+    ' Reset the line drawing flag and check for different conditions
+    drawLine = 0
+    IF sineValue1(index) > .8 AND sineValue2(index) > sineValue2(index + 125) THEN drawLine = 1
+    IF sineValue1(index) < -.2 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 1
+
+    ' Draw a line segment if the conditions are met
+    IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 127), spiralY(index + 127)), 15
+
+    ' Reset the line drawing flag and check for another set of conditions
+    drawLine = 0
+    IF sineValue1(index) > .9 AND sineValue2(index) > sineValue2(index + 125) THEN drawLine = 1
+    IF sineValue1(index) < -.5 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 1
+
+    ' Draw a line segment if the conditions are met
+    IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 125), spiralY(index + 125)), 15
+NEXT index
+
+' Wait for a key press before exiting
+a$ = INPUT$(1)
+
+
+
+
+ +
+

4. Sphere forming spiral

+
+

+Similar to previous spiral, Line segments are connected between the +neighbors. Spiral height and width are calculated such that they form +multiple linked spherical shapes. Initially point cloud in shown: +

+ + +
+

spiral, 4, 1.png +

+
+ +

+In the next step, points are connected using lines: +

+ + +
+

spiral, 4, 2.png +

+
+ + +

+spiral, 4.bas +

+ +
+
' Program to render fancy looking spiral.
+'
+' This program is free software: released under Creative Commons Zero (CC0) license
+' by Svjatoslav Agejenko.
+' Email: svjatoslav@svjatoslav.eu
+' Homepage: http://www.svjatoslav.eu
+'
+' Changelog:
+' 2003.12, Initial version
+' 2024.08, Improved program readability
+
+' Declare shared arrays to hold the x and y coordinates of the spiral
+DIM SHARED spiralX(1 TO 10000)
+DIM SHARED spiralY(1 TO 10000)
+
+' Initialize the screen to a graphics mode with 640x480 resolution and 16 colors
+SCREEN 12
+
+' Constants for the initial size and the starting value of the index
+CONST InitialSize = 100
+CONST StartIndex = 0
+
+' Variable to keep track of the current position in the spiral arrays
+DIM torusIndex AS DOUBLE
+torusIndex = StartIndex
+
+' Loop parameters
+DIM angle AS DOUBLE
+DIM scaleFactor AS DOUBLE
+
+' Generate the first arm of the spiral
+FOR angle = 0 TO 97.35 STEP .15
+    torusIndex = torusIndex + 1
+    scaleFactor = SIN(angle / 31) * InitialSize
+    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
+    spiralY(torusIndex) = COS(angle) * scaleFactor + 250
+    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 200)
+    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
+NEXT angle
+
+' Generate the second arm of the spiral
+FOR angle = 97.35 TO 0 STEP -.15
+    torusIndex = torusIndex + 1
+    scaleFactor = SIN(angle / 31) * (InitialSize / 2)
+    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
+    spiralY(torusIndex) = COS(angle) * scaleFactor + 350
+    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 100)
+    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
+NEXT angle
+
+' Generate the third arm of the spiral
+FOR angle = 0 TO 97.35 STEP .15
+    torusIndex = torusIndex + 1
+    scaleFactor = SIN(angle / 31) * (InitialSize / 4)
+    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
+    spiralY(torusIndex) = COS(angle) * scaleFactor + 300
+    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 50)
+    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
+NEXT angle
+
+' Generate the fourth arm of the spiral
+FOR angle = 97.35 TO 0 STEP -.15
+    torusIndex = torusIndex + 1
+    scaleFactor = SIN(angle / 31) * (InitialSize / 8)
+    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
+    spiralY(torusIndex) = COS(angle) * scaleFactor + 325
+    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 25)
+    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
+NEXT angle
+
+' Calculate the number of lines to draw based on the current index
+DIM totalSegments AS DOUBLE
+totalSegments = (torusIndex - 42) / 4
+
+a$ = INPUT$(1)
+' Clear the screen before drawing the lines
+CLS
+
+' Draw the lines between points in the spiral
+FOR angle = 1 TO totalSegments * 4
+    LINE (spiralX(angle), spiralY(angle))-(spiralX(angle + 42), spiralY(angle + 42)), 15
+    LINE (spiralX(angle), spiralY(angle))-(spiralX(angle + 1), spiralY(angle + 1)), 15
+NEXT angle
+
+' Wait for the user to press a key before exiting
+a$ = INPUT$(1)
+
+' End of program
+SYSTEM
+
+
+
+
+ +
+

5. Textured spherical spiral

+
+ +
+

spiral, 5.png +

+
+ +

+Similar to previous spiral, Line segments are connected between the +neighbors. Spiral height and width are calculated such that sphere is +formed. Sphere is textured. Texture is loaded from file: +texture.dat .Invisible surface detection and removal is +attempted. +

+ +

+spiral, 5.bas +

+ +
+
' Program to render fancy looking spiral.
+'
+' This program is free software: released under Creative Commons Zero (CC0) license
+' by Svjatoslav Agejenko.
+' Email: svjatoslav@svjatoslav.eu
+' Homepage: http://www.svjatoslav.eu
+'
+' Changelog:
+' 2003.12, Initial version
+' 2024.08, Improved program readability
+
+DECLARE SUB FillSegment (x1, y1, x2, y2, xx1, yy1, xx2, yy2)
+DIM SHARED spiralX(1 TO 10000)
+DIM SHARED spiralY(1 TO 10000)
+DIM SHARED angles(1 TO 10000)
+DIM SHARED phaseAngles(1 TO 10000)
+DIM SHARED spiralLength
+SCREEN 12
+stepUnit = 200
+spiralLength = 0
+
+' Generate the spiral points
+FOR angleIndex = 1 TO 97 STEP .15
+    spiralLength = spiralLength + 1
+    stepUnit = SIN(angleIndex / 31) * 100
+    xPos = SIN(angleIndex) * stepUnit * 3 + 320
+    yPos = COS(angleIndex) * stepUnit + 250
+    yPos = yPos - (COS(angleIndex / 31) * 200)
+    angles(spiralLength) = angleIndex
+    phaseAngles(spiralLength) = angleIndex / 31
+    spiralX(spiralLength) = xPos
+    spiralY(spiralLength) = yPos
+    PSET (xPos, yPos), 15
+NEXT angleIndex
+
+' Load texture data from file
+OPEN "texture.dat" FOR INPUT AS #1
+DIM SHARED textureData$(1 TO 1000)
+textureIndex = 0
+1
+    LINE INPUT #1, textureLine$
+    IF LEFT$(textureLine$, 3) = "END" THEN GOTO 2
+    textureIndex = textureIndex + 1
+    textureData$(textureIndex) = textureLine$
+GOTO 1
+2
+CLS
+
+' Apply texture to the spiral
+textureIndex = 1
+FOR charIndex = 1 TO 20
+    FOR textCharIndex = 1 TO LEN(textureData$(charIndex))
+        textureChar$ = RIGHT$(LEFT$(textureData$(charIndex), textCharIndex), 1)
+        textureIndex = textureIndex + 1
+        IF textureIndex > spiralLength - 43 THEN GOTO DONE
+        teeVal = SIN(angles(textureIndex + 32)) - COS(phaseAngles(textureIndex))
+
+        ' Draw lines if the condition is met
+        IF teeVal <= 0 THEN
+            LINE (spiralX(textureIndex), spiralY(textureIndex))-(spiralX(textureIndex + 1), spiralY(textureIndex + 1)), 15
+            LINE (spiralX(textureIndex), spiralY(textureIndex))-(spiralX(textureIndex + 42), spiralY(textureIndex + 42)), 15
+            ' Fill the segment if the character matches
+            IF textureChar$ = "M" THEN
+                CALL FillSegment(spiralX(textureIndex), spiralY(textureIndex), spiralX(textureIndex + 1), spiralY(textureIndex + 1), spiralX(textureIndex + 42), spiralY(textureIndex + 42), spiralX(textureIndex + 43), spiralY(textureIndex + 43))
+            END IF
+        END IF
+    NEXT textCharIndex
+NEXT charIndex
+DONE:
+a$ = INPUT$(1)
+SYSTEM
+
+' Subroutine to fill a segment with lines
+SUB FillSegment (x1, y1, x2, y2, xx1, yy1, xx2, yy2)
+    ' Assign input parameters to local variables
+    xStart = x1
+    yStart = y1
+    xEnd = x2
+    yEnd = y2
+    xxStart = xx1
+    yyStart = yy1
+    xxEnd = xx2
+    yyEnd = yy2
+
+    ' Calculate step increments
+    j = 10
+    xStep = (xEnd - xStart) / j
+    yStep = (yEnd - yStart) / j
+    xxStep = (xxEnd - xxStart) / j
+    yyStep = (yyEnd - yyStart) / j
+
+    ' Draw lines between the points
+    FOR a = 1 TO j
+        xStart = xStart + xStep
+        yStart = yStart + yStep
+        xxStart = xxStart + xxStep
+        yyStart = yyStart + yyStep
+        LINE (xStart, yStart)-(xxStart, yyStart), 15
+    NEXT a
+END SUB
+
+
+
+
+ +
+

6. Textured and shaded spherical spiral

+
+ +
+

spiral, 6.png +

+
+ +

+Similar to previous spiral, Line segments are connected between the +neighbors. Spiral height and width are calculated such that sphere is +formed. Sphere is textured. Texture is loaded from file: +texture1.dat . Invisible surface detection and removal is +attempted. Sphere is shaded. +

+ +

+spiral, 6.bas +

+ +
+
' Program to render fancy looking textured and shaded spiral.
+' Texture is loaded from file.
+'
+' This program is free software: released under Creative Commons Zero (CC0) license
+' by Svjatoslav Agejenko.
+' Email: svjatoslav@svjatoslav.eu
+' Homepage: http://www.svjatoslav.eu
+'
+' Changelog:
+' 2003.12, Initial version
+' 2024 - 2025, Improved program readability
+
+DECLARE SUB fill(x1, y1, x2, y2, xx1, yy1, xx2, yy2, hel)
+DIM SHARED torux(1 TO 10000)
+DIM SHARED toruy(1 TO 10000)
+DIM SHARED sin1(1 TO 10000)
+DIM SHARED cos1(1 TO 10000)
+DIM SHARED tor
+
+' Set the screen mode to 12
+SCREEN 12
+su = 200
+tor = 0
+
+' Calculate points for the spiral
+FOR a = 1 TO 97 STEP .15
+    tor = tor + 1
+    su = SIN(a / 31) * 100
+    x = SIN(a) * su * 3 + 320
+    y = COS(a) * su + 250
+    y = y - (COS(a / 31) * 200)
+    sin1(tor) = a
+    cos1(tor) = a / 31
+    torux(tor) = x
+    toruy(tor) = y
+    ' Set the pixel at (x, y) to color 15
+    PSET (x, y), 15
+NEXT a
+
+' Open the text file for input
+OPEN "texture1.dat" FOR INPUT AS #1
+DIM SHARED text$(1 TO 1000)
+
+a = 0
+1
+' Read a line from the file
+LINE INPUT #1, a$
+' Check if the line is the end marker
+IF LEFT$(a$, 3) = "END" THEN GOTO 2
+
+' Increment the counter and store the line in the text array
+a = a + 1
+text$(a) = a$
+GOTO 1
+2
+' Close the file
+CLOSE #1
+
+' Clear the screen
+CLS
+a = 1
+' Loop through each character in the text
+FOR c = 1 TO 20
+    FOR b = 1 TO LEN(text$(c))
+        ' Get the current character
+        a$ = RIGHT$(LEFT$(text$(c), b), 1)
+
+        ' Increment the counter
+        a = a + 1
+        ' Check if we have reached the end of the points array
+        IF a > tor - 43 THEN GOTO 3
+
+        ' Calculate the angle for the current point
+        tee = SIN(sin1(a + 32))
+        tee = tee - COS(cos1(a))
+
+        ' Draw lines based on the calculated angle
+        IF tee <= 0 THEN
+            LINE (torux(a), toruy(a))-(torux(a + 1), toruy(a + 1)), 15
+            LINE (torux(a), toruy(a))-(torux(a + 42), toruy(a + 42)), 15
+            hel = 10
+            hel1 = COS(cos1(a) - 1) + .5
+            hel2 = SIN(sin1(a) + 1) + 1
+            ' Adjust brightness based on the angles
+            IF hel2 > 1 AND hel1 > 1 THEN
+                hel3 = (hel2 - 1) * (hel1 - 1) * 8
+                hel = hel / (hel3 + 1)
+            END IF
+
+            ' Adjust brightness if the character is "M"
+            IF a$ = "M" THEN hel = hel / 3
+
+            ' Fill the shape with the calculated brightness
+            fillQuadrilateralWithShading torux(a), toruy(a), torux(a + 1), toruy(a + 1), torux(a + 42), toruy(a + 42), torux(a + 43), toruy(a + 43), hel
+        END IF
+    NEXT b
+NEXT c
+
+' Wait for user input
+3
+a$ = INPUT$(1)
+SYSTEM
+
+'
+' Fills a quadrilateral area using scanline algorithm with variable density
+' Creates shaded surface effect by interpolating between opposite edges
+'
+SUB fillQuadrilateralWithShading (startEdgePointX1, startEdgePointY1, endEdgePointX1, endEdgePointY1, shiftedStartEdgeX1, shiftedStarEdgeY1, shiftedEndEdgeX1, shiftEndEdgeY1, brightnessFactor)
+
+' This subroutine creates the illusion of a shaded surface by drawing multiple lines
+' between two opposite edges of a quadrilateral. The density of these lines is
+' controlled by the brightnessFactor parameter - higher values produce sparser lines.
+'
+' Parameters:
+' startEdgePointX1/Y1 and endEdgePointX1/Y1 define one pair of points forming an edge
+' shiftedStartEdgeX1/Y1 and shiftedEndEdgeX1/Y1 define the opposite edge
+' brightnessFactor controls how densely packed the lines will be drawn
+
+' Local variables for working with point coordinates
+edgePointX1 = startEdgePointX1
+edgePointY1 = startEdgePointY1
+edgePointX2 = endEdgePointX1
+edgePointY2 = endEdgePointY1
+oppositePointX1 = shiftedStartEdgeX1
+oppositePointY1 = shiftedStarEdgeY1
+oppositePointX2 = shiftedEndEdgeX1
+oppositePointY2 = shiftEndEdgeY1
+
+' Calculate distance differences along first edge
+deltaX1 = edgePointX1 - edgePointX2
+deltaY1 = edgePointY1 - edgePointY2
+length1 = SQR((deltaX1 * deltaX1) + (deltaY1 * deltaY1))
+
+' Calculate distance differences along second edge
+deltaX2 = oppositePointX1 - oppositePointX2
+deltaY2 = oppositePointY1 - oppositePointY2
+length2 = SQR((deltaX2 * deltaX2) + (deltaY2 * deltaY2))
+
+' Average length determines number of steps based on brightness factor
+averageLength = (length1 + length2) / 2
+stepCount = averageLength / brightnessFactor
+
+' Calculate step increments for each axis
+xStep1 = (edgePointX2 - edgePointX1) / stepCount
+yStep1 = (edgePointY2 - edgePointY1) / stepCount
+xStep2 = (oppositePointX2 - oppositePointX1) / stepCount
+yStep2 = (oppositePointY2 - oppositePointY1) / stepCount
+
+' Draw intermediate connecting lines across the shape
+FOR stepIndex = 1 TO stepCount
+    edgePointX1 = edgePointX1 + xStep1
+    edgePointY1 = edgePointY1 + yStep1
+    oppositePointX1 = oppositePointX1 + xStep2
+    oppositePointY1 = oppositePointY1 + yStep2
+
+    ' Draw line between current interpolated points
+    LINE (edgePointX1, edgePointY1)-(oppositePointX1, oppositePointY1), 15
+NEXT stepIndex
+
+END SUB
+
+
+
+
+
+
+

Created: 2025-07-28 ma 03:32

+

Validate

+
+ + diff --git a/2D GFX/Spirals/index.org b/2D GFX/Spirals/index.org new file mode 100644 index 0000000..cffa9dd --- /dev/null +++ b/2D GFX/Spirals/index.org @@ -0,0 +1,124 @@ +#+TITLE: Spiral series +#+LANGUAGE: en +#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry} +#+LATEX_HEADER: \usepackage{parskip} +#+LATEX_HEADER: \usepackage[none]{hyphenat} + +#+OPTIONS: H:20 num:20 +#+OPTIONS: author:nil + +#+begin_export html + +#+end_export + +* Spiral with increasing density + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:spiral.png]] + +From every point in the spiral, subdivided line is traced. Line +segments are connected between the neighbors. Line segment count +progressively increases towards the center. + +[[file:spiral.bas]] + +#+INCLUDE: "spiral.bas" src basic-qb45 + +* Spiral with varying height + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:spiral, 2.png]] + +From every point in the spiral, subdivided line is traced. Line +segments are connected between the neighbors. This creates effect +where lines run from edges towards the center. Center is vertically +displaced by sinus function where input is the distance to the center. + +[[file:spiral, 2.bas]] + +#+INCLUDE: "spiral, 2.bas" src basic-qb45 + +* Shaded spiral + +#+attr_html: :class responsive-img +#+attr_latex: :width 800px +[[file:spiral, 3.png]] + +Similar to previous spiral, Line segments are connected between the +neighbors and sinus from the center decides vertical +displacement. Attempt of shading is made where brighter areas have +more detail. + +[[file:spiral, 3.bas]] + +#+INCLUDE: "spiral, 3.bas" src basic-qb45 + +* Sphere forming spiral + +Similar to previous spiral, Line segments are connected between the +neighbors. Spiral height and width are calculated such that they form +multiple linked spherical shapes. Initially point cloud in shown: + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:spiral, 4, 1.png]] + +In the next step, points are connected using lines: + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:spiral, 4, 2.png]] + + +[[file:spiral, 4.bas]] + +#+INCLUDE: "spiral, 4.bas" src basic-qb45 + +* Textured spherical spiral + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:spiral, 5.png]] + +Similar to previous spiral, Line segments are connected between the +neighbors. Spiral height and width are calculated such that sphere is +formed. Sphere is textured. Texture is loaded from file: +[[file:texture.dat]] .Invisible surface detection and removal is +attempted. + +[[file:spiral, 5.bas]] + +#+INCLUDE: "spiral, 5.bas" src basic-qb45 + +* Textured and shaded spherical spiral + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:spiral, 6.png]] + +Similar to previous spiral, Line segments are connected between the +neighbors. Spiral height and width are calculated such that sphere is +formed. Sphere is textured. Texture is loaded from file: +[[file:texture1.dat]] . Invisible surface detection and removal is +attempted. Sphere is shaded. + +[[file:spiral, 6.bas]] + +#+INCLUDE: "spiral, 6.bas" src basic-qb45 diff --git a/2D GFX/Spirals/logo.png b/2D GFX/Spirals/logo.png new file mode 100644 index 0000000..a82b2e1 Binary files /dev/null and b/2D GFX/Spirals/logo.png differ diff --git a/2D GFX/Spirals/spiral, 2.bas b/2D GFX/Spirals/spiral, 2.bas new file mode 100644 index 0000000..3c1be67 --- /dev/null +++ b/2D GFX/Spirals/spiral, 2.bas @@ -0,0 +1,45 @@ +' Program to render fancy looking spiral. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024.08, Improved program readability + +DIM SHARED spiralX(1 TO 10000) AS SINGLE ' X coordinates of the spiral points +DIM SHARED spiralY(1 TO 10000) AS SINGLE ' Y coordinates of the spiral points +DIM SHARED pointCount AS INTEGER ' Total number of points plotted +SCREEN 12 ' Set screen resolution to 640x480 with 16 colors + +' Initialize the scale factor for the spiral +scaleFactor = 200 +pointCount = 0 + +' Calculate and plot each point on the spiral +FOR angle = 1 TO 100 STEP .05 + pointCount = pointCount + 1 + scaleFactor = 100 - angle ' Update the scaling factor as the loop progresses + + ' Calculate the X and Y coordinates based on the sine and cosine of the angle + spiralX(pointCount) = SIN(angle) * scaleFactor * 3 + 320 + spiralY(pointCount) = COS(angle) * scaleFactor + 300 + + ' Apply a vertical displacement to create a more dynamic effect + spiralY(pointCount) = spiralY(pointCount) + (SIN((angle + 20) / 10) * angle) + + ' Plot the point on the screen + PSET (spiralX(pointCount), spiralY(pointCount)), 15 +NEXT angle + +' Draw lines between points to create the spiral effect +FOR segmentStart = 1 TO pointCount - 125 + LINE (spiralX(segmentStart), spiralY(segmentStart)) - _ + (spiralX(segmentStart + 125), spiralY(segmentStart + 125)), 15 +NEXT segmentStart + +' Wait for user input before exiting +a$ = INPUT$(1) +END ' Exit the program diff --git a/2D GFX/Spirals/spiral, 2.png b/2D GFX/Spirals/spiral, 2.png new file mode 100644 index 0000000..2534319 Binary files /dev/null and b/2D GFX/Spirals/spiral, 2.png differ diff --git a/2D GFX/Spirals/spiral, 3.bas b/2D GFX/Spirals/spiral, 3.bas new file mode 100644 index 0000000..8c875a8 --- /dev/null +++ b/2D GFX/Spirals/spiral, 3.bas @@ -0,0 +1,81 @@ +' Program to render fancy looking spiral with shaded surface. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024.08, Improved program readability + +' Declare shared arrays for storing coordinates and sine values +DIM SHARED spiralX(1 TO 10000) +DIM SHARED spiralY(1 TO 10000) +DIM SHARED sineValue1(1 TO 10000) +DIM SHARED sineValue2(1 TO 10000) + + +' Set the screen mode to 640x480 with 16 colors +SCREEN 12 + +' Initialize the spiral rotation parameter +DIM spiralRotation AS SINGLE +spiralRotation = 0 + +' Generate and draw the spiral points +FOR angle = 0 TO 150 STEP .05 + spiralRotation = spiralRotation + 1 + scaleFactor = 150 - angle + + ' Calculate the X and Y coordinates for the current point + spiralX(spiralRotation) = SIN(angle) * scaleFactor * 3 + 320 + spiralY(spiralRotation) = COS(angle) * scaleFactor + 300 + + ' Apply additional vertical displacement based on a secondary sine function + spiralY(spiralRotation) = spiralY(spiralRotation) + (SIN((angle + 20) / 10) * (angle / 5 + 1)) + + ' Store the current sine values for later use + sineValue1(spiralRotation) = SIN(angle) + sineValue2(spiralRotation) = SIN((angle + 20) / 10) + + ' Draw the current point on the screen + PSET (spiralX(spiralRotation), spiralY(spiralRotation)), 15 +NEXT angle + +' Connect the points to form a continuous line +FOR index = 1 TO spiralRotation - 127 + ' Draw a line segment between points 126 steps apart + LINE (spiralX(index), spiralY(index))-(spiralX(index + 126), spiralY(index + 126)), 15 + + ' Initialize the line drawing flag + DIM drawLine AS INTEGER + drawLine = 1 + + ' Check conditions to determine if a line segment should be drawn + IF sineValue1(index) > .8 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 0 + IF sineValue1(index) < -.2 AND (sineValue2(index) - .4) > sineValue2(index + 125) THEN drawLine = 0 + + ' Draw a line segment if the conditions are met + IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 1), spiralY(index + 1)), 15 + + ' Reset the line drawing flag and check for different conditions + drawLine = 0 + IF sineValue1(index) > .8 AND sineValue2(index) > sineValue2(index + 125) THEN drawLine = 1 + IF sineValue1(index) < -.2 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 1 + + ' Draw a line segment if the conditions are met + IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 127), spiralY(index + 127)), 15 + + ' Reset the line drawing flag and check for another set of conditions + drawLine = 0 + IF sineValue1(index) > .9 AND sineValue2(index) > sineValue2(index + 125) THEN drawLine = 1 + IF sineValue1(index) < -.5 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 1 + + ' Draw a line segment if the conditions are met + IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 125), spiralY(index + 125)), 15 +NEXT index + +' Wait for a key press before exiting +a$ = INPUT$(1) + diff --git a/2D GFX/Spirals/spiral, 3.png b/2D GFX/Spirals/spiral, 3.png new file mode 100644 index 0000000..fba0323 Binary files /dev/null and b/2D GFX/Spirals/spiral, 3.png differ diff --git a/2D GFX/Spirals/spiral, 4, 1.png b/2D GFX/Spirals/spiral, 4, 1.png new file mode 100644 index 0000000..caa29b1 Binary files /dev/null and b/2D GFX/Spirals/spiral, 4, 1.png differ diff --git a/2D GFX/Spirals/spiral, 4, 2.png b/2D GFX/Spirals/spiral, 4, 2.png new file mode 100644 index 0000000..76ff118 Binary files /dev/null and b/2D GFX/Spirals/spiral, 4, 2.png differ diff --git a/2D GFX/Spirals/spiral, 4.bas b/2D GFX/Spirals/spiral, 4.bas new file mode 100644 index 0000000..5101083 --- /dev/null +++ b/2D GFX/Spirals/spiral, 4.bas @@ -0,0 +1,90 @@ +' Program to render fancy looking spiral. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024.08, Improved program readability + +' Declare shared arrays to hold the x and y coordinates of the spiral +DIM SHARED spiralX(1 TO 10000) +DIM SHARED spiralY(1 TO 10000) + +' Initialize the screen to a graphics mode with 640x480 resolution and 16 colors +SCREEN 12 + +' Constants for the initial size and the starting value of the index +CONST InitialSize = 100 +CONST StartIndex = 0 + +' Variable to keep track of the current position in the spiral arrays +DIM torusIndex AS DOUBLE +torusIndex = StartIndex + +' Loop parameters +DIM angle AS DOUBLE +DIM scaleFactor AS DOUBLE + +' Generate the first arm of the spiral +FOR angle = 0 TO 97.35 STEP .15 + torusIndex = torusIndex + 1 + scaleFactor = SIN(angle / 31) * InitialSize + spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320 + spiralY(torusIndex) = COS(angle) * scaleFactor + 250 + spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 200) + PSET (spiralX(torusIndex), spiralY(torusIndex)), 15 +NEXT angle + +' Generate the second arm of the spiral +FOR angle = 97.35 TO 0 STEP -.15 + torusIndex = torusIndex + 1 + scaleFactor = SIN(angle / 31) * (InitialSize / 2) + spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320 + spiralY(torusIndex) = COS(angle) * scaleFactor + 350 + spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 100) + PSET (spiralX(torusIndex), spiralY(torusIndex)), 15 +NEXT angle + +' Generate the third arm of the spiral +FOR angle = 0 TO 97.35 STEP .15 + torusIndex = torusIndex + 1 + scaleFactor = SIN(angle / 31) * (InitialSize / 4) + spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320 + spiralY(torusIndex) = COS(angle) * scaleFactor + 300 + spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 50) + PSET (spiralX(torusIndex), spiralY(torusIndex)), 15 +NEXT angle + +' Generate the fourth arm of the spiral +FOR angle = 97.35 TO 0 STEP -.15 + torusIndex = torusIndex + 1 + scaleFactor = SIN(angle / 31) * (InitialSize / 8) + spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320 + spiralY(torusIndex) = COS(angle) * scaleFactor + 325 + spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 25) + PSET (spiralX(torusIndex), spiralY(torusIndex)), 15 +NEXT angle + +' Calculate the number of lines to draw based on the current index +DIM totalSegments AS DOUBLE +totalSegments = (torusIndex - 42) / 4 + +a$ = INPUT$(1) +' Clear the screen before drawing the lines +CLS + +' Draw the lines between points in the spiral +FOR angle = 1 TO totalSegments * 4 + LINE (spiralX(angle), spiralY(angle))-(spiralX(angle + 42), spiralY(angle + 42)), 15 + LINE (spiralX(angle), spiralY(angle))-(spiralX(angle + 1), spiralY(angle + 1)), 15 +NEXT angle + +' Wait for the user to press a key before exiting +a$ = INPUT$(1) + +' End of program +SYSTEM + diff --git a/2D GFX/Spirals/spiral, 5.bas b/2D GFX/Spirals/spiral, 5.bas new file mode 100644 index 0000000..80b03e5 --- /dev/null +++ b/2D GFX/Spirals/spiral, 5.bas @@ -0,0 +1,101 @@ +' Program to render fancy looking spiral. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024.08, Improved program readability + +DECLARE SUB FillSegment (x1, y1, x2, y2, xx1, yy1, xx2, yy2) +DIM SHARED spiralX(1 TO 10000) +DIM SHARED spiralY(1 TO 10000) +DIM SHARED angles(1 TO 10000) +DIM SHARED phaseAngles(1 TO 10000) +DIM SHARED spiralLength +SCREEN 12 +stepUnit = 200 +spiralLength = 0 + +' Generate the spiral points +FOR angleIndex = 1 TO 97 STEP .15 + spiralLength = spiralLength + 1 + stepUnit = SIN(angleIndex / 31) * 100 + xPos = SIN(angleIndex) * stepUnit * 3 + 320 + yPos = COS(angleIndex) * stepUnit + 250 + yPos = yPos - (COS(angleIndex / 31) * 200) + angles(spiralLength) = angleIndex + phaseAngles(spiralLength) = angleIndex / 31 + spiralX(spiralLength) = xPos + spiralY(spiralLength) = yPos + PSET (xPos, yPos), 15 +NEXT angleIndex + +' Load texture data from file +OPEN "texture.dat" FOR INPUT AS #1 +DIM SHARED textureData$(1 TO 1000) +textureIndex = 0 +1 + LINE INPUT #1, textureLine$ + IF LEFT$(textureLine$, 3) = "END" THEN GOTO 2 + textureIndex = textureIndex + 1 + textureData$(textureIndex) = textureLine$ +GOTO 1 +2 +CLS + +' Apply texture to the spiral +textureIndex = 1 +FOR charIndex = 1 TO 20 + FOR textCharIndex = 1 TO LEN(textureData$(charIndex)) + textureChar$ = RIGHT$(LEFT$(textureData$(charIndex), textCharIndex), 1) + textureIndex = textureIndex + 1 + IF textureIndex > spiralLength - 43 THEN GOTO DONE + teeVal = SIN(angles(textureIndex + 32)) - COS(phaseAngles(textureIndex)) + + ' Draw lines if the condition is met + IF teeVal <= 0 THEN + LINE (spiralX(textureIndex), spiralY(textureIndex))-(spiralX(textureIndex + 1), spiralY(textureIndex + 1)), 15 + LINE (spiralX(textureIndex), spiralY(textureIndex))-(spiralX(textureIndex + 42), spiralY(textureIndex + 42)), 15 + ' Fill the segment if the character matches + IF textureChar$ = "M" THEN + CALL FillSegment(spiralX(textureIndex), spiralY(textureIndex), spiralX(textureIndex + 1), spiralY(textureIndex + 1), spiralX(textureIndex + 42), spiralY(textureIndex + 42), spiralX(textureIndex + 43), spiralY(textureIndex + 43)) + END IF + END IF + NEXT textCharIndex +NEXT charIndex +DONE: +a$ = INPUT$(1) +SYSTEM + +' Subroutine to fill a segment with lines +SUB FillSegment (x1, y1, x2, y2, xx1, yy1, xx2, yy2) + ' Assign input parameters to local variables + xStart = x1 + yStart = y1 + xEnd = x2 + yEnd = y2 + xxStart = xx1 + yyStart = yy1 + xxEnd = xx2 + yyEnd = yy2 + + ' Calculate step increments + j = 10 + xStep = (xEnd - xStart) / j + yStep = (yEnd - yStart) / j + xxStep = (xxEnd - xxStart) / j + yyStep = (yyEnd - yyStart) / j + + ' Draw lines between the points + FOR a = 1 TO j + xStart = xStart + xStep + yStart = yStart + yStep + xxStart = xxStart + xxStep + yyStart = yyStart + yyStep + LINE (xStart, yStart)-(xxStart, yyStart), 15 + NEXT a +END SUB + diff --git a/2D GFX/Spirals/spiral, 5.png b/2D GFX/Spirals/spiral, 5.png new file mode 100644 index 0000000..552f480 Binary files /dev/null and b/2D GFX/Spirals/spiral, 5.png differ diff --git a/2D GFX/Spirals/spiral, 6.bas b/2D GFX/Spirals/spiral, 6.bas new file mode 100644 index 0000000..03190e0 --- /dev/null +++ b/2D GFX/Spirals/spiral, 6.bas @@ -0,0 +1,160 @@ +' Program to render fancy looking textured and shaded spiral. +' Texture is loaded from file. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024 - 2025, Improved program readability + +DECLARE SUB fill(x1, y1, x2, y2, xx1, yy1, xx2, yy2, hel) +DIM SHARED torux(1 TO 10000) +DIM SHARED toruy(1 TO 10000) +DIM SHARED sin1(1 TO 10000) +DIM SHARED cos1(1 TO 10000) +DIM SHARED tor + +' Set the screen mode to 12 +SCREEN 12 +su = 200 +tor = 0 + +' Calculate points for the spiral +FOR a = 1 TO 97 STEP .15 + tor = tor + 1 + su = SIN(a / 31) * 100 + x = SIN(a) * su * 3 + 320 + y = COS(a) * su + 250 + y = y - (COS(a / 31) * 200) + sin1(tor) = a + cos1(tor) = a / 31 + torux(tor) = x + toruy(tor) = y + ' Set the pixel at (x, y) to color 15 + PSET (x, y), 15 +NEXT a + +' Open the text file for input +OPEN "texture1.dat" FOR INPUT AS #1 +DIM SHARED text$(1 TO 1000) + +a = 0 +1 +' Read a line from the file +LINE INPUT #1, a$ +' Check if the line is the end marker +IF LEFT$(a$, 3) = "END" THEN GOTO 2 + +' Increment the counter and store the line in the text array +a = a + 1 +text$(a) = a$ +GOTO 1 +2 +' Close the file +CLOSE #1 + +' Clear the screen +CLS +a = 1 +' Loop through each character in the text +FOR c = 1 TO 20 + FOR b = 1 TO LEN(text$(c)) + ' Get the current character + a$ = RIGHT$(LEFT$(text$(c), b), 1) + + ' Increment the counter + a = a + 1 + ' Check if we have reached the end of the points array + IF a > tor - 43 THEN GOTO 3 + + ' Calculate the angle for the current point + tee = SIN(sin1(a + 32)) + tee = tee - COS(cos1(a)) + + ' Draw lines based on the calculated angle + IF tee <= 0 THEN + LINE (torux(a), toruy(a))-(torux(a + 1), toruy(a + 1)), 15 + LINE (torux(a), toruy(a))-(torux(a + 42), toruy(a + 42)), 15 + hel = 10 + hel1 = COS(cos1(a) - 1) + .5 + hel2 = SIN(sin1(a) + 1) + 1 + ' Adjust brightness based on the angles + IF hel2 > 1 AND hel1 > 1 THEN + hel3 = (hel2 - 1) * (hel1 - 1) * 8 + hel = hel / (hel3 + 1) + END IF + + ' Adjust brightness if the character is "M" + IF a$ = "M" THEN hel = hel / 3 + + ' Fill the shape with the calculated brightness + fillQuadrilateralWithShading torux(a), toruy(a), torux(a + 1), toruy(a + 1), torux(a + 42), toruy(a + 42), torux(a + 43), toruy(a + 43), hel + END IF + NEXT b +NEXT c + +' Wait for user input +3 +a$ = INPUT$(1) +SYSTEM + +' +' Fills a quadrilateral area using scanline algorithm with variable density +' Creates shaded surface effect by interpolating between opposite edges +' +SUB fillQuadrilateralWithShading (startEdgePointX1, startEdgePointY1, endEdgePointX1, endEdgePointY1, shiftedStartEdgeX1, shiftedStarEdgeY1, shiftedEndEdgeX1, shiftEndEdgeY1, brightnessFactor) + +' This subroutine creates the illusion of a shaded surface by drawing multiple lines +' between two opposite edges of a quadrilateral. The density of these lines is +' controlled by the brightnessFactor parameter - higher values produce sparser lines. +' +' Parameters: +' startEdgePointX1/Y1 and endEdgePointX1/Y1 define one pair of points forming an edge +' shiftedStartEdgeX1/Y1 and shiftedEndEdgeX1/Y1 define the opposite edge +' brightnessFactor controls how densely packed the lines will be drawn + +' Local variables for working with point coordinates +edgePointX1 = startEdgePointX1 +edgePointY1 = startEdgePointY1 +edgePointX2 = endEdgePointX1 +edgePointY2 = endEdgePointY1 +oppositePointX1 = shiftedStartEdgeX1 +oppositePointY1 = shiftedStarEdgeY1 +oppositePointX2 = shiftedEndEdgeX1 +oppositePointY2 = shiftEndEdgeY1 + +' Calculate distance differences along first edge +deltaX1 = edgePointX1 - edgePointX2 +deltaY1 = edgePointY1 - edgePointY2 +length1 = SQR((deltaX1 * deltaX1) + (deltaY1 * deltaY1)) + +' Calculate distance differences along second edge +deltaX2 = oppositePointX1 - oppositePointX2 +deltaY2 = oppositePointY1 - oppositePointY2 +length2 = SQR((deltaX2 * deltaX2) + (deltaY2 * deltaY2)) + +' Average length determines number of steps based on brightness factor +averageLength = (length1 + length2) / 2 +stepCount = averageLength / brightnessFactor + +' Calculate step increments for each axis +xStep1 = (edgePointX2 - edgePointX1) / stepCount +yStep1 = (edgePointY2 - edgePointY1) / stepCount +xStep2 = (oppositePointX2 - oppositePointX1) / stepCount +yStep2 = (oppositePointY2 - oppositePointY1) / stepCount + +' Draw intermediate connecting lines across the shape +FOR stepIndex = 1 TO stepCount + edgePointX1 = edgePointX1 + xStep1 + edgePointY1 = edgePointY1 + yStep1 + oppositePointX1 = oppositePointX1 + xStep2 + oppositePointY1 = oppositePointY1 + yStep2 + + ' Draw line between current interpolated points + LINE (edgePointX1, edgePointY1)-(oppositePointX1, oppositePointY1), 15 +NEXT stepIndex + +END SUB \ No newline at end of file diff --git a/2D GFX/Spirals/spiral, 6.png b/2D GFX/Spirals/spiral, 6.png new file mode 100644 index 0000000..887f850 Binary files /dev/null and b/2D GFX/Spirals/spiral, 6.png differ diff --git a/2D GFX/Spirals/spiral.bas b/2D GFX/Spirals/spiral.bas new file mode 100644 index 0000000..bcf2d26 --- /dev/null +++ b/2D GFX/Spirals/spiral.bas @@ -0,0 +1,59 @@ +DECLARE SUB DrawLine (startX AS DOUBLE, startY AS DOUBLE, endX AS DOUBLE, endY AS DOUBLE, col AS INTEGER) + +' Program to render fancy looking spiral. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024.08, Improved program readability + +DIM SHARED lineVertexX(1 TO 100) AS DOUBLE +DIM SHARED lineVertexY(1 TO 100) AS DOUBLE +DIM SHARED depth AS INTEGER +DIM SHARED tempDepth AS INTEGER +SCREEN 12 + +' Initialize the scale factor for the spiral +spiralScaleFactor = 200 +depth = 0 + +' Generate the spiral by iterating through angles and scaling appropriately +FOR angle = 1 TO 30 STEP .1 + ' Calculate the current scale based on the remaining distance to the center + spiralScaleFactor = (30 - angle) * 7 + ' Convert polar coordinates to cartesian for the current point + xPosition = SIN(angle) * spiralScaleFactor + 200 + yPosition = COS(angle) * spiralScaleFactor + 200 + ' Store the current depth (z-axis value) + tempDepth = angle + ' Draw a line from the previous point to the current point with a color based on depth + DrawLine xPosition + (xPosition / 2) + (angle * 3), (yPosition - (xPosition / 3)) + (angle * 3), xPosition + 25, yPosition + 25 - (angle * 3), depth + ' Set the color for the next segment + depth = 15 +NEXT angle + +' Wait for user input to close the program +userInput$ = INPUT$(1) + +SUB DrawLine (startX AS DOUBLE, startY AS DOUBLE, endX AS DOUBLE, endY AS DOUBLE, col AS INTEGER) + ' Calculate the step increments for x and y based on the depth + deltaX = (endX - startX) / tempDepth + deltaY = (endY - startY) / tempDepth + + FOR segmentIndex = 1 TO tempDepth + ' If there is a previous vertex, draw a line to the new starting point + IF lineVertexX(segmentIndex) > 0 THEN LINE (lineVertexX(segmentIndex), lineVertexY(segmentIndex))-(startX, startY), col + ' Store the current starting point as the next vertex + lineVertexX(segmentIndex) = startX + lineVertexY(segmentIndex) = startY + ' Increment the starting point by the calculated deltas + startX = startX + deltaX + startY = startY + deltaY + ' Draw a line from the stored vertex to the new starting point + LINE (lineVertexX(segmentIndex), lineVertexY(segmentIndex))-(startX, startY), col + NEXT segmentIndex +END SUB diff --git a/2D GFX/Spirals/spiral.png b/2D GFX/Spirals/spiral.png new file mode 100644 index 0000000..4c26bec Binary files /dev/null and b/2D GFX/Spirals/spiral.png differ diff --git a/2D GFX/Spirals/texture.dat b/2D GFX/Spirals/texture.dat new file mode 100644 index 0000000..646d9b0 --- /dev/null +++ b/2D GFX/Spirals/texture.dat @@ -0,0 +1,54 @@ +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M. +.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M +END + diff --git a/2D GFX/Spirals/texture1.dat b/2D GFX/Spirals/texture1.dat new file mode 100644 index 0000000..3f591e5 --- /dev/null +++ b/2D GFX/Spirals/texture1.dat @@ -0,0 +1,35 @@ +.......................................... +...........................MMM.M.M.MM..... +............................M..MMM.M...... +............................M..M.M.MM..... +...................................M...... +............................MM.....MM..... +............................M............. +............................MM.MM..MM..... +............................M..M.M.M.M.... +............................MM.M.M.MM..... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +.......................................... +END + diff --git a/2D GFX/Stroboscope.bas b/2D GFX/Stroboscope.bas new file mode 100644 index 0000000..e988ef1 --- /dev/null +++ b/2D GFX/Stroboscope.bas @@ -0,0 +1,514 @@ +' Presentation about how to build stroboscope. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2002, Initial version +' 2024 - 2025, Improved program readability + +DECLARE SUB InitializePresentation () +DECLARE SUB WaitForKeyPress (keyInput$) +DECLARE SUB MoveModel () +DEFINT A-Z +DECLARE SUB DrawLines () +DECLARE SUB Load3DModel () +DECLARE SUB Animate3DModel () +DECLARE SUB ClearScreen () +DECLARE SUB LoadFontPalette () +DECLARE SUB PrintText (x2%, y%, s%, c%, t$) +DECLARE SUB DisplayClosingPage () + +DECLARE SUB ProgramStart () + +DIM SHARED font(0 TO 7, 0 TO 15, 0 TO 207) +DIM SHARED paletteData(1 TO 100) +DIM SHARED originalX1(1 TO 1000) +DIM SHARED originalY1(1 TO 1000) +DIM SHARED originalX2(1 TO 1000) +DIM SHARED originalY2(1 TO 1000) +DIM SHARED previousX1(1 TO 1000) +DIM SHARED previousY1(1 TO 1000) +DIM SHARED previousX2(1 TO 1000) +DIM SHARED previousY2(1 TO 1000) +DIM SHARED lineColor(1 TO 1000) + +DIM SHARED movementX, movementY, zoomLevel +DIM SHARED startX, startY, startZoom +DIM SHARED endX, endY, endZoom +DIM SHARED totalFrames + +DIM SHARED lineCount + +ProgramStart + +InitializePresentation +ClearScreen +Animate3DModel +DisplayClosingPage +END + +DATA 0,0,5,-2 +DATA 0,0,5,2 +DATA 0, 0, 15, 0 + +DATA 15,-2,15,2 +DATA 25,-2,25,2 +DATA 15,-2,25,-2 +DATA 15,2,25,2 + +DATA 25,0,35,0 +DATA 35,-2,35,2 +DATA 35,-2,40,0 +DATA 35,2,40,0 +DATA 40,-2,40,2 + +DATA 40,0,80,0 +DATA 50,0,50,19 +DATA 48,19,52,19 +DATA 48,21,52,21 +DATA 50,21,50,35 + +DATA 0,35,125,35 +DATA 0,35,5,33 +DATA 0,35,5,37 + +DATA 70,0,70,15 +DATA 70,35,70,20 +DATA 69,16,71,19 +DATA 69,19,71,16 +DATA 67,10,73,10 +DATA 67,25,73,25 +DATA 67,10,67,25 +DATA 73,10,73,25 + +DATA 75,15,75,25 +DATA 75,20,90,20 +DATA 90,20,91,21 +DATA 91,21,90,22 +DATA 90,22,91,23 +DATA 91,23,90,24 +DATA 90,24,91,25 +DATA 91,25,90,26 +DATA 90,26,90,35 + +DATA 93,18,93,28 +DATA 92,18,92,28 + +DATA 95,20,94,21 +DATA 94,21,95,22 +DATA 95,22,94,23 +DATA 94,23,95,24 +DATA 95,24,94,25 +DATA 94,25,95,26 +DATA 95,26,95,35 + +DATA 95, 20, 115, 20 +DATA 115,20,115,15 +DATA 115,7,115,0 +DATA 125,35,125,26 +DATA 123,26,127,26 +DATA 123,24,127,24 +DATA 125,24,125,0 +DATA 125,0,110,0 +DATA 110,-2,110,2 +DATA 100,-2,100,2 +DATA 100,-2,110,-2 +DATA 100,2,110,2 + +DATA 100,0,90,0 +DATA 90,-2,90,2 +DATA 80,-2,80,2 +DATA 80,-2,90,-2 +DATA 80,2,90,2 + +DATA 113,5,117,5 +DATA 113,17,117,17 +DATA 113,5,113,17 +DATA 117,5,117,17 +DATA 115,11,125,11 + +DATA 105,-2,105,-5 +DATA 105,-5,113,-5 +DATA 113,-5,113,0 +DATA 105,-2,104,-4 +DATA 105,-2,106,-4 + +DATA 999,999,999,999 + +SUB Animate3DModel + ' Set up first animation parameters + startX = 20 + startY = 15 + startZoom = 100 + endX = 20 + endY = 15 + endZoom = 10 + totalFrames = 20 + + MoveModel + + ' Print technical information + PrintText 147, 66, 1, 3, "100 D336B 180k 680k" + PrintText 180, 120, 1, 3, "50m 450V 1m" + PrintText 180, 400, 2, 14, "Principal schematic" + + WaitForKeyPress keyInput$ + + ' Clear screen for next animation + LINE (0, 0)-(639, 390), 0, BF + + ' Set up second animation parameters + startX = 20 + startY = 15 + startZoom = 10 + endX = 80 + endY = 5 + endZoom = 4 + totalFrames = 20 + MoveModel + WaitForKeyPress keyInput$ + + ' Set up third animation parameters + startX = 80 + startY = 5 + startZoom = 4 + endX = 40 + endY = 5 + endZoom = 4 + totalFrames = 20 + MoveModel + WaitForKeyPress keyInput$ + + ' Set up fourth animation parameters + startX = 40 + startY = 5 + startZoom = 4 + endX = 20 + endY = 15 + endZoom = 10 + totalFrames = 10 + MoveModel + + ' Redraw technical information + PrintText 147, 66, 1, 3, "100 D336B 180k 680k" + PrintText 180, 120, 1, 3, "50m 450V 1m" + WaitForKeyPress keyInput$ +END SUB + +SUB ClearScreen + ' change screen resolution. This also resets color palette. + SCREEN 13 + SCREEN 12 +END SUB + +SUB DisplayClosingPage + CLS + SCREEN 13 + PrintText 35, 100, 2, 14, " Thank you" + PrintText 35, 140, 2, 14, " for attention!" + + ' Create closing animation effect + DIM buffer(1 TO 30000) + GET (0, 100)-(319, 199), buffer(1) + + ' Move text down with delay + FOR y = 100 TO 50 STEP -1 + PUT (0, y), buffer(1), PSET + SOUND 0, .5 + NEXT y + + WaitForKeyPress keyInput$ + SYSTEM +END SUB + +SUB DrawLines + ' Draw all lines in the schematic with current transformation parameters. + ' First calculate new screen coordinates based on movement and zoom. + ' Then draw lines by erasing previous positions and drawing new ones. + + FOR a = 1 TO lineCount + ' Calculate relative coordinates from original positions + x1 = originalX1(a) - movementX + y1 = originalY1(a) - movementY + x2 = originalX2(a) - movementX + y2 = originalY2(a) - movementY + + ' Apply zoom scaling and centering (320x200 screen) + x1 = x1 * 30 / zoomLevel + 160 + y1 = y1 * 30 / zoomLevel + 100 + x2 = x2 * 30 / zoomLevel + 160 + y2 = y2 * 30 / zoomLevel + 100 + + ' Erase previous line by drawing in black (color 0) + LINE (previousX1(a), previousY1(a))-(previousX2(a), previousY2(a)), 0 + + ' Draw new line with appropriate color + LINE (x1, y1)-(x2, y2), lineColor(a) + + ' Update previous positions for next frame + previousX1(a) = x1 + previousY1(a) = y1 + previousX2(a) = x2 + previousY2(a) = y2 + NEXT a +END SUB + +SUB InitializePresentation + ' Set up screen and create title animation + SCREEN 13 + + ' Configure palette for title animation + a = 0 + FOR c = 16 TO 31 + OUT &H3C8, c + OUT &H3C9, a * 3 + OUT &H3C9, a * 4.5 + OUT &H3C9, a * 0 + a = a + 1 + NEXT c + + ' Set special colors for title effects + OUT &H3C8, 101 + OUT &H3C9, 63 + OUT &H3C9, 63 + OUT &H3C9, 0 + + OUT &H3C8, 102 + OUT &H3C9, 63 + OUT &H3C9, 10 + OUT &H3C9, 10 + + OUT &H3C8, 103 + OUT &H3C9, 60 + OUT &H3C9, 60 + OUT &H3C9, 0 + + ' Configure palette for background text + a = 0 + FOR c = 50 TO 65 + OUT &H3C8, c + OUT &H3C9, a * 4.5 + OUT &H3C9, a * 0 + OUT &H3C9, (15 - a) * 4.5 + a = a + 1 + NEXT c + + ' Create scrolling title animation + titleText$ = " Esitlus teemal:" + + FOR t = 0 TO 400 + ' Scroll title text across screen + IF t < 320 THEN + FOR y = 0 TO 199 + c = POINT(319 - t, y) + IF c < 100 THEN c = c + 34 + PSET (319 - t, y), c + NEXT y + + x = 319 - t + ' Add text to scrolling animation + IF x / 16 = x \ 16 THEN + segment = x / 16 + IF segment <= LEN(titleText$) THEN + char$ = RIGHT$(LEFT$(titleText$, segment), 1) + PrintText x, 20, 2, 101, char$ + END IF + END IF + END IF + + ' Create second animation phase + IF (t < 360) AND (t > 39) THEN + FOR y = 0 TO 13 + c = POINT(359 - t, y) + IF c < 100 THEN c = c - 34 + PSET (359 - t, y), c + NEXT y + + FOR y = 55 TO 199 + c = POINT(359 - t, y) + IF c < 100 THEN c = c - 34 + PSET (359 - t, y), c + NEXT y + END IF + + ' Frame delay using sound command + SOUND 0, .2 + NEXT t + + ' Draw final title text + PrintText 31, 101, 3, 102, "STROBOSKOOP" + PrintText 29, 99, 3, 102, "STROBOSKOOP" + PrintText 30, 100, 3, 103, "STROBOSKOOP" + + ' Create color flipping effect for title + FOR x = 0 TO 160 + FOR y = 100 TO 150 + c = POINT(x, y) + IF c = 102 THEN c = 103: GOTO 2 + IF c = 103 THEN c = 102: GOTO 2 +2 + PSET (x, y), c + NEXT y + SOUND 0, .1 + NEXT x + + ' Continue color flipping effect + FOR y = 199 TO 120 STEP -1 + FOR x = 0 TO 319 + c = POINT(x, y) + IF c = 102 THEN c = 103: GOTO 3 + IF c = 103 THEN c = 102: GOTO 3 +3 + PSET (x, y), c + NEXT x + SOUND 0, .1 + NEXT y + + ' Print author information + PrintText 49, 179, 1, 0, "autor: Svjatoslav Agejenko" + PrintText 51, 181, 1, 0, "autor: Svjatoslav Agejenko" + PrintText 50, 180, 1, 15, "autor: Svjatoslav Agejenko" + + ' Wait for user input before continuing + WaitForKeyPress keyInput$ + + ' Create screen border effect + DIM buffer(1 TO 30000) + FOR a = 1 TO 320 / 5 + ' Capture and move screen sections + GET (0, 0)-(314, 100), buffer(1) + PUT (5, 0), buffer(1), PSET + LINE (0, 0)-(4, 100), 0, BF + + GET (5, 101)-(319, 199), buffer(1) + PUT (0, 101), buffer(1), PSET + LINE (315, 101)-(319, 199), 0, BF + NEXT a +END SUB + +SUB LoadFontPalette + ' Capture pixel data for each character in font array. + ' Make colors invisible for the human while doing so. + + FOR c = 0 TO 15 + OUT &H3C8, c + OUT &H3C9, 0 + OUT &H3C9, 0 + OUT &H3C9, 0 + NEXT c + + ' Load character pixel patterns into font array + FOR a = 0 TO 207 + LOCATE 1, 1 + IF (a > 5) AND (a < 14) THEN GOTO 1 + PRINT CHR$(a) +1 + FOR y = 0 TO 15 + FOR x = 0 TO 7 + font(x, y, a) = POINT(x, y) + NEXT x + NEXT y + NEXT a +END SUB + +SUB LoadSchematic + ' Load 3D model line data from DATA statements + ' Each line has two endpoints (x1,y1)-(x2,y2) and color + + lineCount = 0 +5 + READ x1, y1, x2, y2 + IF x1 = 999 THEN GOTO 6 + lineCount = lineCount + 1 + originalX1(lineCount) = x1 + originalY1(lineCount) = y1 + originalX2(lineCount) = x2 + originalY2(lineCount) = y2 + lineColor(lineCount) = 11 + GOTO 5 +6 +END SUB + +SUB MoveModel + ' Calculate model movement over time frames + ' Interpolate between start and end positions + + movementXVelocity = endX - startX + movementYVelocity = endY - startY + zoomVelocity = endZoom - startZoom + + ' Animate model by gradually changing position and zoom + FOR a = 1 TO totalFrames + movementX = startX + (movementXVelocity * a / totalFrames) + movementY = startY + (movementYVelocity * a / totalFrames) + zoomLevel = startZoom + (zoomVelocity * a / totalFrames) + DrawLines + ' Use sound command for sub-second delay (QBasic workaround) + SOUND 0, 1 + NEXT a + + ' Draw final position + DrawLines +END SUB + +SUB PrintText (x2%, y%, s%, c%, t$) + ' Print text using custom font + ' Parameters: + ' x2% - starting x position + ' y% - starting y position + ' s% - character size multiplier + ' c% - color to use + ' t$ - text string to print + + currentX = x2 + + ' Process each character in the string + FOR a = 1 TO LEN(t$) + charCode = ASC(RIGHT$(LEFT$(t$, a), 1)) + + ' Draw character using font data + FOR y1 = 0 TO 15 + FOR x1 = 0 TO 7 + IF font(x1, y1, charCode) > 0 THEN + ' Draw filled rectangle for each pixel in character + LINE (x1 * s + currentX, y1 * s + y)-(x1 * s + s - 1 + currentX, y1 * s + s - 1 + y), c, BF + END IF + NEXT x1 + NEXT y1 + + ' Move to next character position + currentX = currentX + (8 * s) + NEXT a +END SUB + +SUB ProgramStart + ' Initialize program with appropriate screen mode + SCREEN 12 + LoadSchematic + LoadFontPalette + + ' Set initial model parameters + movementX = 30 + movementY = 15 + zoomLevel = 10 +END SUB + +SUB WaitForKeyPress (keyInput$) + ' Clear keyboard buffer to avoid ghost keys + FOR a = 1 TO 50 + keyInput$ = INKEY$ + NEXT a + +7 + keyInput$ = INKEY$ + IF keyInput$ = "" THEN GOTO 7 + + ' Wait for another key press after initial one + FOR a = 1 TO 50 + keyInput$ = INKEY$ + NEXT a +END SUB + diff --git a/2D GFX/Stroboscope.png b/2D GFX/Stroboscope.png new file mode 100644 index 0000000..0baee1c Binary files /dev/null and b/2D GFX/Stroboscope.png differ diff --git a/2D GFX/Textures/Circular waves.bas b/2D GFX/Textures/Circular waves.bas new file mode 100755 index 0000000..7ef6fa8 --- /dev/null +++ b/2D GFX/Textures/Circular waves.bas @@ -0,0 +1,36 @@ +' Program to render circular wave patterns. +' Algorithm was accidentally discovered while experimenting with sine function. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003, Initial version +' 2025, Improved program readability + +SCREEN 13 + +' Initialize the screen mode to 320x200 with 16 colors + +' Outer loop for the vertical axis (y-coordinate) +FOR ycoordinate = 1 TO 199 + ' Inner loop for the horizontal axis (x-coordinate) + FOR xcoordinate = 1 TO 319 + ' Calculate the sine value based on the squared distances from the origin + colorvalue = SIN((xcoordinate ^ 2 + ycoordinate ^ 2) / 10) * 10 + + ' Clamp the color value to the range [0, 15] + IF colorvalue < 0 THEN colorvalue = 0 + IF colorvalue > 15 THEN colorvalue = 15 + + ' Set the pixel color at (xcoordinate, ycoordinate) with an offset to use the full 16-color palette + PSET (xcoordinate, ycoordinate), colorvalue + 16 + NEXT xcoordinate +NEXT ycoordinate + +' Wait for user key press +WHILE INKEY$ = "": WEND +CLS +END diff --git a/2D GFX/Textures/Circular waves.png b/2D GFX/Textures/Circular waves.png new file mode 100644 index 0000000..fbb5233 Binary files /dev/null and b/2D GFX/Textures/Circular waves.png differ diff --git a/2D GFX/Textures/Diamond square clouds.bas b/2D GFX/Textures/Diamond square clouds.bas new file mode 100755 index 0000000..1662586 --- /dev/null +++ b/2D GFX/Textures/Diamond square clouds.bas @@ -0,0 +1,96 @@ +DECLARE SUB DrawPixels (x1 AS INTEGER, y1 AS INTEGER, s AS INTEGER) +' Program to render cloud surface using diamond square algorithm. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024.08, Improved program readability + +DECLARE SUB DrawBox (x1 AS INTEGER, y1 AS INTEGER, s AS INTEGER) +DECLARE SUB SetPalette () +DECLARE SUB InitializeProgram () +DEFINT A-Z +InitializeProgram + +DIM SHARED maxLightness AS INTEGER +maxLightness = 127 + +DIM scale AS INTEGER +scale = 2 ^ 8 + +1 : +scale = scale \ 2 +x1 = (319 \ scale) - 1 +y1 = (199 \ scale) - 1 + +FOR y = 0 TO y1 + FOR x = 0 TO x1 + DrawPixels x * scale, y * scale, scale + NEXT x +NEXT y + +IF scale > 2 THEN GOTO 1 +WAITa$ = INPUT$(1) + +SUB DrawPixels (x1 AS INTEGER, y1 AS INTEGER, s AS INTEGER) + ' Get the lightness values for the corners of the box + c1 = POINT(x1, y1) + c2 = POINT(x1 + s, y1) + c3 = POINT(x1, y1 + s) + c4 = POINT(x1 + s, y1 + s) + + ' Calculate the midpoint lightness values + sp = s \ 2 + k = s * 2 + kp = k / 2 + + cc2 = ((c1 + c2) / 2) + (RND * k) - kp + IF cc2 > maxLightness THEN cc2 = maxLightness + IF cc2 < 0 THEN cc2 = 0 + + cc3 = ((c1 + c3) / 2) + (RND * k) - kp + IF cc3 > maxLightness THEN cc3 = maxLightness + IF cc3 < 0 THEN cc3 = 0 + + cc4 = ((c2 + c4) / 2) + (RND * k) - kp + IF cc4 > maxLightness THEN cc4 = maxLightness + IF cc4 < 0 THEN cc4 = 0 + + cc5 = ((c3 + c4) / 2) + (RND * k) - kp + IF cc5 > maxLightness THEN cc5 = maxLightness + IF cc5 < 0 THEN cc5 = 0 + + ' Calculate the central lightness value + cc1 = ((cc2 + cc3 + cc4 + cc5) / 4) + (RND * k) - kp + IF cc1 > maxLightness THEN cc1 = maxLightness + IF cc1 < 0 THEN cc1 = 0 + + ' Set the calculated lightness values for the box + PSET (x1 + sp, y1 + sp), cc1 + PSET (x1 + sp, y1), cc2 + PSET (x1, y1 + sp), cc3 + PSET (x1 + s, y1 + sp), cc4 + PSET (x1 + sp, y1 + s), cc5 +END SUB + +SUB InitializeProgram + ' Set the screen mode and initialize the color palette + SCREEN 13 + SetPalette + RANDOMIZE TIMER +END SUB + +SUB SetPalette + ' Set the color palette for lightness levels + FOR a = 0 TO 255 + OUT &H3C8, a + OUT &H3C9, a / 4 + OUT &H3C9, a / 3 + OUT &H3C9, a / 2.3 + NEXT a +END SUB + diff --git a/2D GFX/Textures/Diamond square clouds.png b/2D GFX/Textures/Diamond square clouds.png new file mode 100644 index 0000000..b596db6 Binary files /dev/null and b/2D GFX/Textures/Diamond square clouds.png differ diff --git a/2D GFX/Textures/Old paper.bas b/2D GFX/Textures/Old paper.bas new file mode 100755 index 0000000..bc012e5 --- /dev/null +++ b/2D GFX/Textures/Old paper.bas @@ -0,0 +1,64 @@ +' Program to render surface resembling old paper. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003, Initial version +' 2025, Improved program readability + +DEFINT A-Z +SCREEN 13 +RANDOMIZE TIMER + +' Initialize the color palette to grayscale. Each color index from 0 to 63 has R, G, B values equal to the index, +' creating a smooth grayscale gradient for the 256-color mode. +FOR paletteIndex = 0 TO 63 + OUT &H3C8, paletteIndex + OUT &H3C9, paletteIndex ' Set red component + OUT &H3C9, paletteIndex ' Set green component + OUT &H3C9, paletteIndex ' Set blue component +NEXT paletteIndex + +noiseOffset = 0 + +' Generate a paper-like surface by averaging the color of the pixel above with some randomness. +' This creates a procedural texture that mimics the roughness of paper. +FOR y = 1 TO 190 + FOR x = 1 TO 310 + stepCounter = stepCounter + 1 + + ' Approximately every 10 steps, introduce a new random noise offset to create variation in the pattern. + ' This prevents the surface from becoming too uniform. + IF stepCounter > 10 THEN + noiseOffset = RND * currentColor / 20 + stepCounter = stepCounter - (RND * 20 + 10) + END IF + + ' Get the color of the pixel directly above the current position. + topColor = POINT(x, y - 1) + + ' Calculate the current color as the average of the top color and the previous current color, + ' plus a small random noise and minus the noise offset. This creates a smooth transition with + ' controlled randomness. + currentColor = (topColor + currentColor) \ 2 + ((RND * 2) - noiseOffset) + + ' Clamp the color value to stay within the valid palette range (0 to 63). + IF currentColor < 0 THEN currentColor = 0 + IF currentColor > 63 THEN currentColor = 63 + + ' Plot the current pixel at (x-1, y) using the calculated color. + PSET (x - 1, y), currentColor + NEXT x + + ' Set the starting color for the next row to the last calculated color of the current row. + ' This ensures continuity between rows. + PSET (0, y + 1), currentColor +NEXT y + +' Wait for a single key press before exiting the program. +inputKey$ = INPUT$(1) + +SYSTEM diff --git a/2D GFX/Textures/Old paper.png b/2D GFX/Textures/Old paper.png new file mode 100644 index 0000000..d9c900b Binary files /dev/null and b/2D GFX/Textures/Old paper.png differ diff --git a/2D GFX/Textures/Wood.bas b/2D GFX/Textures/Wood.bas new file mode 100755 index 0000000..c3251f7 --- /dev/null +++ b/2D GFX/Textures/Wood.bas @@ -0,0 +1,75 @@ +' Program to render surface resembling wood. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024 - 2025, Improved program readability + +DECLARE SUB DrawWoodSurface (woodX%, woodY%) +DECLARE SUB DrawPaper (xPos%, y1Pos%) +DEFINT A-Z +SCREEN 12 +RANDOMIZE TIMER + +' Set palette colors +FOR colorIndex = 0 TO 15 + OUT &H3C8, colorIndex + OUT &H3C9, colorIndex * 4 + OUT &H3C9, colorIndex * 3 + OUT &H3C9, colorIndex * 0 +NEXT colorIndex + +' Main loop to draw wood at random positions +100: +woodX = RND * 400 + 200 +woodY = RND * 100 + 200 +CALL DrawWoodSurface(woodX, woodY) +GOTO 100 + +' Wait for user input to exit +exitKey$ = INPUT$(1) + +SUB DrawWoodSurface (woodX, woodY) + DIM lowerY AS INTEGER + DIM phaseOffset AS INTEGER + DIM xStepCounter AS INTEGER + DIM randomOffset AS INTEGER + DIM newColor AS INTEGER + DIM upperColor AS INTEGER + DIM currentColor AS INTEGER + + ' Draw the outline of the wood + lowerY = woodY + 1 + LINE (0, 0)-(woodX, woodY), 0, BF ' Black background + LINE (5, 5)-(woodX - 5, lowerY - 5), 8, BF ' Gray wood outline + LINE (10, 10)-(woodX - 10, lowerY - 10), 15, BF ' White inner highlight + + ' Initialize random phase offset for color variation + phaseOffset = RND * 300 + + ' Draw the wood texture + FOR y = woodY - 1 TO 0 STEP -1 + FOR x = woodX - 1 TO 0 STEP -1 + xStepCounter = xStepCounter + 1 + IF xStepCounter > woodX THEN + randomOffset = RND * 13 ' Small random noise for texture variation + xStepCounter = SIN((y + phaseOffset) / 100) * woodX ' Sine wave to create wavy grain pattern + END IF + upperColor = POINT(x, y + 1) ' Get color from upper pixel + currentColor = POINT(x, y) ' Get color from current pixel + newColor = (upperColor * 2 + currentColor + newColor * 3 + randomOffset) / 7 + RND * 1 + + ' Ensure color value is within the valid range (0-15) + IF newColor < 0 THEN newColor = 0 + IF newColor > 15 THEN newColor = 15 + + ' Set the pixel color for the wood texture + PSET (x + 1, y), newColor + NEXT x + NEXT y + +END SUB diff --git a/2D GFX/Textures/Wood.png b/2D GFX/Textures/Wood.png new file mode 100644 index 0000000..00726c3 Binary files /dev/null and b/2D GFX/Textures/Wood.png differ diff --git a/2D GFX/Textures/Yellow flame.bas b/2D GFX/Textures/Yellow flame.bas new file mode 100755 index 0000000..a60c235 --- /dev/null +++ b/2D GFX/Textures/Yellow flame.bas @@ -0,0 +1,47 @@ +' Yellow flame. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024.08, Improved program readability + + +DEFINT A-Z ' Define all variables as integers +SCREEN 13 ' Set graphics mode to 320x200 with 256 colors +RANDOMIZE TIMER ' Seed the random number generator + +' Initialize palette registers with sine wave colors +FOR paletteIndex = 0 TO 255 + OUT &H3C8, paletteIndex + OUT &H3C9, INT(SIN(paletteIndex / 21) * 30 + 30) + OUT &H3C9, INT(SIN(paletteIndex / 34) * 30 + 30) + OUT &H3C9, INT(SIN(paletteIndex / 10) * 30 + 30) +NEXT paletteIndex + +' Generate the surface pattern +FOR y = 1 TO 199 + FOR x = 1 TO 319 + prevPixel = POINT(x, y - 1) + leftPixel = POINT(x - 1, y) + diagPixel = POINT(x - 1, y - 1) + left2Pixel = POINT(x - 2, y) + + ' Calculate the average of surrounding pixels and add some randomness + newColor = (prevPixel + leftPixel + diagPixel + left2Pixel) \ 4 + (RND * 5 - 2) + + ' Clamp the color value within the valid range + IF newColor < 0 THEN newColor = 0 + IF newColor > 63 THEN newColor = 63 + + ' Set the pixel with the calculated color + PSET (x, y), newColor + NEXT x +NEXT y + +' Wait for user input to exit +userInput$ = INPUT$(1) + diff --git a/2D GFX/Textures/Yellow flame.png b/2D GFX/Textures/Yellow flame.png new file mode 100644 index 0000000..762a97b Binary files /dev/null and b/2D GFX/Textures/Yellow flame.png differ diff --git a/2D GFX/Textures/index.html b/2D GFX/Textures/index.html new file mode 100644 index 0000000..dc6dbcc --- /dev/null +++ b/2D GFX/Textures/index.html @@ -0,0 +1,627 @@ + + + + + + + +Fractals + + + + + + +
+

Fractals

+ + + +
+

1. Circular waves

+
+

+Circular waves.png +Source code +

+ +
+
' Program to render circular wave patterns.
+' Algorithm was accidentally discovered while experimenting with sine function.
+'
+' This program is free software: released under Creative Commons Zero (CC0) license
+' by Svjatoslav Agejenko.
+' Email: svjatoslav@svjatoslav.eu
+' Homepage: http://www.svjatoslav.eu
+'
+' Changelog:
+' 2003, Initial version
+' 2025, Improved program readability
+
+SCREEN 13
+
+' Initialize the screen mode to 320x200 with 16 colors
+
+' Outer loop for the vertical axis (y-coordinate)
+FOR ycoordinate = 1 TO 199
+    ' Inner loop for the horizontal axis (x-coordinate)
+    FOR xcoordinate = 1 TO 319
+        ' Calculate the sine value based on the squared distances from the origin
+        colorvalue = SIN((xcoordinate ^ 2 + ycoordinate ^ 2) / 10) * 10
+
+        ' Clamp the color value to the range [0, 15]
+        IF colorvalue < 0 THEN colorvalue = 0
+        IF colorvalue > 15 THEN colorvalue = 15
+
+        ' Set the pixel color at (xcoordinate, ycoordinate) with an offset to use the full 16-color palette
+        PSET (xcoordinate, ycoordinate), colorvalue + 16
+    NEXT xcoordinate
+NEXT ycoordinate
+
+' Wait for user key press
+WHILE INKEY$ = "": WEND
+CLS
+END
+
+
+
+
+ +
+

2. Diamond square clouds

+
+

+Diamond square clouds.png +Source code +

+ +
+
DECLARE SUB DrawPixels (x1 AS INTEGER, y1 AS INTEGER, s AS INTEGER)
+' Program to render cloud surface using diamond square algorithm.
+'
+' This program is free software: released under Creative Commons Zero (CC0) license
+' by Svjatoslav Agejenko.
+' Email: svjatoslav@svjatoslav.eu
+' Homepage: http://www.svjatoslav.eu
+'
+' Changelog:
+' 2003.12, Initial version
+' 2024.08, Improved program readability
+
+DECLARE SUB DrawBox (x1 AS INTEGER, y1 AS INTEGER, s AS INTEGER)
+DECLARE SUB SetPalette ()
+DECLARE SUB InitializeProgram ()
+DEFINT A-Z
+InitializeProgram
+
+DIM SHARED maxLightness AS INTEGER
+maxLightness = 127
+
+DIM scale AS INTEGER
+scale = 2 ^ 8
+
+1 :
+scale = scale \ 2
+x1 = (319 \ scale) - 1
+y1 = (199 \ scale) - 1
+
+FOR y = 0 TO y1
+    FOR x = 0 TO x1
+        DrawPixels x * scale, y * scale, scale
+    NEXT x
+NEXT y
+
+IF scale > 2 THEN GOTO 1
+WAITa$ = INPUT$(1)
+
+SUB DrawPixels (x1 AS INTEGER, y1 AS INTEGER, s AS INTEGER)
+    ' Get the lightness values for the corners of the box
+    c1 = POINT(x1, y1)
+    c2 = POINT(x1 + s, y1)
+    c3 = POINT(x1, y1 + s)
+    c4 = POINT(x1 + s, y1 + s)
+
+    ' Calculate the midpoint lightness values
+    sp = s \ 2
+    k = s * 2
+    kp = k / 2
+
+    cc2 = ((c1 + c2) / 2) + (RND * k) - kp
+    IF cc2 > maxLightness THEN cc2 = maxLightness
+    IF cc2 < 0 THEN cc2 = 0
+
+    cc3 = ((c1 + c3) / 2) + (RND * k) - kp
+    IF cc3 > maxLightness THEN cc3 = maxLightness
+    IF cc3 < 0 THEN cc3 = 0
+
+    cc4 = ((c2 + c4) / 2) + (RND * k) - kp
+    IF cc4 > maxLightness THEN cc4 = maxLightness
+    IF cc4 < 0 THEN cc4 = 0
+
+    cc5 = ((c3 + c4) / 2) + (RND * k) - kp
+    IF cc5 > maxLightness THEN cc5 = maxLightness
+    IF cc5 < 0 THEN cc5 = 0
+
+    ' Calculate the central lightness value
+    cc1 = ((cc2 + cc3 + cc4 + cc5) / 4) + (RND * k) - kp
+    IF cc1 > maxLightness THEN cc1 = maxLightness
+    IF cc1 < 0 THEN cc1 = 0
+
+    ' Set the calculated lightness values for the box
+    PSET (x1 + sp, y1 + sp), cc1
+    PSET (x1 + sp, y1), cc2
+    PSET (x1, y1 + sp), cc3
+    PSET (x1 + s, y1 + sp), cc4
+    PSET (x1 + sp, y1 + s), cc5
+END SUB
+
+SUB InitializeProgram
+    ' Set the screen mode and initialize the color palette
+    SCREEN 13
+    SetPalette
+    RANDOMIZE TIMER
+END SUB
+
+SUB SetPalette
+    ' Set the color palette for lightness levels
+    FOR a = 0 TO 255
+        OUT &H3C8, a
+        OUT &H3C9, a / 4
+        OUT &H3C9, a / 3
+        OUT &H3C9, a / 2.3
+    NEXT a
+END SUB
+
+
+
+
+ +
+

3. Old paper

+
+

+Old paper.png +Source code +

+ +
+
' Program to render surface resembling old paper.
+'
+' This program is free software: released under Creative Commons Zero (CC0) license
+' by Svjatoslav Agejenko.
+' Email: svjatoslav@svjatoslav.eu
+' Homepage: http://www.svjatoslav.eu
+'
+' Changelog:
+' 2003, Initial version
+' 2025, Improved program readability
+
+DEFINT A-Z
+SCREEN 13
+RANDOMIZE TIMER
+
+' Initialize the color palette to grayscale. Each color index from 0 to 63 has R, G, B values equal to the index,
+' creating a smooth grayscale gradient for the 256-color mode.
+FOR paletteIndex = 0 TO 63
+    OUT &H3C8, paletteIndex
+    OUT &H3C9, paletteIndex  ' Set red component
+    OUT &H3C9, paletteIndex  ' Set green component
+    OUT &H3C9, paletteIndex  ' Set blue component
+NEXT paletteIndex
+
+noiseOffset = 0
+
+' Generate a paper-like surface by averaging the color of the pixel above with some randomness.
+' This creates a procedural texture that mimics the roughness of paper.
+FOR y = 1 TO 190
+    FOR x = 1 TO 310
+        stepCounter = stepCounter + 1
+
+        ' Approximately every 10 steps, introduce a new random noise offset to create variation in the pattern.
+        ' This prevents the surface from becoming too uniform.
+        IF stepCounter > 10 THEN
+            noiseOffset = RND * currentColor / 20
+            stepCounter = stepCounter - (RND * 20 + 10)
+        END IF
+
+        ' Get the color of the pixel directly above the current position.
+        topColor = POINT(x, y - 1)
+
+        ' Calculate the current color as the average of the top color and the previous current color,
+        ' plus a small random noise and minus the noise offset. This creates a smooth transition with
+        ' controlled randomness.
+        currentColor = (topColor + currentColor) \ 2 + ((RND * 2) - noiseOffset)
+
+        ' Clamp the color value to stay within the valid palette range (0 to 63).
+        IF currentColor < 0 THEN currentColor = 0
+        IF currentColor > 63 THEN currentColor = 63
+
+        ' Plot the current pixel at (x-1, y) using the calculated color.
+        PSET (x - 1, y), currentColor
+    NEXT x
+
+    ' Set the starting color for the next row to the last calculated color of the current row.
+    ' This ensures continuity between rows.
+    PSET (0, y + 1), currentColor
+NEXT y
+
+' Wait for a single key press before exiting the program.
+inputKey$ = INPUT$(1)
+
+SYSTEM
+
+
+
+
+ +
+

4. Wood

+
+

+Wood.png +Source code +

+ +
+
' Program to render surface resembling wood.
+'
+' This program is free software: released under Creative Commons Zero (CC0) license
+' by Svjatoslav Agejenko.
+' Email: svjatoslav@svjatoslav.eu
+' Homepage: http://www.svjatoslav.eu
+'
+' Changelog:
+' 2003.12, Initial version
+' 2024 - 2025, Improved program readability
+
+DECLARE SUB DrawWoodSurface (woodX%, woodY%)
+DECLARE SUB DrawPaper (xPos%, y1Pos%)
+DEFINT A-Z
+SCREEN 12
+RANDOMIZE TIMER
+
+' Set palette colors
+FOR colorIndex = 0 TO 15
+    OUT &H3C8, colorIndex
+    OUT &H3C9, colorIndex * 4
+    OUT &H3C9, colorIndex * 3
+    OUT &H3C9, colorIndex * 0
+NEXT colorIndex
+
+' Main loop to draw wood at random positions
+100:
+woodX = RND * 400 + 200
+woodY = RND * 100 + 200
+CALL DrawWoodSurface(woodX, woodY)
+GOTO 100
+
+' Wait for user input to exit
+exitKey$ = INPUT$(1)
+
+SUB DrawWoodSurface (woodX, woodY)
+    DIM lowerY AS INTEGER
+    DIM phaseOffset AS INTEGER
+    DIM xStepCounter AS INTEGER
+    DIM randomOffset AS INTEGER
+    DIM newColor AS INTEGER
+    DIM upperColor AS INTEGER
+    DIM currentColor AS INTEGER
+
+    ' Draw the outline of the wood
+    lowerY = woodY + 1
+    LINE (0, 0)-(woodX, woodY), 0, BF  ' Black background
+    LINE (5, 5)-(woodX - 5, lowerY - 5), 8, BF  ' Gray wood outline
+    LINE (10, 10)-(woodX - 10, lowerY - 10), 15, BF  ' White inner highlight
+
+    ' Initialize random phase offset for color variation
+    phaseOffset = RND * 300
+
+    ' Draw the wood texture
+    FOR y = woodY - 1 TO 0 STEP -1
+        FOR x = woodX - 1 TO 0 STEP -1
+            xStepCounter = xStepCounter + 1
+            IF xStepCounter > woodX THEN
+                randomOffset = RND * 13  ' Small random noise for texture variation
+                xStepCounter = SIN((y + phaseOffset) / 100) * woodX  ' Sine wave to create wavy grain pattern
+            END IF
+            upperColor = POINT(x, y + 1)  ' Get color from upper pixel
+            currentColor = POINT(x, y)    ' Get color from current pixel
+            newColor = (upperColor * 2 + currentColor + newColor * 3 + randomOffset) / 7 + RND * 1
+
+            ' Ensure color value is within the valid range (0-15)
+            IF newColor < 0 THEN newColor = 0
+            IF newColor > 15 THEN newColor = 15
+
+            ' Set the pixel color for the wood texture
+            PSET (x + 1, y), newColor
+        NEXT x
+    NEXT y
+
+END SUB
+
+
+
+
+ +
+

5. Yellow flame

+
+

+Yellow flame.png +Source code +

+ +
+
' Yellow flame.
+'
+' This program is free software: released under Creative Commons Zero (CC0) license
+' by Svjatoslav Agejenko.
+' Email: svjatoslav@svjatoslav.eu
+' Homepage: http://www.svjatoslav.eu
+'
+' Changelog:
+' 2003.12, Initial version
+' 2024.08, Improved program readability
+
+
+DEFINT A-Z ' Define all variables as integers
+SCREEN 13 ' Set graphics mode to 320x200 with 256 colors
+RANDOMIZE TIMER ' Seed the random number generator
+
+' Initialize palette registers with sine wave colors
+FOR paletteIndex = 0 TO 255
+    OUT &H3C8, paletteIndex
+    OUT &H3C9, INT(SIN(paletteIndex / 21) * 30 + 30)
+    OUT &H3C9, INT(SIN(paletteIndex / 34) * 30 + 30)
+    OUT &H3C9, INT(SIN(paletteIndex / 10) * 30 + 30)
+NEXT paletteIndex
+
+' Generate the surface pattern
+FOR y = 1 TO 199
+    FOR x = 1 TO 319
+        prevPixel = POINT(x, y - 1)
+        leftPixel = POINT(x - 1, y)
+        diagPixel = POINT(x - 1, y - 1)
+        left2Pixel = POINT(x - 2, y)
+
+        ' Calculate the average of surrounding pixels and add some randomness
+        newColor = (prevPixel + leftPixel + diagPixel + left2Pixel) \ 4 + (RND * 5 - 2)
+
+        ' Clamp the color value within the valid range
+        IF newColor < 0 THEN newColor = 0
+        IF newColor > 63 THEN newColor = 63
+
+        ' Set the pixel with the calculated color
+        PSET (x, y), newColor
+    NEXT x
+NEXT y
+
+' Wait for user input to exit
+userInput$ = INPUT$(1)
+
+
+
+
+
+
+

Created: 2025-07-28 ma 03:32

+

Validate

+
+ + diff --git a/2D GFX/Textures/index.org b/2D GFX/Textures/index.org new file mode 100644 index 0000000..46e4c6c --- /dev/null +++ b/2D GFX/Textures/index.org @@ -0,0 +1,64 @@ +#+TITLE: Fractals +#+LANGUAGE: en +#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry} +#+LATEX_HEADER: \usepackage{parskip} +#+LATEX_HEADER: \usepackage[none]{hyphenat} +#+OPTIONS: H:20 num:20 +#+OPTIONS: author:nil + +#+begin_export html + +#+end_export + +* Circular waves +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Circular waves.png]] +[[file:Circular waves.bas][Source code]] + +#+INCLUDE: "Circular waves.bas" src basic-qb45 + +* Diamond square clouds +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Diamond square clouds.png]] +[[file:Diamond square clouds.bas][Source code]] + +#+INCLUDE: "Diamond square clouds.bas" src basic-qb45 + +* Old paper +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Old paper.png]] +[[file:Old paper.bas][Source code]] + +#+INCLUDE: "Old paper.bas" src basic-qb45 + +* Wood +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Wood.png]] +[[file:Wood.bas][Source code]] + +#+INCLUDE: "Wood.bas" src basic-qb45 + +* Yellow flame +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Yellow flame.png]] +[[file:Yellow flame.bas][Source code]] + +#+INCLUDE: "Yellow flame.bas" src basic-qb45 diff --git a/2D GFX/Textures/logo.png b/2D GFX/Textures/logo.png new file mode 100644 index 0000000..0d41afb Binary files /dev/null and b/2D GFX/Textures/logo.png differ diff --git a/2D GFX/Truncated cone.bas b/2D GFX/Truncated cone.bas new file mode 100755 index 0000000..aafae4f --- /dev/null +++ b/2D GFX/Truncated cone.bas @@ -0,0 +1,73 @@ +' Program that draws truncated cone: +' - Top Part: A cylinder (with diagonal hatching). +' - Middle Part: A frustum (truncated cone) – it widens from the bottom cylinder to the top cylinder. +' - Bottom Part: A smaller cylinder. +' +' Goal of this program is to test viability of programming/code to generate images of 3D shapes. +' +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2000, Initial version +' 2024 - 2025, Improved program readability + + +DECLARE SUB DrawLine (x%, y%, l%, clr%) + +DEFINT A-Z +SCREEN 12 + +' Set up the palette +FOR a = 0 TO 16 + OUT &H3C8, a + OUT &H3C9, a * 4 + OUT &H3C9, a * 4 + OUT &H3C9, a * 4 +NEXT + +' Draw the pattern +FOR x = 0 TO 200 + y = SQR((200 - x) * x) / 2 + DrawLine x + 200, y + 200, y * 2, t + LINE (x + 200, y + 202)-(x + 200, y + 250), t + IF x < 195 THEN + LINE (300 + ((x - 100) / 2), y / 2 + 328)-(x + 200, y + 252), t + END IF + LINE (300 + ((x - 100) / 2), y / 2 + 330)-(300 + ((x - 100) / 2), y / 2 + 370), t +NEXT x + +SUB DrawLine (x, y, l, clr) + ' Calculate the initial color value + c = 650 - y - x + + ' Adjust color to be within a specific range +1 IF c > 30 THEN + c = c - 30 + GOTO 1 + END IF + + clr = c + IF clr > 15 THEN + clr = 30 - clr + END IF + + ' Draw a vertical line with varying colors + FOR y1 = y TO y - l STEP -1 + c1 = c + IF c1 > 15 THEN + c1 = 30 - c1 + END IF + + PSET (x, y1), c1 + + ' Increment the color and wrap around if necessary + c = c + 1 + IF c > 30 THEN + c = c - 30 + END IF + NEXT y1 +END SUB diff --git a/2D GFX/Truncated cone.png b/2D GFX/Truncated cone.png new file mode 100644 index 0000000..d2df067 Binary files /dev/null and b/2D GFX/Truncated cone.png differ diff --git a/3D GFX/3D Synthezier/.project b/3D GFX/3D Synthezier/.project new file mode 100644 index 0000000..969bddf --- /dev/null +++ b/3D GFX/3D Synthezier/.project @@ -0,0 +1,11 @@ + + + 3dSynthezier + + + + + + + + diff --git a/3D GFX/3D Synthezier/bin/3dparse.bas b/3D GFX/3D Synthezier/bin/3dparse.bas new file mode 100755 index 0000000..ad6f74c --- /dev/null +++ b/3D GFX/3D Synthezier/bin/3dparse.bas @@ -0,0 +1,614 @@ +' Program that parses special programmable 3D scene description language +' and generates from it 3D objects in Wavefront .obj format. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' ?, Initial version +' 2024, Improved program readability + +' Before running, make sure include path is correct. See below. + +DECLARE SUB parsel (a$) +DECLARE SUB stat2 (b!) +DECLARE SUB stat () +DECLARE SUB getchc (a$, b!) +DECLARE SUB start () +DECLARE SUB qui () +DECLARE SUB flushpoly (a!) +DECLARE SUB usemtl (a$) +DECLARE SUB flushp () +DECLARE SUB parse (a$) +DECLARE SUB geth (b!) +DECLARE SUB cmd (a$) +DECLARE SUB getson (a$) + +DIM SHARED px(1 TO 1000) +DIM SHARED py(1 TO 1000) +DIM SHARED pz(1 TO 1000) +DIM SHARED nump +DIM SHARED numpa +DIM SHARED numpo + +DIM SHARED fil(1 TO 100) +DIM SHARED mitus +DIM SHARED sona$(1 TO 20) +DIM SHARED res + +DIM SHARED mtlm +DIM SHARED mtl$(1 TO 50) +DIM SHARED mtlp1(1 TO 50, 1 TO 100) +DIM SHARED mtlp2(1 TO 50, 1 TO 100) +DIM SHARED mtlp3(1 TO 50, 1 TO 100) +DIM SHARED mtlp4(1 TO 50, 1 TO 100) +DIM SHARED mtll(1 TO 50) +DIM SHARED cmtl + +DIM SHARED stkf(1 TO 500) +DIM SHARED stks(1 TO 500) +DIM SHARED stkp +DIM SHARED fc +DIM SHARED ipath$ + +DIM SHARED chc$(1 TO 10, 1 TO 500) +DIM SHARED chcl(1 TO 10) +DIM SHARED chcf$(1 TO 10) +DIM SHARED chct(1 TO 10) +DIM SHARED chctim +DIM SHARED mtmprs +DIM SHARED tmr + +DIM SHARED var$(0 TO 100) +DIM SHARED flag(1 TO 50, 0 TO 9) +DIM SHARED cstatt +DIM SHARED cstatm + +' Path to include resources from. Adjust according to your installation! +ipath$ = "C:\GRAPHICS\3D\3DSYNT~1\INCLUDE\" + +start + +IF COMMAND$ = "" THEN END +CLS + +cmd "obj ~" + COMMAND$ +qui +CLOSE #res +fil(res) = 0 + +PRINT "done" +SYSTEM + +SUB cmd (z$) + a$ = z$ + IF LEFT$(a$, 1) = "?" THEN + IF flag(mtmprs, VAL(RIGHT$(LEFT$(a$, 2), 1))) = 1 THEN + a$ = RIGHT$(a$, LEN(a$) - 3) + ELSE + GOTO 10 + END IF + END IF + + getson a$ + + SELECT CASE sona$(1) + CASE "end" + qui + PRINT "terminated from file" + SYSTEM + + CASE "warn" + COLOR 12 + PRINT sona$(2) + COLOR 7 + b$ = INPUT$(1) + + CASE "p" + nump = nump + 1 + numpa = numpa + 1 + x = VAL(sona$(2)) + y = VAL(sona$(3)) + z = VAL(sona$(4)) + + ' Transform the coordinates based on the stack + FOR b = stkp TO 1 STEP -1 + SELECT CASE stkf(b) + CASE 1 + c1 = SIN(stks(b) / fc) + s1 = COS(stks(b) / fc) + z1 = x * c1 + z * s1 + x1 = x * s1 - z * c1 + x = x1 + z = z1 + + CASE 2 + c1 = SIN(stks(b) / fc) + s1 = COS(stks(b) / fc) + z1 = y * c1 + z * s1 + y1 = y * s1 - z * c1 + y = y1 + z = z1 + + CASE 3 + s1 = SIN(stks(b) / fc) + c1 = COS(stks(b) / fc) + y1 = y * c1 + x * s1 + x1 = y * s1 - x * c1 + x = x1 + y = y1 + + CASE 10 + x = x + stks(b) + + CASE 11 + y = y + stks(b) + + CASE 12 + z = z + stks(b) + + CASE 20 + x = x - stks(b) + + CASE 21 + y = y - stks(b) + + CASE 22 + z = z - stks(b) + + CASE 30 + x = x * stks(b) + + CASE 31 + y = y * stks(b) + + CASE 32 + z = z * stks(b) + END SELECT + NEXT b + + ' Store the transformed coordinates + px(nump) = x + py(nump) = y + pz(nump) = z + + IF nump > 900 THEN flushp + + CASE "here" + numpo = numpa + + CASE "mtl" + usemtl sona$(2) + + CASE "mtlrnd" + b = INT(RND * (mitus - 1)) + 2 + usemtl sona$(b) + + CASE "f" + IF mtll(cmtl) > 90 THEN flushpoly cmtl + b = mtll(cmtl) + b = b + 1 + mtll(cmtl) = b + mtlp1(cmtl, b) = VAL(sona$(2)) + numpo + mtlp2(cmtl, b) = VAL(sona$(3)) + numpo + mtlp3(cmtl, b) = VAL(sona$(4)) + numpo + + ' Handle the optional fourth vertex + IF sona$(5) = "" THEN + mtlp4(cmtl, b) = -32000 + ELSE + mtlp4(cmtl, b) = VAL(sona$(5)) + numpo + END IF + + CASE "obj" + d = stkp + + ' Parse the transformation stack + FOR a = mitus TO 3 STEP -1 + b$ = LEFT$(sona$(a), 2) + c = VAL(RIGHT$(sona$(a), LEN(sona$(a)) - 2)) + stkp = stkp + 1 + stks(stkp) = c + + SELECT CASE b$ + CASE "xz" + stkf(stkp) = 1 + + CASE "yz" + stkf(stkp) = 2 + + CASE "xy" + stkf(stkp) = 3 + + CASE "x+" + stkf(stkp) = 10 + + CASE "y+" + stkf(stkp) = 11 + + CASE "z+" + stkf(stkp) = 12 + + CASE "x-" + stkf(stkp) = 20 + + CASE "y-" + stkf(stkp) = 21 + + CASE "z-" + stkf(stkp) = 22 + + CASE "x*" + stkf(stkp) = 30 + + CASE "y*" + stkf(stkp) = 31 + + CASE "z*" + stkf(stkp) = 32 + END SELECT + NEXT a + + ' Process the object command + a$ = sona$(2) + mtmprs = mtmprs + 1 + cstatt = cstatt + 1 + + LOCATE 10 + mtmprs, 1 + PRINT a$ + + ' Read and execute the next command + getchc a$, b + c = 1 + +2 + d$ = chc$(b, c) + cmd d$ + + ' Check if the current command matches the expected one + IF chcf$(b) <> a$ THEN + getchc a$, b + END IF + + c = c + 1 + + ' Continue reading and executing commands until the stack is empty + IF c <= chcl(b) THEN GOTO 2 + + tmr = tmr + 1 + + ' If more than 20 commands have been processed, update statistics + IF tmr > 20 THEN + tmr = 0 + stat + END IF + + LOCATE 10 + mtmprs, 1 + PRINT SPACE$(LEN(a$)) + + ' Decrement the command parser stack + mtmprs = mtmprs - 1 + + stkp = d + + CASE "#" + + CASE "out" + geth res + OPEN sona$(2) + ".obj" FOR OUTPUT AS #res + PRINT #res, "mtllib result.mtl" + + CASE "rnd" + b = INT(RND * (mitus - 1)) + 2 + c$ = sona$(b) + + ' Replace caret characters with spaces + f$ = "" + FOR d = 1 TO LEN(c$) + e$ = RIGHT$(LEFT$(c$, d), 1) + IF e$ = "^" THEN + e$ = " " + END IF + f$ = f$ + e$ + NEXT d + + cmd f$ + + CASE "set" + var$(VAL(sona$(2))) = sona$(3) + + CASE "cmp" + ' Compare two strings + IF sona$(3) = sona$(4) THEN + b = 1 + ELSE + b = 0 + END IF + + ' Store the comparison result in the flag array + flag(mtmprs, VAL(sona$(2))) = b + + END SELECT + +10 +END SUB + +SUB flushp + + FOR a = 1 TO nump + PRINT #res, "v " + STR$(px(a)) + " " + STR$(py(a)) + " " + STR$(-pz(a)) + NEXT a + + nump = 0 + +END SUB + +SUB flushpoly (a) + + IF mtll(a) = 0 THEN GOTO 5 + + ' Write the material usage line + PRINT #res, "usemtl " + mtl$(a) + + ' Write the face definitions + FOR b = 1 TO mtll(a) + c$ = "f " + STR$(mtlp1(a, b) + 1) + STR$(mtlp2(a, b) + 1) + STR$(mtlp3(a, b) + 1) + + ' Handle the optional fourth vertex + IF mtlp4(a, b) <> -32000 THEN + c$ = c$ + STR$(mtlp4(a, b) + 1) + END IF + + PRINT #res, c$ + NEXT b + mtll(a) = 0 + +5 +END SUB + +SUB getchc (a$, b!) + + ' Search for the command in the cache + FOR c = 1 TO 10 + IF chcf$(c) = a$ THEN + b = c + GOTO 6 + END IF + NEXT c + + ' Find the least recently used entry in the cache + d = 32000 + FOR c = 1 TO 10 + IF chct(c) < d THEN + d = chct(c) + e = c + END IF + NEXT c + + ' Load the command file + g = 0 + geth f + + cstatm = cstatm + 1 + b$ = a$ + + ' Remove leading tilde if present + IF LEFT$(b$, 1) = "~" THEN + b$ = RIGHT$(b$, LEN(b$) - 1) + ELSE + b$ = ipath$ + b$ + END IF + + + PRINT "File:" + b$ + OPEN b$ + ".3d" FOR INPUT AS #f + +8 + + ' Read commands from the file until EOF + IF EOF(f) <> 0 THEN GOTO 7 + + LINE INPUT #f, c$ + + ' Skip empty lines + IF (LEFT$(c$, 1) <> "#") AND (c$ <> SPACE$(LEN(c$))) THEN + g = g + 1 + chc$(e, g) = c$ + END IF + + GOTO 8 + +7 + + ' Close the file and update statistics + CLOSE #f + fil(f) = 0 + chcl(e) = g + + b = e + chcf$(e) = a$ + + stat + +6 + + ' Update the cache timestamps + chctim = chctim + 1 + chct(b) = chctim + + ' If the cache is full, halve all timestamps + IF chctim > 10000 THEN + FOR c = 1 TO 10 + chct(c) = chct(c) / 2 + NEXT c + + chctim = chctim / 2 + END IF +END SUB + +SUB geth (b!) + + ' Find an unused file handle + FOR a = 1 TO 100 + IF fil(a) = 0 THEN + fil(a) = 1 + b = a + GOTO 1 + END IF + NEXT a + +1 +END SUB + +SUB getson (a$) + + ' Prepare the sona array for parsing + b$ = a$ + " " + + FOR a = 1 TO 20 + sona$(a) = "" + NEXT a + + mitus = 0 + + e = 1 + + ' Parse the input string + FOR c = 1 TO LEN(b$) + d$ = RIGHT$(LEFT$(b$, c), 1) + + IF d$ = " " OR d$ = CHR$(9) THEN + e = 1 + ELSE + IF e = 1 THEN + mitus = mitus + 1 + END IF + + sona$(mitus) = sona$(mitus) + d$ + e = 0 + END IF + NEXT c + + ' Replace variable names with their values + FOR c = 1 TO mitus + IF LEFT$(sona$(c), 1) = "%" THEN + sona$(c) = var$(VAL(RIGHT$(sona$(c), LEN(sona$(c)) - 1))) + END IF + NEXT c +END SUB + +SUB qui + + ' Flush the vertex buffer and write all polygons + flushp + + FOR a = 1 TO mtlm + flushpoly a + NEXT a + + stat +END SUB + +SUB start + + RANDOMIZE TIMER + + ' Initialize arrays + FOR a = 1 TO 50 + FOR b = 0 TO 9 + flag(a, b) = 0 + NEXT b + NEXT a + + FOR a = 0 TO 100 + var$(a) = "" + NEXT a + + ' Initialize command cache + FOR a = 1 TO 10 + FOR b = 1 TO 500 + chc$(a, b) = "" + NEXT b + + chcl(a) = 0 + chcf$(a) = "" + chct(a) = 0 + NEXT a + + ' Initialize material lists + FOR a = 1 TO 50 + mtll(a) = 0 + NEXT a + + ' Initialize file handles + FOR a = 1 TO 100 + fil(a) = 0 + NEXT a + + nump = 0 + numpa = 0 + numpo = 0 + mtlm = 0 + stkp = 0 + fc = 180 / 3.141285 + chctim = 0 + mtmprs = 0 + cstatt = 0 + cstatm = 0 +END SUB + +SUB stat + + ' Display statistics + LOCATE 1, 1 + + FOR a = 1 TO 10 + PRINT a, chcf$(a), chct(a), chcl(a) + NEXT a + + COLOR 10 + + LOCATE 1, 50 + PRINT cstatt; "parsed" + + LOCATE 2, 50 + PRINT cstatm; "cache miss" + + LOCATE 3, 50 + PRINT INT(cstatm / cstatt * 100); "% cache miss " + + COLOR 7 +END SUB + +SUB stat2 (b!) + + ' Display the contents of a specific command cache + CLS + + FOR a = 1 TO chcl(b) + PRINT chc$(b, a) + NEXT a + + c$ = INPUT$(1) +END SUB + +SUB usemtl (a$) + + ' Find the material in the list + FOR b = 1 TO mtlm + IF mtl$(b) = a$ THEN + cmtl = b + GOTO 4 + END IF + NEXT b + + ' If not found, add it to the list + mtlm = mtlm + 1 + mtl$(mtlm) = a$ + cmtl = mtlm + +4 +END SUB + diff --git a/3D GFX/3D Synthezier/bin/city1.3d b/3D GFX/3D Synthezier/bin/city1.3d new file mode 100644 index 0000000..04279fa --- /dev/null +++ b/3D GFX/3D Synthezier/bin/city1.3d @@ -0,0 +1,46 @@ +# small city block + +out city1 + +obj maja xz90 +obj maja xz90 x+48 +obj maja xz90 x+96 +obj maja x+36 z-84 + +# korgel olevad autod +obj cars x+25 +obj cars x+27 z-50 +obj cars x+26 z-25 y-10 +obj cars x+25 z-40 y-20 + +obj cars x+73 z-25 y+1 +obj cars x+75 z-50 y-2 +obj cars xz-90 z-60 +obj cars xz-90 z-62 x+50 +obj cars xz-90 z+60 x+1 +obj cars xz-90 z+61 x+52 + +obj cars x+121 z-100 y+1 +obj cars x+122 z-70 y-5 +obj cars x+123 y+2 +obj cars x+122 z-38 y-2 + +# allpool olevad autod +obj cars x+25 y-30 +obj cars x+27 z-50 y-50 +obj cars x+26 z-25 y-40 +obj cars x+25 z-40 y-50 + +obj cars x+73 z-25 y-34 +obj cars x+75 z-50 y-36 +obj cars xz-90 z-60 y-43 +obj cars xz-90 z-62 x+50 y-29 +obj cars xz-90 z+60 x+1 y-37 +obj cars xz-90 z+61 x+52 y-33 + +obj cars x+121 z-100 y-41 +obj cars x+122 z-70 y-45 +obj cars x+123 y-32 +obj cars x+122 z-38 y-34 + + diff --git a/3D GFX/3D Synthezier/bin/city1.bat b/3D GFX/3D Synthezier/bin/city1.bat new file mode 100755 index 0000000..d4fb06e --- /dev/null +++ b/3D GFX/3D Synthezier/bin/city1.bat @@ -0,0 +1,6 @@ +@echo off + +rem This script will instruct generator to make "city1". +rem Note: When specifying source file, avoid extension. + +qb /RUN 3dparse.bas /CMD city1 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/bin/city2.3d b/3D GFX/3D Synthezier/bin/city2.3d new file mode 100644 index 0000000..8215a3e --- /dev/null +++ b/3D GFX/3D Synthezier/bin/city2.3d @@ -0,0 +1,45 @@ +# Big city, be prepared to wait ~10 min, on P133. + +out city2 +obj blk4 y-145 +obj blk4 y-116 +obj blk4 y-87 +obj blk4 y-58 +obj blk4 y-29 +obj blk4 + +mtl kivi +obj ring x*20 z*20 y+26 +mtl glass_transp +obj kuppel x*20 z*20 y*10 y+26 + +mtl kivi +obj ring x*20 z*20 y+26 z+64.6412 +mtl glass_transp +obj kuppel x*20 z*20 y*10 y+26 z+64.6412 + +mtl kivi +obj ring x*20 z*20 y+26 x+55.9809 z+32.3206 +mtl glass_transp +obj kuppel x*20 z*20 y*10 y+26 x+55.9809 z+32.3206 + +mtl kivi +obj ring x*20 z*20 y+26 x+55.9809 z-32.3206 +mtl glass_transp +obj kuppel x*20 z*20 y*10 y+26 x+55.9809 z-32.3206 + +mtl kivi +obj ring x*20 z*20 y+26 z-64.6412 +mtl glass_transp +obj kuppel x*20 z*20 y*10 y+26 z-64.6412 + +mtl kivi +obj ring x*20 z*20 y+26 x-55.9809 z-32.3206 +mtl glass_transp +obj kuppel x*20 z*20 y*10 y+26 x-55.9809 z-32.3206 + +mtl kivi +obj ring x*20 z*20 y+26 x-55.9809 z+32.3206 +mtl glass_transp +obj kuppel x*20 z*20 y*10 y+26 x-55.9809 z+32.3206 + diff --git a/3D GFX/3D Synthezier/bin/city2.bat b/3D GFX/3D Synthezier/bin/city2.bat new file mode 100755 index 0000000..6aa7f5a --- /dev/null +++ b/3D GFX/3D Synthezier/bin/city2.bat @@ -0,0 +1,6 @@ +@echo off + +rem This script will instruct generator to make "city2". +rem Note: When specifying source file, avoid extension. + +qb /RUN 3dparse.bas /CMD city2 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/bin/result.mtl b/3D GFX/3D Synthezier/bin/result.mtl new file mode 100644 index 0000000..9d689f1 --- /dev/null +++ b/3D GFX/3D Synthezier/bin/result.mtl @@ -0,0 +1,108 @@ +# Wavefront material file +# Must be in the same directory with parsed modules. + +newmtl default + Ns 32 + d 1 + illum 2 + Kd 0.4 0.4 0.4 + Ks 0.7 0.7 0.7 + Ka 0.3 0.3 0.3 + +newmtl muld + Ns 32 + d 1 + illum 2 + Kd 0.247843 0.17098 0.158431 + Ks 0 0 0 + Ka 0.185882 0.128235 0.118824 + +newmtl kivi + Ns 32 + d 1 + illum 2 + Kd 0.24935 0.216378 0.24935 + Ks 0 0 0 + Ka 0.128955 0.111903 0.128955 + +newmtl klaastume + Ns 32 + d 1 + illum 2 + Kd 0.139608 0.0313726 0.108235 + Ks 1.6633 0.373775 1.28952 + Ka 0.104706 0.0235294 0.0811765 + +newmtl klaashele + Ns 32 + d 1 + illum 2 + Kd 0.0925798 0.104637 0.109804 + Ks 3.54381 4.00533 4.20313 + Ka 0.737332 0.833356 0.87451 + +newmtl seintellis + Ns 32 + d 1 + illum 2 + Kd 0.476309 0.432511 0.0875971 + Ks 0 0 0 + Ka 0.0642215 0.058316 0.0118108 + +newmtl pronks + Ns 4 + d 1 + illum 2 + Kd 0.238431 0.148435 0.0584391 + Ks 0.636863 0.396478 0.156094 + Ka 0.0627451 0.0390619 0.0153787 + +newmtl solar + Ns 32 + d 1 + illum 2 + Kd 0.189927 0.10519 0.745098 + Ks 1.27451 0.705882 5 + Ka 0.0609766 0.0337716 0.239216 + +newmtl metal_yellow + Ns 32 + d 1 + illum 2 + Kd 0.619608 0.619608 0 + Ks 3.01563 3.01563 0 + Ka 0.3 0.3 0 + +newmtl metal_blue + Ns 32 + d 1 + illum 2 + Kd 0.243137 0.243137 0.666667 + Ks 0.695221 0.695221 1.90625 + Ka 0.109412 0.109412 0.3 + +newmtl light_red + Ns 32 + d 1 + illum 2 + Kd 0.443137 0 0 + Ks 3.8125 0 0 + Ka 0.3 0 0 + + +newmtl light_white + Ns 32 + d 1 + illum 2 + Kd 0.497347 0.528135 0.603922 + Ks 2.35478 2.50055 2.85938 + Ka 0.247059 0.262353 0.3 + +newmtl glass_transp + Ns 39 + d 0.572549 + illum 2 + Kd 0.129412 0.427451 0.776471 + Ks 0.129412 0.427451 0.776471 + Ka 0.000985995 0.00325677 0.00591597 + diff --git a/3D GFX/3D Synthezier/doc/hexagonal city, 1.jpeg b/3D GFX/3D Synthezier/doc/hexagonal city, 1.jpeg new file mode 100644 index 0000000..7d724be Binary files /dev/null and b/3D GFX/3D Synthezier/doc/hexagonal city, 1.jpeg differ diff --git a/3D GFX/3D Synthezier/doc/hexagonal city, 2.jpeg b/3D GFX/3D Synthezier/doc/hexagonal city, 2.jpeg new file mode 100644 index 0000000..16d56a5 Binary files /dev/null and b/3D GFX/3D Synthezier/doc/hexagonal city, 2.jpeg differ diff --git a/3D GFX/3D Synthezier/doc/hexagonal city, 3.jpeg b/3D GFX/3D Synthezier/doc/hexagonal city, 3.jpeg new file mode 100644 index 0000000..0d7fb88 Binary files /dev/null and b/3D GFX/3D Synthezier/doc/hexagonal city, 3.jpeg differ diff --git a/3D GFX/3D Synthezier/doc/hexagonal city.blend b/3D GFX/3D Synthezier/doc/hexagonal city.blend new file mode 100644 index 0000000..6ab7003 Binary files /dev/null and b/3D GFX/3D Synthezier/doc/hexagonal city.blend differ diff --git a/3D GFX/3D Synthezier/doc/index.html b/3D GFX/3D Synthezier/doc/index.html new file mode 100644 index 0000000..8066d7a --- /dev/null +++ b/3D GFX/3D Synthezier/doc/index.html @@ -0,0 +1,1573 @@ + + + + + + + +3D Synthezier + + + + + + + + + + + + + + + + + + +
+

3D Synthezier

+ + + + +
+

1. Operating principle

+
+

+Parses scene definition language and creates 3D world based on +it. Result will be in a wavefront obj file, witch can be then +visualized using external renderer. +

+ +

+Basic concept of defining scene is: +

+
    +
  • Simple and primitive objects are created on point and polygon level.
  • +
  • More complex ones can be created my combinig already existing ones, +while applying various transformations on them.
  • +
+ +

+Objects with all its subobjects can be rotated, mirrored or resized +omong any axis. Generator has built in cache for data input and output +to minimize file access. +

+ +

+Examples: +

+ +

+Download Blender files: +

+ + + +++ ++ + + + + + + + + + + + + + + + + + +
filesize
rectangular city.blend3.6 MB
hexagonal city.blend21 MB
+ +

+They were produced by importing generated wavefront obj files into +Blender. +

+
+ +
+

1.1. Rectangular city

+
+ +
+

rectangular city, 1.jpeg +

+
+ + +
+

rectangular city, 2.jpeg +

+
+ + +
+

rectangular city, 3.jpeg +

+
+
+
+
+

1.2. Hexagonal city

+
+ +
+

hexagonal city, 1.jpeg +

+
+ + +
+

hexagonal city, 2.jpeg +

+
+ + +
+

hexagonal city, 3.jpeg +

+
+
+
+
+
+

2. Scene description language

+
+

+See also examples. +

+
+
+

2.1. here

+
+
+here
+
+ +

+defines new segment +

+
+
+
+

2.2. p

+
+
+p  x y z
+
+ +

+defines new point +

+
+
+
+

2.3. f

+
+
+f  p1 p2 p3 p4
+
+ +

+defines new polygon, p4 may be unused +

+
+
+
+

2.4. warn

+
+
+warn  <message>
+
+ +

+displays warning message, and wait for key +

+
+
+
+

2.5. end

+
+
+end
+
+ +

+terminates parser +

+
+
+
+

2.6. mtl

+
+
+mtl  material
+
+ +

+selects material +

+
+
+
+

2.7. mtlrnd

+
+
+mtlrnd  material ...
+
+ +

+selects random material from list +

+
+
+
+

2.8. obj

+
+
+obj  object xz45 xy20 x+3 y*2
+
+ +

+includes sub object, can be rotated moved or resized, across X Y Z. If +object name begin vith ~ then it will be loaded from current +directory. if object name ends with ~ then object will be parsed +directly from file, and not chached, to allow loading of greater than +500 lines files. +

+ + +
+

rotation.png +

+
+
+
+
+

2.9. rnd

+
+
+rnd  p^1^2^3 p^7^2^1
+
+ +

+select random command to execute, ^ will be converted to spaces. +

+
+
+
+

2.10. #

+
+
+# whatever text
+
+ +

+comment +

+
+
+
+

2.11. out

+
+
+out  file
+
+ +

+specify output file name, must be first command +

+
+
+
+

2.12. set

+
+
+set  variable  contents
+
+ +

+set variable contents, variable must be number, contents can be +string. max variables is 100. first is 0. +

+
+
+
+

2.13. variables usage

+
+
+anycommand %1 anything
+
+ +

+inserts variable 1 contents info line +

+
+
+
+

2.14. cmp

+
+
+cmp  flag string1 string2
+
+ +

+compares strings, and inserts TRUE to flag, if they are equal, else inserts FALSE. max 9 falgs, 0 first. Each subobject has its own flags. +

+
+
+
+

2.15. ?

+
+
+?flag anycommand
+
+ +

+executes command if flag is true. +

+ +

+exapmle: ?3 obj car z*2 xy45 +

+
+
+
+

2.16. dum

+
+
+dum
+
+ +

+dummy function, does notheing +

+
+
+
+ +
+

3. Installation

+
+

+Edit bin/3dparse.bas file and update include path in there. +

+
+ +
+

3.1. System requirements

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + +
softwaretested version
DOS6.22
QBasic4.5
+
+
+ +
+

3.2. Directory layout

+
+
+
bin
+
3dparse.bas
3D generator main executable
+
city1.3d
city with square-like buildings
+
city2.3d
city with hexangular buildings
+
result.mtl
shared material library
+
*.bat
quick launch scripts
+
+ +
include
3D objects used to compose the scene
+
+
+
+
+ +
+

4. Usage

+
+

+Make sure you have QB binaries in your PATH. Execute +

+
+bin/city1.bat
+
+ +

+or +

+
+bin/city2.bat
+
+ +

+to generate example cities. After parsing is finished, appropriate +*.obj files will appear in the bin directory holding generated scene. +Visualize scene with your favourite renderer. +

+
+
+
+
+

Created: 2025-07-28 ma 03:33

+

Validate

+
+ + diff --git a/3D GFX/3D Synthezier/doc/index.org b/3D GFX/3D Synthezier/doc/index.org new file mode 100644 index 0000000..1ecf34f --- /dev/null +++ b/3D GFX/3D Synthezier/doc/index.org @@ -0,0 +1,172 @@ +#+SETUPFILE: ~/.emacs.d/org-styles/html/darksun.theme +#+TITLE: 3D Synthezier +#+LANGUAGE: en +#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry} +#+LATEX_HEADER: \usepackage{parskip} +#+LATEX_HEADER: \usepackage[none]{hyphenat} + +#+OPTIONS: H:20 num:20 +#+OPTIONS: author:nil + +#+begin_export html + +#+end_export + + +* Operating principle + +Parses scene definition language and creates 3D world based on +it. Result will be in a [[https://en.wikipedia.org/wiki/Wavefront_.obj_file][wavefront obj file]], witch can be then +visualized using external renderer. + +Basic concept of defining scene is: +- Simple and primitive objects are created on point and polygon level. +- More complex ones can be created my combinig already existing ones, + while applying various transformations on them. + +Objects with all its subobjects can be rotated, mirrored or resized +omong any axis. Generator has built in cache for data input and output +to minimize file access. + +*Examples:* + +Download Blender files: +| file | size | +|------------------------+--------| +| [[file:rectangular city.blend][rectangular city.blend]] | 3.6 MB | +| [[file:hexagonal city.blend][hexagonal city.blend]] | 21 MB | + +They were produced by importing generated [[https://en.wikipedia.org/wiki/Wavefront_.obj_file][wavefront obj files]] into +[[https://www.blender.org/][Blender]]. + +** Rectangular city + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:rectangular city, 1.jpeg]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:rectangular city, 2.jpeg]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:rectangular city, 3.jpeg]] +** Hexagonal city + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:hexagonal city, 1.jpeg]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:hexagonal city, 2.jpeg]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:hexagonal city, 3.jpeg]] +* Scene description language +See also examples. +** here + : here + defines new segment +** p + : p x y z + defines new point +** f + : f p1 p2 p3 p4 + defines new polygon, p4 may be unused +** warn + : warn + displays warning message, and wait for key +** end + : end + terminates parser +** mtl + : mtl material + selects material +** mtlrnd + : mtlrnd material ... + selects random material from list +** obj + : obj object xz45 xy20 x+3 y*2 + includes sub object, can be rotated moved or resized, across X Y Z. If + object name begin vith ~ then it will be loaded from current + directory. if object name ends with ~ then object will be parsed + directly from file, and not chached, to allow loading of greater than + 500 lines files. + + [[file:rotation.png]] +** rnd + : rnd p^1^2^3 p^7^2^1 + select random command to execute, ^ will be converted to spaces. +** # + : # whatever text + comment +** out + : out file + specify output file name, must be first command +** set + : set variable contents + set variable contents, variable must be number, contents can be + string. max variables is 100. first is 0. +** variables usage + : anycommand %1 anything + inserts variable 1 contents info line +** cmp + : cmp flag string1 string2 + compares strings, and inserts TRUE to flag, if they are equal, else inserts FALSE. max 9 falgs, 0 first. Each subobject has its own flags. +** ? + : ?flag anycommand + executes command if flag is true. + + exapmle: ?3 obj car z*2 xy45 +** dum + : dum + dummy function, does notheing + +* Installation +Edit *bin/3dparse.bas* file and update include path in there. + +** System requirements + +| software | tested version | +|----------+----------------| +| DOS | 6.22 | +| QBasic | 4.5 | + +** Directory layout + ++ bin :: + + 3dparse.bas :: 3D generator main executable + + city1.3d :: city with square-like buildings + + city2.3d :: city with hexangular buildings + + result.mtl :: shared material library + + *.bat :: quick launch scripts + ++ include :: 3D objects used to compose the scene + +* Usage + +Make sure you have QB binaries in your PATH. Execute +: bin/city1.bat +or +: bin/city2.bat +to generate example cities. After parsing is finished, appropriate +*.obj files will appear in the bin directory holding generated scene. +Visualize scene with your favourite renderer. diff --git a/3D GFX/3D Synthezier/doc/rectangular city, 1.jpeg b/3D GFX/3D Synthezier/doc/rectangular city, 1.jpeg new file mode 100644 index 0000000..def4065 Binary files /dev/null and b/3D GFX/3D Synthezier/doc/rectangular city, 1.jpeg differ diff --git a/3D GFX/3D Synthezier/doc/rectangular city, 2.jpeg b/3D GFX/3D Synthezier/doc/rectangular city, 2.jpeg new file mode 100644 index 0000000..0173e47 Binary files /dev/null and b/3D GFX/3D Synthezier/doc/rectangular city, 2.jpeg differ diff --git a/3D GFX/3D Synthezier/doc/rectangular city, 3.jpeg b/3D GFX/3D Synthezier/doc/rectangular city, 3.jpeg new file mode 100644 index 0000000..20fc33c Binary files /dev/null and b/3D GFX/3D Synthezier/doc/rectangular city, 3.jpeg differ diff --git a/3D GFX/3D Synthezier/doc/rectangular city.blend b/3D GFX/3D Synthezier/doc/rectangular city.blend new file mode 100644 index 0000000..a532224 Binary files /dev/null and b/3D GFX/3D Synthezier/doc/rectangular city.blend differ diff --git a/3D GFX/3D Synthezier/doc/rotation.png b/3D GFX/3D Synthezier/doc/rotation.png new file mode 100644 index 0000000..e6281ec Binary files /dev/null and b/3D GFX/3D Synthezier/doc/rotation.png differ diff --git a/3D GFX/3D Synthezier/include/6nrk0s.3d b/3D GFX/3D Synthezier/include/6nrk0s.3d new file mode 100644 index 0000000..906ff9b --- /dev/null +++ b/3D GFX/3D Synthezier/include/6nrk0s.3d @@ -0,0 +1,6 @@ +# suur 6 nurkse maja kompleks koos korteritega + +obj blk3 +set 1 kivi +set 2 0 +obj nrk6 x*20 y*5 z*20 y+21 diff --git a/3D GFX/3D Synthezier/include/6nrk2s.3d b/3D GFX/3D Synthezier/include/6nrk2s.3d new file mode 100644 index 0000000..8a40ce1 --- /dev/null +++ b/3D GFX/3D Synthezier/include/6nrk2s.3d @@ -0,0 +1,8 @@ +# suur 6 nurkse maja kompleks koos korterite ja 2. sillaga + +obj blk3 +set 1 kivi +set 2 0 +obj nrk6 x*20 y*5 z*20 y+21 +obj bridgegl xz-90 y+22.5 x-1.5 z-17.3206 +obj bridgegl xz-30 y+22.5 x+14.25 z-9.9593 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/blk1.3d b/3D GFX/3D Synthezier/include/blk1.3d new file mode 100644 index 0000000..661ff77 --- /dev/null +++ b/3D GFX/3D Synthezier/include/blk1.3d @@ -0,0 +1,15 @@ +# tavaline suur aken +here +p 0 0 0 +p 6 0 0 +p 6 -3 0 +p 0 -3 0 + +p 0.5 -0.5 -0.01 +p 5.5 -0.5 -0.01 +p 5.5 -2 -0.01 +p 0.5 -2 -0.01 +mtl seintellis +f 0 1 2 3 +mtlrnd klaashele klaastume +f 4 5 6 7 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/blk2.3d b/3D GFX/3D Synthezier/include/blk2.3d new file mode 100644 index 0000000..b2828bf --- /dev/null +++ b/3D GFX/3D Synthezier/include/blk2.3d @@ -0,0 +1,33 @@ +# v2ike aken koosparkimisplatsiga + +# rnd obj^car^xz90^x+4.5^z-1.7^y-2.5 # # + +here +p 0 0 0 +p 6 0 0 +p 6 -3 0 +p 0 -3 0 + +p 0.5 -0.5 -0.01 +p 2 -0.5 -0.01 +p 2 -2 -0.01 +p 0.5 -2 -0.01 + +p 2.5 -0.5 -0.01 +p 5.5 -0.5 -0.01 +p 5.5 -3 -0.01 +p 2.5 -3 -0.01 + +p 0 -3 0 +p 6 -3 0 +p 6 -3 -3 +p 0 -3 -3 + +mtl seintellis +f 0 1 2 3 +mtlrnd klaashele klaastume +f 4 5 6 7 +mtl pronks +f 8 9 10 11 +mtl kivi +f 12 13 14 15 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/blk3.3d b/3D GFX/3D Synthezier/include/blk3.3d new file mode 100644 index 0000000..a62b82c --- /dev/null +++ b/3D GFX/3D Synthezier/include/blk3.3d @@ -0,0 +1,34 @@ +# kuuenurkse maja korterite blokk + +obj krs2 +obj krs2 y+3 +obj krs2 y+6 +obj krs2 y+9 + +obj krs2 y+12 +obj krs2 y+15 +obj krs2 y+18 +obj krs2 y+21 + +here +p -12 -3 -20.7846 +p 12 -3 -20.7846 +p 24 -3 0 +p 12 -3 20.7846 +p -12 -3 20.7846 +p -24 -3 0 + +p -12 21 -20.7846 +p 12 21 -20.7846 +p 24 21 0 +p 12 21 20.7846 +p -12 21 20.7846 +p -24 21 0 + +mtl seintellis +f 0 1 2 3 +f 3 4 5 0 +f 6 7 8 9 +f 9 10 11 6 + + diff --git a/3D GFX/3D Synthezier/include/blk4.3d b/3D GFX/3D Synthezier/include/blk4.3d new file mode 100644 index 0000000..924f68a --- /dev/null +++ b/3D GFX/3D Synthezier/include/blk4.3d @@ -0,0 +1,8 @@ +# 1 kompleks 7st, 6 nurkselt sildadega uhendatud elamu moodulitest +obj 6nrk0s +obj 6nrk2s z+64.6412 +obj 6nrk2s xz-60 x+55.9809 z+32.3206 +obj 6nrk2s xz-120 x+55.9809 z-32.3206 +obj 6nrk2s xz-180 z-64.6412 +obj 6nrk2s xz-240 x-55.9809 z-32.3206 +obj 6nrk2s xz-300 x-55.9809 z+32.3206 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/bridge.3d b/3D GFX/3D Synthezier/include/bridge.3d new file mode 100644 index 0000000..d6dc47f --- /dev/null +++ b/3D GFX/3D Synthezier/include/bridge.3d @@ -0,0 +1,5 @@ +obj handrail +obj handrail z+3 +set 1 kivi +set 2 0 +obj nrk4 x*3.2 y*0.2 xz-90 z+1.5 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/bridge1.3d b/3D GFX/3D Synthezier/include/bridge1.3d new file mode 100644 index 0000000..e8563ae --- /dev/null +++ b/3D GFX/3D Synthezier/include/bridge1.3d @@ -0,0 +1,36 @@ +obj bridge +obj bridge x+1 +obj bridge x+2 +obj bridge x+3 +obj bridge x+4 + +obj bridge x+5 +obj bridge x+6 +obj bridge x+7 +obj bridge x+8 +obj bridge x+9 + +obj bridge x+10 +obj bridge x+11 +obj bridge x+12 +obj bridge x+13 +obj bridge x+14 + +obj bridge x+15 +obj bridge x+16 +obj bridge x+17 +obj bridge x+18 +obj bridge x+19 + +obj bridge x+20 +obj bridge x+21 +obj bridge x+22 +obj bridge x+23 +obj bridge x+24 + +obj bridge x+25 +obj bridge x+26 +obj bridge x+27 +obj bridge x+28 +obj bridge x+29 + diff --git a/3D GFX/3D Synthezier/include/bridgegl.3d b/3D GFX/3D Synthezier/include/bridgegl.3d new file mode 100644 index 0000000..4bb43a5 --- /dev/null +++ b/3D GFX/3D Synthezier/include/bridgegl.3d @@ -0,0 +1,4 @@ +obj bridge1 +set 1 glass_transp +set 2 0 +obj nrk8 xz-90 x*30 z*3 z+1.5 y*2 y+1 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/bus.3d b/3D GFX/3D Synthezier/include/bus.3d new file mode 100644 index 0000000..21f5753 --- /dev/null +++ b/3D GFX/3D Synthezier/include/bus.3d @@ -0,0 +1,52 @@ +obj bus_frnt +obj bus_frnt xz180 z+9 + +obj bus_wind x+2.5 y+1 z+2 +obj bus_wind x+2.5 y+1 z+3.5 +obj bus_wind x+2.5 y+1 z+5 + +obj bus_wind x*-1 x-2.5 y+1 z+2 +obj bus_wind x*-1 x-2.5 y+1 z+3.5 +obj bus_wind x*-1 x-2.5 y+1 z+5 + +obj flare_w x+1 z-0.01 +obj flare_w x*-1 x-1 z-0.01 +obj flare_r x+1 z+9.01 +obj flare_r x*-1 x-1 z+9.01 +here +p -2.5 1 0.5 +p 2.5 1 0.5 +p 2.5 -1 0.5 +p -2.5 -1 0.5 + +p -2.5 1 8.5 +p 2.5 1 8.5 +p 2.5 -1 8.5 +p -2.5 -1 8.5 + +p -2.5 1 2 +p 2.5 1 2 +p -1.5 2 2 +p 1.5 2 2 + +p -2.5 1 6.5 +p 2.5 1 6.5 +p -1.5 2 6.5 +p 1.5 2 6.5 + + +mtl metal_yellow +# f 0 1 5 4 +f 1 2 6 5 +f 2 3 7 6 +f 3 0 4 7 + +f 4 5 15 14 +f 4 12 14 +f 5 13 15 + +mtl klaashele +f 0 1 11 10 +f 0 8 10 +f 1 9 11 + diff --git a/3D GFX/3D Synthezier/include/bus_frnt.3d b/3D GFX/3D Synthezier/include/bus_frnt.3d new file mode 100644 index 0000000..62d4137 --- /dev/null +++ b/3D GFX/3D Synthezier/include/bus_frnt.3d @@ -0,0 +1,17 @@ +here +p -2 -0.5 0 +p 2 -0.5 0 +p 2 0.5 0 +p -2 0.5 0 + +p -2.5 -1 0.5 +p 2.5 -1 0.5 +p 2.5 1 0.5 +p -2.5 1 0.5 + +mtl metal_yellow +f 0 1 2 3 +f 0 1 5 4 +f 1 2 6 5 +f 2 3 7 6 +f 0 3 7 4 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/bus_wind.3d b/3D GFX/3D Synthezier/include/bus_wind.3d new file mode 100644 index 0000000..c0f63de --- /dev/null +++ b/3D GFX/3D Synthezier/include/bus_wind.3d @@ -0,0 +1,17 @@ +here +p 0 0 0 +p -1 1 0 +p -1 1 0.5 +p 0 0 0.5 + +p -1 1 1.5 +p 0 0 1.5 + +p -2.5 1 0 +p -2.5 1 1.5 + +mtl metal_yellow +f 0 1 2 3 +f 1 4 7 6 +mtl klaashele +f 2 3 5 4 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/car.3d b/3D GFX/3D Synthezier/include/car.3d new file mode 100644 index 0000000..4d6258b --- /dev/null +++ b/3D GFX/3D Synthezier/include/car.3d @@ -0,0 +1,33 @@ +obj car_frnt +obj car_frnt xz180 z+4 +obj flare_w x+0.25 z-0.01 +obj flare_w x*-1 x-0.25 z-0.01 +obj flare_r x+0.25 z+4.01 +obj flare_r x*-1 x-0.25 z+4.01 + +here +p -1 0.5 1 +p 1 0.5 1 +p 1 -0.5 1 +p -1 -0.5 1 + +p -1 0.5 3 +p 1 0.5 3 +p 1 -0.5 3 +p -1 -0.5 3 + +p -0.5 1.5 2.5 +p 0.5 1.5 2.5 + + + +mtl metal_yellow +# f 0 4 5 1 +f 1 5 6 2 +f 2 6 7 3 +f 3 7 4 0 +mtl klaashele +f 8 9 1 0 +f 8 0 4 +f 9 1 5 +f 8 9 5 4 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/car_frnt.3d b/3D GFX/3D Synthezier/include/car_frnt.3d new file mode 100644 index 0000000..697b6f4 --- /dev/null +++ b/3D GFX/3D Synthezier/include/car_frnt.3d @@ -0,0 +1,17 @@ +here +p -0.5 0.25 0 +p 0.5 0.25 0 +p 0.5 -0.25 0 +p -0.5 -0.25 0 + +p -1 0.5 1 +p 1 0.5 1 +p 1 -0.5 1 +p -1 -0.5 1 + +mtl metal_yellow +f 0 1 2 3 +f 0 4 5 1 +f 1 5 6 2 +f 2 6 7 3 +f 3 7 4 0 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/cars.3d b/3D GFX/3D Synthezier/include/cars.3d new file mode 100644 index 0000000..97e1482 --- /dev/null +++ b/3D GFX/3D Synthezier/include/cars.3d @@ -0,0 +1,10 @@ +obj bus xz190 y+1 +obj car xz175 z+20 y-0.5 +obj car xz182 yz10 x+5 z+50 y-0.2 +obj car xz170 yz-5 xy10 x+1 z+60 y-1.3 +obj car xz188 yz-2 xy-5 x+3 z+34 y+0.6 + +obj car xz5 yz1 xy15 x-5 z+55 y+0.23 +obj car xz-2 yz2 xy-3 x-10 z+32 y-1.1 +obj car xz-4 yz-8 xy-9 x-5 z+8 y+0.4 +rnd obj^car^xz3^yz-2^xy3^x-8^z+57^y+0.1 obj^pol^xz3^yz-2^xy3^x-8^z+57^y+0.1 diff --git a/3D GFX/3D Synthezier/include/flare_r.3d b/3D GFX/3D Synthezier/include/flare_r.3d new file mode 100644 index 0000000..39a35f2 --- /dev/null +++ b/3D GFX/3D Synthezier/include/flare_r.3d @@ -0,0 +1,9 @@ +here +p 0 0.3 0 +p 0.3 0.3 0 +p 0.3 0 0 +p 0 0 0 +p 0.4 0.15 0 +mtl light_red +f 0 1 2 3 +f 1 2 4 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/flare_w.3d b/3D GFX/3D Synthezier/include/flare_w.3d new file mode 100644 index 0000000..65044d0 --- /dev/null +++ b/3D GFX/3D Synthezier/include/flare_w.3d @@ -0,0 +1,9 @@ +here +p 0 0.3 0 +p 0.3 0.3 0 +p 0.3 0 0 +p 0 0 0 +p 0.4 0.15 0 +mtl light_white +f 0 1 2 3 +f 1 2 4 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/handrail.3d b/3D GFX/3D Synthezier/include/handrail.3d new file mode 100644 index 0000000..91f80fe --- /dev/null +++ b/3D GFX/3D Synthezier/include/handrail.3d @@ -0,0 +1,8 @@ +# size x=1 y=1 z=0.1 + +set 1 pronks +set 2 1 +obj nrk8 xz-90 y*0.1 z*0.1 y+1 +set 2 0 +obj nrk8 x*0.07 y*0.07 yz-90 +obj nrk8 x*0.07 y*0.07 yz-90 x+0.5 diff --git a/3D GFX/3D Synthezier/include/katus.3d b/3D GFX/3D Synthezier/include/katus.3d new file mode 100644 index 0000000..78547d1 --- /dev/null +++ b/3D GFX/3D Synthezier/include/katus.3d @@ -0,0 +1,12 @@ +here +p 0 0 0 +p 96 0 0 +p 96 0 24 +p 0 0 24 + +mtl kivi +f 0 1 2 3 + +obj toru x+12 z+12 +obj toru x+36 z+12 +obj solar x+72 z+12 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/katus2.3d b/3D GFX/3D Synthezier/include/katus2.3d new file mode 100644 index 0000000..7fb86bf --- /dev/null +++ b/3D GFX/3D Synthezier/include/katus2.3d @@ -0,0 +1,19 @@ +here +p 0 0 0 +p 96 0 0 +p 96 0 24 +p 0 0 24 + +mtl kivi +f 0 1 2 3 + +obj toru x+12 z+12 +# obj toru x*0.2 z*0.2 y*0.5 x+36 z+12 +obj toru x*0.4 z*0.4 y*0.5 x+30 z+6 +obj toru x*0.4 z*0.4 y*0.5 x+30 z+18 +obj toru x*0.4 z*0.4 y*0.5 x+42 z+6 +obj toru x*0.4 z*0.4 y*0.5 x+42 z+18 + +obj bus x+60 y+1 z+2 +obj bus x+70 y+1 z+2 +obj bus x+80 y+1 z+2 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/katus3.3d b/3D GFX/3D Synthezier/include/katus3.3d new file mode 100644 index 0000000..c8d0676 --- /dev/null +++ b/3D GFX/3D Synthezier/include/katus3.3d @@ -0,0 +1,31 @@ +here +p 0 0 0 +p 96 0 0 +p 96 0 24 +p 0 0 24 + +mtl kivi +f 0 1 2 3 + +obj pol y+0.5 x+2 z+1 +obj pol y+0.5 x+9 z+1 +obj pol y+0.5 x+16 z+1 +obj pol y+0.5 x+23 z+1 +obj pol y+0.5 x+30 z+1 +obj pol y+0.5 x+37 z+1 +obj pol y+0.5 x+44 z+1 +obj pol y+0.5 x+51 z+1 + +obj pol y+0.5 x+2 z+13 +obj pol y+0.5 x+9 z+13 +obj pol y+0.5 x+16 z+13 +obj pol y+0.5 x+23 z+13 +obj pol y+0.5 x+30 z+13 +obj pol y+0.5 x+37 z+13 +obj pol y+0.5 x+44 z+13 +obj pol y+0.5 x+51 z+13 + +obj bus xz90 y+1 x+70 z+6 +obj bus xz90 y+1 x+85 z+6 +obj bus xz90 y+1 x+70 z+17 +obj bus xz90 y+1 x+85 z+17 diff --git a/3D GFX/3D Synthezier/include/krs1.3d b/3D GFX/3D Synthezier/include/krs1.3d new file mode 100644 index 0000000..ffee343 --- /dev/null +++ b/3D GFX/3D Synthezier/include/krs1.3d @@ -0,0 +1,6 @@ +# neljanurkse maja korrus + +obj seinp1 x-48 z-12 +obj seinp1 xz180 x+48 z+12 +obj seinl1 xz270 x-48 z+12 +obj seinl1 xz90 x+48 z-12 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/krs2.3d b/3D GFX/3D Synthezier/include/krs2.3d new file mode 100644 index 0000000..9cac787 --- /dev/null +++ b/3D GFX/3D Synthezier/include/krs2.3d @@ -0,0 +1,9 @@ +# kuuenurkse maja 1 korrus + +obj seinl1 x-12 z-20.7846 +obj seinl1 xz60 x+12 z-20.7846 +obj seinl1 xz120 x+24 +obj seinl1 xz180 x+12 z+20.7846 +obj seinl1 xz240 x-12 z+20.7846 +obj seinl1 xz300 x-24 + diff --git a/3D GFX/3D Synthezier/include/kuppel.3d b/3D GFX/3D Synthezier/include/kuppel.3d new file mode 100644 index 0000000..b4b8771 --- /dev/null +++ b/3D GFX/3D Synthezier/include/kuppel.3d @@ -0,0 +1,292 @@ +here +p 0 0 0 +p -1.0 0.0 0.0 +p -0.965926 0.0 -0.258819 +p -0.965926 0.0 0.258819 +p -0.965926 0.258819 0.0 +p -0.933013 0.258819 -0.250000 +p -0.933013 0.258819 0.250000 +p -0.866025 0.0 -0.500000 +p -0.866025 0.0 0.500000 +p -0.866025 0.500000 0.0 +p -0.836516 0.258819 -0.482963 +p -0.836516 0.258819 0.482963 +p -0.836516 0.500000 -0.224144 +p -0.836516 0.500000 0.224144 +p -0.750000 0.500000 -0.433013 +p -0.750000 0.500000 0.433013 +p -0.707107 0.0 -0.707107 +p -0.707107 0.0 0.707107 +p -0.707107 0.707107 0.0 +p -0.683013 0.258819 -0.683013 +p -0.683013 0.258819 0.683013 +p -0.683013 0.707107 -0.183013 +p -0.683013 0.707107 0.183013 +p -0.612372 0.500000 -0.612372 +p -0.612372 0.500000 0.612372 +p -0.612372 0.707107 -0.353553 +p -0.612372 0.707107 0.353553 +p -0.500000 0.0 -0.866025 +p -0.500000 0.0 0.866025 +p -0.500000 0.866025 0.0 +p -0.500000 0.707107 -0.500000 +p -0.500000 0.707107 0.500000 +p -0.482963 0.258819 -0.836516 +p -0.482963 0.258819 0.836516 +p -0.482963 0.866025 -0.129410 +p -0.482963 0.866025 0.129410 +p -0.433013 0.500000 -0.750000 +p -0.433013 0.500000 0.750000 +p -0.433013 0.866025 -0.250000 +p -0.433013 0.866025 0.250000 +p -0.353553 0.707107 -0.612372 +p -0.353553 0.707107 0.612372 +p -0.353553 0.866025 -0.353553 +p -0.353553 0.866025 0.353553 +p -0.258819 0.0 -0.965926 +p -0.258819 0.0 0.965926 +p -0.258819 0.965926 0.0 +p -0.250000 0.258819 -0.933013 +p -0.250000 0.258819 0.933013 +p -0.250000 0.866025 -0.433013 +p -0.250000 0.866025 0.433013 +p -0.250000 0.965926 -0.066987 +p -0.250000 0.965926 0.066987 +p -0.224144 0.500000 -0.836516 +p -0.224144 0.500000 0.836516 +p -0.224144 0.965926 -0.129410 +p -0.224144 0.965926 0.129410 +p -0.183013 0.707107 -0.683013 +p -0.183013 0.707107 0.683013 +p -0.183013 0.965926 -0.183013 +p -0.183013 0.965926 0.183013 +p -0.129410 0.866025 -0.482963 +p -0.129410 0.866025 0.482963 +p -0.129410 0.965926 -0.224144 +p -0.129410 0.965926 0.224144 +p -0.066987 0.965926 -0.250000 +p -0.066987 0.965926 0.250000 +p 0.0 0.0 1.0 +p 0.0 0.258819 0.965926 +p 0.0 0.500000 0.866025 +p 0.0 0.707107 0.707107 +p 0.0 0.866025 0.500000 +p 0.0 0.965926 0.258819 +p 0.0 1.0 0.0 +p 0.0 0.965926 -0.258819 +p 0.0 0.866025 -0.500000 +p 0.0 0.707107 -0.707107 +p 0.0 0.500000 -0.866025 +p 0.0 0.258819 -0.965926 +p 0.0 0.0 -1.0 +p 0.066987 0.965926 -0.250000 +p 0.066987 0.965926 0.250000 +p 0.129410 0.866025 -0.482963 +p 0.129410 0.866025 0.482963 +p 0.129410 0.965926 -0.224144 +p 0.129410 0.965926 0.224144 +p 0.183013 0.707107 -0.683013 +p 0.183013 0.707107 0.683013 +p 0.183013 0.965926 -0.183013 +p 0.183013 0.965926 0.183013 +p 0.224144 0.500000 -0.836516 +p 0.224144 0.500000 0.836516 +p 0.224144 0.965926 -0.129410 +p 0.224144 0.965926 0.129410 +p 0.250000 0.258819 -0.933013 +p 0.250000 0.258819 0.933013 +p 0.250000 0.866025 -0.433013 +p 0.250000 0.866025 0.433013 +p 0.250000 0.965926 -0.066987 +p 0.250000 0.965926 0.066987 +p 0.258819 0.0 -0.965926 +p 0.258819 0.0 0.965926 +p 0.258819 0.965926 0.0 +p 0.353553 0.707107 -0.612372 +p 0.353553 0.707107 0.612372 +p 0.353553 0.866025 -0.353553 +p 0.353553 0.866025 0.353553 +p 0.433013 0.500000 -0.750000 +p 0.433013 0.500000 0.750000 +p 0.433013 0.866025 -0.250000 +p 0.433013 0.866025 0.250000 +p 0.482963 0.258819 -0.836516 +p 0.482963 0.258819 0.836516 +p 0.482963 0.866025 -0.129410 +p 0.482963 0.866025 0.129410 +p 0.500000 0.707107 -0.500000 +p 0.500000 0.707107 0.500000 +p 0.500000 0.0 -0.866025 +p 0.500000 0.0 0.866025 +p 0.500000 0.866025 0.0 +p 0.612372 0.500000 -0.612372 +p 0.612372 0.500000 0.612372 +p 0.612372 0.707107 -0.353553 +p 0.612372 0.707107 0.353553 +p 0.683013 0.258819 -0.683013 +p 0.683013 0.258819 0.683013 +p 0.683013 0.707107 -0.183013 +p 0.683013 0.707107 0.183013 +p 0.707107 0.0 -0.707107 +p 0.707107 0.0 0.707107 +p 0.707107 0.707107 0.0 +p 0.750000 0.500000 -0.433013 +p 0.750000 0.500000 0.433013 +p 0.836516 0.258819 -0.482963 +p 0.836516 0.258819 0.482963 +p 0.836516 0.500000 -0.224144 +p 0.836516 0.500000 0.224144 +p 0.866025 0.0 -0.500000 +p 0.866025 0.0 0.500000 +p 0.866025 0.500000 0.0 +p 0.933013 0.258819 -0.250000 +p 0.933013 0.258819 0.250000 +p 0.965926 0.0 -0.258819 +p 0.965926 0.0 0.258819 +p 0.965926 0.258819 0.0 +p 1.0 0.0 0.0 + +f 73 102 98 +f 102 119 113 98 +f 119 130 126 113 +f 130 139 135 126 +f 139 144 140 135 +f 144 145 142 140 +f 73 98 92 +f 98 113 109 92 +f 113 126 122 109 +f 126 135 131 122 +f 135 140 133 131 +f 140 142 137 133 +f 73 92 88 +f 92 109 105 88 +f 109 122 115 105 +f 122 131 120 115 +f 131 133 124 120 +f 133 137 128 124 +f 73 88 84 +f 88 105 96 84 +f 105 115 103 96 +f 115 120 107 103 +f 120 124 111 107 +f 124 128 117 111 +f 73 84 80 +f 84 96 82 80 +f 96 103 86 82 +f 103 107 90 86 +f 107 111 94 90 +f 111 117 100 94 +f 73 80 74 +f 80 82 75 74 +f 82 86 76 75 +f 86 90 77 76 +f 90 94 78 77 +f 94 100 79 78 +f 73 74 65 +f 74 75 61 65 +f 75 76 57 61 +f 76 77 53 57 +f 77 78 47 53 +f 78 79 44 47 +f 73 65 63 +f 65 61 49 63 +f 61 57 40 49 +f 57 53 36 40 +f 53 47 32 36 +f 47 44 27 32 +f 73 63 59 +f 63 49 42 59 +f 49 40 30 42 +f 40 36 23 30 +f 36 32 19 23 +f 32 27 16 19 +f 73 59 55 +f 59 42 38 55 +f 42 30 25 38 +f 30 23 14 25 +f 23 19 10 14 +f 19 16 7 10 +f 73 55 51 +f 55 38 34 51 +f 38 25 21 34 +f 25 14 12 21 +f 14 10 5 12 +f 10 7 2 5 +f 73 51 46 +f 51 34 29 46 +f 34 21 18 29 +f 21 12 9 18 +f 12 5 4 9 +f 5 2 1 4 +f 73 46 52 +f 46 29 35 52 +f 29 18 22 35 +f 18 9 13 22 +f 9 4 6 13 +f 4 1 3 6 +f 73 52 56 +f 52 35 39 56 +f 35 22 26 39 +f 22 13 15 26 +f 13 6 11 15 +f 6 3 8 11 +f 73 56 60 +f 56 39 43 60 +f 39 26 31 43 +f 26 15 24 31 +f 15 11 20 24 +f 11 8 17 20 +f 73 60 64 +f 60 43 50 64 +f 43 31 41 50 +f 31 24 37 41 +f 24 20 33 37 +f 20 17 28 33 +f 73 64 66 +f 64 50 62 66 +f 50 41 58 62 +f 41 37 54 58 +f 37 33 48 54 +f 33 28 45 48 +f 73 66 72 +f 66 62 71 72 +f 62 58 70 71 +f 58 54 69 70 +f 54 48 68 69 +f 48 45 67 68 +f 73 72 81 +f 72 71 83 81 +f 71 70 87 83 +f 70 69 91 87 +f 69 68 95 91 +f 68 67 101 95 +f 73 81 85 +f 81 83 97 85 +f 83 87 104 97 +f 87 91 108 104 +f 91 95 112 108 +f 95 101 118 112 +f 73 85 89 +f 85 97 106 89 +f 97 104 116 106 +f 104 108 121 116 +f 108 112 125 121 +f 112 118 129 125 +f 73 89 93 +f 89 106 110 93 +f 106 116 123 110 +f 116 121 132 123 +f 121 125 134 132 +f 125 129 138 134 +f 73 93 99 +f 93 110 114 99 +f 110 123 127 114 +f 123 132 136 127 +f 132 134 141 136 +f 134 138 143 141 +f 73 99 102 +f 99 114 119 102 +f 114 127 130 119 +f 127 136 139 130 +f 136 141 144 139 +f 141 143 145 144 diff --git a/3D GFX/3D Synthezier/include/maja.3d b/3D GFX/3D Synthezier/include/maja.3d new file mode 100644 index 0000000..55c11e5 --- /dev/null +++ b/3D GFX/3D Synthezier/include/maja.3d @@ -0,0 +1,33 @@ +obj krs1 y-90 +obj krs1 y-87 +obj krs1 y-84 +obj krs1 y-81 +obj krs1 y-78 +obj krs1 y-75 +obj krs1 y-72 +obj krs1 y-69 +obj krs1 y-66 +obj krs1 y-63 +obj krs1 y-60 +obj krs1 y-57 +obj krs1 y-54 +obj krs1 y-51 +obj krs1 y-48 +obj krs1 y-45 +obj krs1 y-42 +obj krs1 y-39 +obj krs1 y-36 +obj krs1 y-33 +obj krs1 y-30 +obj krs1 y-27 +obj krs1 y-24 +obj krs1 y-21 +obj krs1 y-18 +obj krs1 y-15 +obj krs1 y-12 +obj krs1 y-9 +obj krs1 y-6 +obj krs1 y-3 +obj krs1 +obj krs1 y+3 +rnd obj^katus^x-48^z-12^y+3 obj^katus2^x-48^z-12^y+3 obj^katus3^x-48^z-12^y+3 diff --git a/3D GFX/3D Synthezier/include/nrk4.3d b/3D GFX/3D Synthezier/include/nrk4.3d new file mode 100644 index 0000000..296dc22 --- /dev/null +++ b/3D GFX/3D Synthezier/include/nrk4.3d @@ -0,0 +1,29 @@ +# 1 -body material +# 2 = 1 -ends filled +# +# 0--1 +# | | Y +# 3--2 +# +# X + +here +p -0.5 0.5 0 +p 0.5 0.5 0 +p 0.5 -0.5 0 +p -0.5 -0.5 0 + +p -0.5 0.5 1 +p 0.5 0.5 1 +p 0.5 -0.5 1 +p -0.5 -0.5 1 + +mtl %1 +f 0 1 5 4 +f 1 2 6 5 +f 2 3 7 6 +f 3 0 4 7 + +cmp 0 %2 1 +?0 f 0 1 2 3 +?0 f 4 5 6 7 diff --git a/3D GFX/3D Synthezier/include/nrk6.3d b/3D GFX/3D Synthezier/include/nrk6.3d new file mode 100644 index 0000000..d096deb --- /dev/null +++ b/3D GFX/3D Synthezier/include/nrk6.3d @@ -0,0 +1,33 @@ +# 1 -body material +# 2 = 1 -ends filled + +here +p -0.5 0 0.866 +p 0.5 0 0.866 +p 1 0 0 +p 0.5 0 -0.866 +p -0.5 0 -0.866 +p -1 0 0 + +p -0.5 1 0.866 +p 0.5 1 0.866 +p 1 1 0 +p 0.5 1 -0.866 +p -0.5 1 -0.866 +p -1 1 0 + +mtl %1 +f 0 1 7 6 +f 1 2 8 7 +f 2 3 9 8 +f 3 4 10 9 +f 4 5 11 10 +f 5 0 6 11 + +cmp 0 %2 1 +?0 f 0 1 2 3 +?0 f 3 4 5 0 +?0 f 6 7 8 9 +?0 f 9 10 11 6 + + diff --git a/3D GFX/3D Synthezier/include/nrk8.3d b/3D GFX/3D Synthezier/include/nrk8.3d new file mode 100644 index 0000000..5e7986a --- /dev/null +++ b/3D GFX/3D Synthezier/include/nrk8.3d @@ -0,0 +1,47 @@ +# 1 -body material +# 2 = 1 -ends filled +# +# 0--1 +# 7/ \2 +# | * | Y +# 6\ /3 +# 5--4 +# +# X + +here +p -0.333 1 0 +p 0.333 1 0 +p 1 0.333 0 +p 1 -0.333 0 +p 0.333 -1 0 +p -0.333 -1 0 +p -1 -0.333 0 +p -1 0.333 0 + +p -0.333 1 1 +p 0.333 1 1 +p 1 0.333 1 +p 1 -0.333 1 +p 0.333 -1 1 +p -0.333 -1 1 +p -1 -0.333 1 +p -1 0.333 1 + +mtl %1 +f 0 1 9 8 +f 1 2 10 9 +f 2 3 11 10 +f 3 4 12 11 +f 4 5 13 12 +f 5 6 14 13 +f 6 7 15 14 +f 7 0 8 15 + +cmp 0 %2 1 +?0 f 0 1 4 5 +?0 f 1 2 3 4 +?0 f 0 5 6 7 +?0 f 8 9 12 13 +?0 f 9 10 11 12 +?0 f 8 13 14 15 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/plaat.3d b/3D GFX/3D Synthezier/include/plaat.3d new file mode 100644 index 0000000..8255032 --- /dev/null +++ b/3D GFX/3D Synthezier/include/plaat.3d @@ -0,0 +1,19 @@ +here +p -0.1 -0.01 -0.1 +p 0.1 -0.01 -0.1 +p 0.1 -0.01 0.1 +p -0.1 -0.01 0.1 + +p -0.1 0.01 -0.1 +p 0.1 0.01 -0.1 +p 0.1 0.01 0.1 +p -0.1 0.01 0.1 + +mtl kivi +f 0 1 2 3 +f 4 5 6 7 + +f 0 1 5 4 +f 1 2 6 5 +f 2 3 7 6 +f 3 0 4 7 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/pol.3d b/3D GFX/3D Synthezier/include/pol.3d new file mode 100644 index 0000000..256589d --- /dev/null +++ b/3D GFX/3D Synthezier/include/pol.3d @@ -0,0 +1,37 @@ +obj pol_frnt +obj pol_frnt z*-1 z+5 +obj pol_ceil x*1.5 z+1.5 y+0.5 +obj flare_w x+0.5 z-0.01 y-0.1 +obj flare_w x*-1 x-0.5 z-0.01 y-0.1 +obj flare_r x+0.5 z+5.01 y-0.1 +obj flare_r x*-1 x-0.5 z+5.01 y-0.1 + +here +p -1.25 0.5 0.5 +p 1.25 0.5 0.5 +p 1.5 0.25 0.5 +p 1.5 -0.25 0.5 +p 1.25 -0.5 0.5 +p -1.25 -0.5 0.5 +p -1.5 -0.25 0.5 +p -1.5 0.25 0.5 + +p -1.25 0.5 4.5 +p 1.25 0.5 4.5 +p 1.5 0.25 4.5 +p 1.5 -0.25 4.5 +p 1.25 -0.5 4.5 +p -1.25 -0.5 4.5 +p -1.5 -0.25 4.5 +p -1.5 0.25 4.5 + +mtl metal_blue +f 0 1 9 8 +f 1 2 10 9 +f 2 3 11 10 +f 3 4 12 11 +f 4 5 13 12 +f 5 6 14 13 +f 6 7 15 14 +f 7 0 8 15 + diff --git a/3D GFX/3D Synthezier/include/pol_ceil.3d b/3D GFX/3D Synthezier/include/pol_ceil.3d new file mode 100644 index 0000000..68cb41a --- /dev/null +++ b/3D GFX/3D Synthezier/include/pol_ceil.3d @@ -0,0 +1,21 @@ +here +p -0.5 0.5 0.75 +p 0.5 0.5 0.75 +p 0.5 0 0 +p -0.5 0 0 +p -0.75 0 0.75 +p 0.75 0 0.75 + +p -0.5 0.5 2.25 +p 0.5 0.5 2.25 +p 0.5 0 2.25 +p -0.5 0 2.25 +mtl klaashele +f 0 1 2 3 +f 0 3 4 +f 1 2 5 + +f 0 1 7 6 +f 1 5 8 7 +f 0 4 9 6 +f 6 7 8 9 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/pol_frnt.3d b/3D GFX/3D Synthezier/include/pol_frnt.3d new file mode 100644 index 0000000..826e568 --- /dev/null +++ b/3D GFX/3D Synthezier/include/pol_frnt.3d @@ -0,0 +1,24 @@ +here +p -1.25 0.25 0 +p 1.25 0.25 0 +p 1.25 -0.25 0 +p -1.25 -0.25 0 + +p -1.25 0.5 0.5 +p 1.25 0.5 0.5 +p 1.5 0.25 0.5 +p 1.5 -0.25 0.5 +p 1.25 -0.5 0.5 +p -1.25 -0.5 0.5 +p -1.5 -0.25 0.5 +p -1.5 0.25 0.5 +mtl metal_blue +f 0 1 2 3 +f 0 4 5 1 +f 1 5 6 +f 1 6 7 2 +f 2 7 8 +f 2 8 9 3 +f 3 9 10 +f 3 10 11 0 +f 0 11 4 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/ring.3d b/3D GFX/3D Synthezier/include/ring.3d new file mode 100644 index 0000000..7d19916 --- /dev/null +++ b/3D GFX/3D Synthezier/include/ring.3d @@ -0,0 +1,52 @@ +here +p 0 0 0 +p -1.0 0.0 0.0 +p -0.965926 0.0 -0.258819 +p -0.965926 0.0 0.258819 +p -0.866025 0.0 -0.500000 +p -0.866025 0.0 0.500000 +p -0.707107 0.0 -0.707107 +p -0.707107 0.0 0.707107 +p -0.500000 0.0 -0.866025 +p -0.500000 0.0 0.866025 +p -0.258819 0.0 -0.965926 +p -0.258819 0.0 0.965926 +p 0.0 0.0 -1.0 +p 0.0 0.0 0.0 +p 0.0 0.0 1.0 +p 0.258819 0.0 0.965926 +p 0.258819 0.0 -0.965926 +p 0.500000 0.0 0.866025 +p 0.500000 0.0 -0.866025 +p 0.707107 0.0 -0.707107 +p 0.707107 0.0 0.707107 +p 0.866025 0.0 -0.500000 +p 0.866026 0.0 0.500000 +p 0.965926 0.0 -0.258819 +p 0.965926 0.0 0.258819 +p 1.0 0.0 0.0 + +f 13 25 23 +f 13 23 21 +f 13 21 19 +f 13 19 18 +f 13 18 16 +f 13 16 12 +f 13 12 10 +f 13 10 8 +f 13 8 6 +f 13 6 4 +f 13 4 2 +f 13 2 1 +f 13 1 3 +f 13 3 5 +f 13 5 7 +f 13 7 9 +f 13 9 11 +f 13 11 14 +f 13 14 15 +f 13 15 17 +f 13 17 20 +f 13 20 22 +f 13 22 24 +f 13 24 25 diff --git a/3D GFX/3D Synthezier/include/seinl1.3d b/3D GFX/3D Synthezier/include/seinl1.3d new file mode 100644 index 0000000..b6bf757 --- /dev/null +++ b/3D GFX/3D Synthezier/include/seinl1.3d @@ -0,0 +1,9 @@ +obj blk1 +obj blk2 x+6 +obj blk2 x+12 +obj blk1 x+18 + +rnd obj^pol^xz-92^z-6^x+1 dum dum dum dum +rnd obj^car^xz91^z-10^x+5 dum dum dum dum +rnd obj^car^xz87^z-8^x+19 dum dum dum dum +rnd obj^bus^xz-90^z-12^x+10 dum dum dum dum dum dum dum dum \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/seinp1.3d b/3D GFX/3D Synthezier/include/seinp1.3d new file mode 100644 index 0000000..b8499db --- /dev/null +++ b/3D GFX/3D Synthezier/include/seinp1.3d @@ -0,0 +1,19 @@ +obj blk1 +obj blk1 x+6 +obj blk1 x+12 +obj blk2 x+18 + +obj blk2 x+24 +obj blk1 x+30 +obj blk1 x+36 +obj blk1 x+42 + +obj blk1 x+48 +obj blk1 x+54 +obj blk1 x+60 +obj blk2 x+66 + +obj blk2 x+72 +obj blk1 x+78 +obj blk1 x+84 +obj blk1 x+90 diff --git a/3D GFX/3D Synthezier/include/solar.3d b/3D GFX/3D Synthezier/include/solar.3d new file mode 100644 index 0000000..a898eec --- /dev/null +++ b/3D GFX/3D Synthezier/include/solar.3d @@ -0,0 +1,23 @@ +here +p -3 0 -3 +p 3 0 -3 +p 3 0 3 +p -3 0 3 + +p -3 15 -3 +p 3 15 -3 +p 3 15 3 +p -3 15 3 + +p -20 6 -9 +p 20 6 -9 +p 10 24 9 +p -10 24 9 + +mtl pronks +f 0 1 5 4 +f 1 2 6 5 +f 2 3 7 6 +f 3 0 4 7 +mtl solar +f 8 9 10 11 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/toru.3d b/3D GFX/3D Synthezier/include/toru.3d new file mode 100644 index 0000000..0f91bfb --- /dev/null +++ b/3D GFX/3D Synthezier/include/toru.3d @@ -0,0 +1,38 @@ +here +p 0 0 10 +p 0 5 10 + +p 7.071067 0 7.071069 +p 7.071067 5 7.071069 + +p 10 0 3.139165E-06 +p 10 5 3.139165E-06 + +p 7.071071 0 -7.071064 +p 7.071071 5 -7.071064 + +p 6.27833E-06 0 -10 +p 6.27833E-06 5 -10 + +p -7.071062 0 -7.071074 +p -7.071062 5 -7.071074 + +p -10 0 -9.417495E-06 +p -10 5 -9.417495E-06 + +p -7.071075 0 7.07106 +p -7.071075 5 7.07106 +mtl pronks +f 0 1 3 2 +f 2 3 5 4 +f 4 5 7 6 +f 6 7 9 8 + +f 8 9 11 10 +f 10 11 13 12 +f 12 13 15 14 +f 14 15 1 0 + +f 1 3 5 7 +f 1 7 9 15 +f 9 11 13 15 \ No newline at end of file diff --git a/3D GFX/3D Synthezier/include/vedru.3d b/3D GFX/3D Synthezier/include/vedru.3d new file mode 100644 index 0000000..6d238b8 --- /dev/null +++ b/3D GFX/3D Synthezier/include/vedru.3d @@ -0,0 +1,51 @@ +obj plaat xz20 x+0 y+0 z+1 +obj plaat xz18.42122 x+.3894183 y+.1333333 z+.921061 +obj plaat xz13.93413 x+.7173561 y+.2666667 z+.6967067 +obj plaat xz7.247154 x+.9320391 y+.4 z+.3623577 +obj plaat xz-.5839909 x+.9995736 y+.5333334 z-2.919955E-02 +obj plaat xz-8.322937 x+.9092974 y+.6666667 z-.4161468 +obj plaat xz-14.74788 x+.6754631 y+.8 z-.7373938 +obj plaat xz-18.84445 x+.334988 y+.9333334 z-.9422224 +obj plaat xz-19.96589 x-5.837443E-02 y+1.066667 z-.9982948 +obj plaat xz-17.93517 x-.4425208 y+1.2 z-.8967583 +obj plaat xz-13.07286 x-.7568028 y+1.333333 z-.6536433 +obj plaat xz-6.146646 x-.9516022 y+1.466667 z-.3073323 +obj plaat xz1.749993 x-.9961646 y+1.6 z+8.749965E-02 +obj plaat xz9.370347 x-.8834543 y+1.733334 z+.4685173 +obj plaat xz15.51133 x-.631266 y+1.866667 z+.7755664 +obj plaat xz19.20341 x-.2794146 y+2 z+.9601706 +obj plaat xz19.8637 x+.1165502 y+2.133334 z+.9931848 +obj plaat xz17.38794 x+.4941143 y+2.266667 z+.8693969 +obj plaat xz12.16701 x+.7936686 y+2.4 z+.6083503 +obj plaat xz5.025171 x+.96792 y+2.533334 z+.2512586 +obj plaat xz-2.910019 x+.9893581 y+2.666667 z-.145501 +obj plaat xz-10.38578 x+.8545986 y+2.8 z-.5192891 +obj plaat xz-16.22186 x+.584917 y+2.933333 z-.8110932 +obj plaat xz-19.49687 x+.2228901 y+3.066667 z-.9748436 +obj plaat xz-19.69376 x-.1743262 y+3.2 z-.984688 +obj plaat xz-16.78144 x-.5440203 y+3.333333 z-.839072 +obj plaat xz-11.21971 x-.8278257 y+3.466666 z-.5609854 +obj plaat xz-3.886632 x-.9809359 y+3.599999 z-.1943316 +obj plaat xz4.060056 x-.9791781 y+3.733333 z+.2030028 +obj plaat xz11.36575 x-.82283 y+3.866666 z+.5682876 +obj plaat xz16.87705 x-.5365753 y+3.999999 z+.8438524 +obj plaat xz19.72383 x-.1656074 y+4.133332 z+.9861917 +obj plaat xz19.45667 x+.2315063 y+4.266665 z+.9728334 +obj plaat xz16.11773 x+.5920703 y+4.399999 z+.8058863 +obj plaat xz10.23416 x+.8591596 y+4.533332 z+.5117078 +obj plaat xz2.734839 x+.9906067 y+4.666665 z+.1367419 +obj plaat xz-5.196248 x+.9656591 y+4.799998 z-.2598124 +obj plaat xz-12.30696 x+.7882555 y+4.933331 z-.6153481 +obj plaat xz-17.47468 x+.4864039 y+5.066665 z-.8737341 +obj plaat xz-19.88354 x+.1077599 y+5.199998 z-.9941769 +obj plaat xz-19.15323 x-.2878969 y+5.333331 z-.9576614 +obj plaat xz-15.39904 x-.638102 y+5.466665 z-.7699519 +obj plaat xz-9.213687 x-.8875641 y+5.599998 z-.4606843 +obj plaat xz-1.573701 x-.9968995 y+5.733331 z-7.868504E-02 +obj plaat xz6.314738 x-.9488468 y+5.866664 z+.3157369 +obj plaat xz13.20622 x-.7509923 y+5.999998 z+.660311 +obj plaat xz18.01273 x-.4345728 y+6.133331 z+.9006367 +obj plaat xz19.97544 x-4.954402E-02 y+6.266664 z+.998772 +obj plaat xz18.78447 x+.3433067 y+6.399997 z+.9392233 +obj plaat xz14.62785 x+.6819569 y+6.53333 z+.7313923 +obj plaat xz8.161816 x+.9129413 y+6.666664 z+.4080908 diff --git a/3D GFX/3D land.bas b/3D GFX/3D land.bas new file mode 100755 index 0000000..5a7c5e2 --- /dev/null +++ b/3D GFX/3D land.bas @@ -0,0 +1,115 @@ +DECLARE SUB DrawQuadrilateral (xCoord1%, yCoord1%, xCoord2%, yCoord2%, xCoord3%, yCoord3%, xCoord4%, yCoord4%, colorVal%) +' Program to render 3D shaded landscape with perspective and distortion effects. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 1999, Initial version +' 2024 - 2025, Improved program readability + +DECLARE SUB SetPalette () +DEFINT A-Z +' Declare shared arrays for X and Y coordinates +DIM SHARED xCoordinates(1 TO 40, 1 TO 40) +DIM SHARED yCoordinates(1 TO 40, 1 TO 40) + +' Set screen mode to 12: 640x480 pixels, 16 colors +SCREEN 12 + +' Initialize color palette +SetPalette + +' Set initial scaling factor +scalingFactor = 1.5 + +' Main loop start +1 : +' Loop through each point in the grid +FOR rowIndex = 1 TO 40 + FOR colIndex = 1 TO 40 + ' Calculate the position with distortion + xPos = 120 + (colIndex * 10) + yPos = 200 + (rowIndex * 3) + + ' Apply a cosine distortion based on distance from center + yPos = yPos - COS(SQR((colIndex - 20) ^ 2 + (rowIndex - 20) ^ 2) / scalingFactor) * 20 + + ' Apply perspective transformation + xPos = (xPos - 320) * (rowIndex + 50) / 50 + 320 + yPos = (yPos - 240) * (rowIndex + 50) / 50 + 240 + + ' Store the transformed coordinates + xCoordinates(colIndex, rowIndex) = xPos + yCoordinates(colIndex, rowIndex) = yPos + NEXT colIndex +NEXT rowIndex + +' Draw grid based on the stored coordinates +FOR rowIndex = 1 TO 39 + FOR colIndex = 1 TO 39 + ' Alternate colors for each box + IF (colIndex + rowIndex) \ 2 <> (colIndex + rowIndex + 1) \ 2 THEN colorIndex = 0 ELSE colorIndex = 5 + + ' Calculate a brightness factor + brightnessFactor = rowIndex + (colIndex / 3) + + ' Draw the quadrilateral with the calculated color and brightness + DrawQuadrilateral xCoordinates(colIndex, rowIndex), yCoordinates(colIndex, rowIndex), xCoordinates(colIndex + 1, rowIndex), yCoordinates(colIndex + 1, rowIndex), xCoordinates(colIndex, rowIndex + 1), yCoordinates(colIndex, rowIndex + 1), _ +xCoordinates(colIndex + 1, rowIndex + 1), yCoordinates(colIndex + 1, rowIndex + 1), colorIndex + NEXT colIndex +NEXT rowIndex + +' Wait for user input and adjust the scaling factor +userInput$ = INPUT$(1) +scalingFactor = scalingFactor * 1.9 + +' Clear the screen for the next iteration +CLS + +' If the scaling factor is too large, exit the program +IF scalingFactor > 10 THEN SYSTEM + +' Jump back to the main loop start +GOTO 1 + +' Subroutine to draw a filled box using line drawing +SUB DrawQuadrilateral (xCoord1, yCoord1, xCoord2, yCoord2, xCoord3, yCoord3, xCoord4, yCoord4, colorVal) + ' Fills a quadrilateral area by connecting the edges. + ' It uses a scanline approach, storing intersection points, then drawing horizontal lines between those intersection points. + ' Adjust color index based on position and brightness factor + colorVal = colorVal + (yCoord2 - yCoord1) / 3.5 + (brightnessFactor / 8) + 4 + ' Ensure the color index is within valid range + IF colorVal < 0 THEN colorVal = 0 + IF colorVal > 15 THEN colorVal = 15 + ' Calculate the length of the longer side + sideLength1 = SQR((xCoord1 - xCoord2) ^ 2 + (yCoord1 - yCoord2) ^ 2) + sideLength2 = SQR((xCoord3 - xCoord4) ^ 2 + (yCoord3 - yCoord4) ^ 2) + IF sideLength2 < sideLength1 THEN sideLength2 = sideLength1 + ' Draw the box using lines + FOR lineIndex = 1 TO sideLength2 + xCoord5 = (xCoord2 - xCoord1) * lineIndex / sideLength2 + xCoord1 + yCoord5 = (yCoord2 - yCoord1) * lineIndex / sideLength2 + yCoord1 + xCoord6 = (xCoord4 - xCoord3) * lineIndex / sideLength2 + xCoord3 + yCoord6 = (yCoord4 - yCoord3) * lineIndex / sideLength2 + yCoord3 + ' Draw two adjacent lines to create a filled effect + LINE (xCoord5, yCoord5)-(xCoord6, yCoord6), colorVal + LINE (xCoord5 + 1, yCoord5)-(xCoord6 + 1, yCoord6), colorVal + NEXT lineIndex +END SUB + +' Subroutine to initialize color palette +SUB SetPalette + ' Initializes the color palette for the screen. + ' It sets the RGB values for each color index in the palette. + FOR paletteIndex = 1 TO 16 + ' Set the color values for each palette entry + OUT &H3C8, paletteIndex + OUT &H3C9, paletteIndex * 4 + OUT &H3C9, paletteIndex * 4 + OUT &H3C9, paletteIndex * 3 + NEXT paletteIndex +END SUB + diff --git a/3D GFX/3D land.webm b/3D GFX/3D land.webm new file mode 100644 index 0000000..1e60d2d Binary files /dev/null and b/3D GFX/3D land.webm differ diff --git a/3D GFX/Anaglyph.bas b/3D GFX/Anaglyph.bas new file mode 100755 index 0000000..10d6a4b --- /dev/null +++ b/3D GFX/Anaglyph.bas @@ -0,0 +1,465 @@ +' Projects realtime anaglyph with bouncing cubes. Colored glasses required to view stereo effect. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2004.07, Initial version +' 2024 - 2025, Improved program readability + +' Controls: +' arrow keys - move around +' 2, 6, 4, 8 - look around +' - - fly up +' + - fly down +' q, w - change horizontal distance between left and right view + +DECLARE SUB DrawLine (x1%, y1%, x2%, y2%) +DECLARE SUB CreateCube () +DECLARE SUB PlaceCubes () +DECLARE SUB RenderScene () +DECLARE SUB InitializeEnvironment () +DECLARE SUB InitializeProgram () + +DIM SHARED originalPointCount, originalLineCount, currentPointCount, currentLineCount +DIM SHARED pointX(1 TO 1000) +DIM SHARED pointY(1 TO 1000) +DIM SHARED pointZ(1 TO 1000) + +DIM SHARED projectedX(1 TO 1000) +DIM SHARED projectedXRight(1 TO 1000) +DIM SHARED projectedY(1 TO 1000) + +DIM SHARED originalProjectedX(1 TO 1000) +DIM SHARED originalProjectedXRight(1 TO 1000) +DIM SHARED originalProjectedY(1 TO 1000) +DIM SHARED originalProjectedPointCount +DIM SHARED lineStart(1 TO 1000) +DIM SHARED lineEnd(1 TO 1000) +DIM SHARED lineColor(1 TO 1000) +DIM SHARED originalLineStart(1 TO 1000) +DIM SHARED originalLineEnd(1 TO 1000) +DIM SHARED originalProjectedLineCount + +DIM SHARED cameraX, cameraY, cameraZ +DIM SHARED cameraXSpeed, cameraYSpeed, cameraZSpeed +DIM SHARED rotationAngle1, rotationAngle2 +DIM SHARED rotationAngle1Speed, rotationAngle2Speed +DIM SHARED cubeX(1 TO 10) +DIM SHARED cubeY(1 TO 10) +DIM SHARED cubeZ(1 TO 10) +DIM SHARED cubeXSpeed(1 TO 10) +DIM SHARED cubeYSpeed(1 TO 10) +DIM SHARED cubeZSpeed(1 TO 10) +DIM SHARED cubeCount +DIM SHARED horizontalViewDistance + +DIM SHARED movementSpeed + +movementSpeed = 4 +'ON ERROR GOTO 2 + +InitializeProgram +InitializeEnvironment +PlaceCubes +horizontalViewDistance = -.1 +1 +PCOPY 0, 1 +CLS + +currentPointCount = originalPointCount +currentLineCount = originalLineCount + +CreateCube +RenderScene + +cameraX = cameraX + cameraXSpeed +cameraY = cameraY + cameraYSpeed +cameraZ = cameraZ + cameraZSpeed +rotationAngle1 = rotationAngle1 + rotationAngle1Speed +rotationAngle2 = rotationAngle2 + rotationAngle2Speed + +inputKey$ = INKEY$ +IF inputKey$ <> "" THEN + IF inputKey$ = CHR$(0) + "H" THEN + ' Move forward + cameraZSpeed = cameraZSpeed - SIN(rotationAngle1) / 100 + cameraXSpeed = cameraXSpeed - COS(rotationAngle1) / 100 + END IF + IF inputKey$ = CHR$(0) + "P" THEN + ' Move backward + cameraZSpeed = cameraZSpeed + SIN(rotationAngle1) / 100 + cameraXSpeed = cameraXSpeed + COS(rotationAngle1) / 100 + END IF + IF inputKey$ = CHR$(0) + "M" THEN + ' Strafe left + cameraZSpeed = cameraZSpeed + COS(rotationAngle1) / 100 + cameraXSpeed = cameraXSpeed - SIN(rotationAngle1) / 100 + END IF + IF inputKey$ = CHR$(0) + "K" THEN + ' Strafe right + cameraZSpeed = cameraZSpeed - COS(rotationAngle1) / 100 + cameraXSpeed = cameraXSpeed + SIN(rotationAngle1) / 100 + END IF + + IF inputKey$ = "6" THEN rotationAngle1Speed = rotationAngle1Speed - .01 + IF inputKey$ = "4" THEN rotationAngle1Speed = rotationAngle1Speed + .01 + IF inputKey$ = "8" THEN rotationAngle2Speed = rotationAngle2Speed - .01 + IF inputKey$ = "2" THEN rotationAngle2Speed = rotationAngle2Speed + .01 + IF inputKey$ = "+" THEN cameraYSpeed = cameraYSpeed - .01 + IF inputKey$ = "-" THEN cameraYSpeed = cameraYSpeed + .01 + IF inputKey$ = "q" THEN horizontalViewDistance = horizontalViewDistance - .01 + IF inputKey$ = "w" THEN horizontalViewDistance = horizontalViewDistance + .01 + IF inputKey$ = " " THEN + ' Slow down movements + cameraXSpeed = cameraXSpeed / 2 + cameraYSpeed = cameraYSpeed / 2 + cameraZSpeed = cameraZSpeed / 2 + + rotationAngle1Speed = rotationAngle1Speed / 2 + rotationAngle2Speed = rotationAngle2Speed / 2 + END IF + IF inputKey$ = CHR$(27) THEN SYSTEM +END IF +GOTO 1 +2 +END +RESUME + +SUB InitializeEnvironment + +' This subroutine initializes the environment by creating points and lines. +FOR worldZ = -5 TO 5 + FOR worldX = -5 TO 5 + currentPointCount = currentPointCount + 1 + pointX(currentPointCount) = worldX + pointY(currentPointCount) = SIN(SQR(worldX * worldX + worldZ * worldZ) / 2) + pointZ(currentPointCount) = worldZ + IF worldX > -5 THEN + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + lineEnd(currentLineCount) = currentPointCount - 1 + lineColor(currentLineCount) = 3 + END IF + IF worldZ > -5 THEN + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + lineEnd(currentLineCount) = currentPointCount - 11 + lineColor(currentLineCount) = 3 + END IF + NEXT worldX +NEXT worldZ + +originalPointCount = currentPointCount +originalLineCount = currentLineCount + +END SUB + +SUB InitializeEnvironment1 + +' This subroutine initializes the environment with a simple setup. +currentPointCount = 1 +pointX(currentPointCount) = -2 +pointY(currentPointCount) = 0 +pointZ(currentPointCount) = 0 + +currentPointCount = currentPointCount + 1 +pointX(currentPointCount) = 2 +pointY(currentPointCount) = 0 +pointZ(currentPointCount) = 0 + +currentLineCount = 1 +lineStart(currentLineCount) = 1 +lineEnd(currentLineCount) = 2 +lineColor(currentLineCount) = 14 + +END SUB + +SUB DrawLine (x1%, y1%, x2%, y2%) + +' This subroutine draws a line between two points using a custom algorithm. +' It calculates intermediate points and sets pixels with appropriate colors. +' The color is inverted if the point is already set to avoid overwriting. + +lineLength = ABS(x1% - x2%) +lineLength2 = ABS(y1% - y2%) +IF lineLength2 > lineLength THEN lineLength = lineLength2 +IF lineLength < 2 THEN GOTO 101 + +xDelta = x2% - x1% +yDelta = y2% - y1% + +FOR stp% = 1 TO lineLength + x = xDelta * stp% / lineLength + x1% + y = yDelta * stp% / lineLength + y1% + currentColor = POINT(x, y) + IF currentColor = 0 THEN PSET (x, y), 2 + IF currentColor = 1 THEN PSET (x, y), 3 +NEXT stp% +101 +END SUB + +SUB DrawLineRight (x1, y1, x2, y2) +' This subroutine draws a line using the LINE statement for the right eye view. +LINE (x1, y1)-(x2, y2), 1 +END SUB + +SUB CreateCube + +' This subroutine updates the positions of the cubes and adds their edges to the environment. +FOR cubeIndex = 1 TO cubeCount + worldX = cubeX(cubeIndex) + worldY = cubeY(cubeIndex) + worldZ = cubeZ(cubeIndex) + + velocityX = cubeXSpeed(cubeIndex) + velocityY = cubeYSpeed(cubeIndex) + velocityZ = cubeZSpeed(cubeIndex) + + ' Apply gravity to the cube's vertical movement + velocityY = velocityY - .01 + + ' Calculate new positions based on velocity and speed + worldX = worldX + velocityX / movementSpeed + worldY = worldY + velocityY / movementSpeed + worldZ = worldZ + velocityZ / movementSpeed + + ' Bounce from boundaries + IF worldX > 5 THEN velocityX = -.1 + IF worldZ > 5 THEN velocityZ = -.1 + IF worldX < -5 THEN velocityX = .1 + IF worldZ < -5 THEN velocityZ = .1 + IF worldY < .5 THEN velocityY = RND * .2 + .1 + + ' Add cube edges to the environment + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 1 + lineEnd(currentLineCount) = currentPointCount + 2 + lineColor(currentLineCount) = 14 + + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 3 + lineEnd(currentLineCount) = currentPointCount + 2 + lineColor(currentLineCount) = 14 + + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 3 + lineEnd(currentLineCount) = currentPointCount + 4 + lineColor(currentLineCount) = 14 + + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 1 + lineEnd(currentLineCount) = currentPointCount + 4 + lineColor(currentLineCount) = 14 + + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 1 + lineEnd(currentLineCount) = currentPointCount + 5 + lineColor(currentLineCount) = 14 + + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 2 + lineEnd(currentLineCount) = currentPointCount + 6 + lineColor(currentLineCount) = 14 + + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 3 + lineEnd(currentLineCount) = currentPointCount + 7 + lineColor(currentLineCount) = 14 + + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 4 + lineEnd(currentLineCount) = currentPointCount + 8 + lineColor(currentLineCount) = 14 + + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 5 + lineEnd(currentLineCount) = currentPointCount + 6 + lineColor(currentLineCount) = 14 + + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 7 + lineEnd(currentLineCount) = currentPointCount + 6 + lineColor(currentLineCount) = 14 + + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 7 + lineEnd(currentLineCount) = currentPointCount + 8 + lineColor(currentLineCount) = 14 + + currentLineCount = currentLineCount + 1 + lineStart(currentLineCount) = currentPointCount + 5 + lineEnd(currentLineCount) = currentPointCount + 8 + lineColor(currentLineCount) = 14 + + ' Add cube vertices to the environment + currentPointCount = currentPointCount + 1 + pointX(currentPointCount) = worldX - .5 + pointY(currentPointCount) = worldY - .5 + pointZ(currentPointCount) = worldZ - .5 + + currentPointCount = currentPointCount + 1 + pointX(currentPointCount) = worldX + .5 + pointY(currentPointCount) = worldY - .5 + pointZ(currentPointCount) = worldZ - .5 + + currentPointCount = currentPointCount + 1 + pointX(currentPointCount) = worldX + .5 + pointY(currentPointCount) = worldY + .5 + pointZ(currentPointCount) = worldZ - .5 + + currentPointCount = currentPointCount + 1 + pointX(currentPointCount) = worldX - .5 + pointY(currentPointCount) = worldY + .5 + pointZ(currentPointCount) = worldZ - .5 + + currentPointCount = currentPointCount + 1 + pointX(currentPointCount) = worldX - .5 + pointY(currentPointCount) = worldY - .5 + pointZ(currentPointCount) = worldZ + .5 + + currentPointCount = currentPointCount + 1 + pointX(currentPointCount) = worldX + .5 + pointY(currentPointCount) = worldY - .5 + pointZ(currentPointCount) = worldZ + .5 + + currentPointCount = currentPointCount + 1 + pointX(currentPointCount) = worldX + .5 + pointY(currentPointCount) = worldY + .5 + pointZ(currentPointCount) = worldZ + .5 + + currentPointCount = currentPointCount + 1 + pointX(currentPointCount) = worldX - .5 + pointY(currentPointCount) = worldY + .5 + pointZ(currentPointCount) = worldZ + .5 + + ' Update cube positions and velocities + cubeX(cubeIndex) = worldX + cubeY(cubeIndex) = worldY + cubeZ(cubeIndex) = worldZ + cubeXSpeed(cubeIndex) = velocityX + cubeYSpeed(cubeIndex) = velocityY + cubeZSpeed(cubeIndex) = velocityZ +NEXT cubeIndex + +END SUB + +SUB PlaceCubes + +' This subroutine initializes the positions and velocities of the cubes. +scaleFactor = 1 +FOR cubeIndex = 1 TO cubeCount + cubeX(cubeIndex) = RND * 10 - 5 + cubeY(cubeIndex) = 2 + cubeZ(cubeIndex) = RND * 10 - 5 + cubeXSpeed(cubeIndex) = (RND * .5 - .25) / scaleFactor + cubeYSpeed(cubeIndex) = (RND * .5 + .1) / scaleFactor + cubeZSpeed(cubeIndex) = (RND * .5 - .25) / scaleFactor +NEXT cubeIndex + +END SUB + +SUB RenderScene +' This subroutine renders the environment by projecting 3D points onto a 2D plane. +' It applies rotation and perspective projection to create the anaglyph effect. + +sinAngle1 = SIN(rotationAngle1) +cosAngle1 = COS(rotationAngle1) +sinAngle2 = SIN(rotationAngle2) +cosAngle2 = COS(rotationAngle2) + +' Project each 3D point to 2D screen coordinates +FOR pointIndex = 1 TO currentPointCount + worldX = pointX(pointIndex) + cameraX + worldY = pointY(pointIndex) - cameraY + worldZ = pointZ(pointIndex) + cameraZ + + ' First rotation around Y-axis (horizontal rotation) + rotatedX = worldX * sinAngle1 - worldZ * cosAngle1 + rotatedZ = worldX * cosAngle1 + worldZ * sinAngle1 + + ' Second rotation around X-axis (vertical rotation) + rotatedY = worldY * sinAngle2 - rotatedZ * cosAngle2 + depth = worldY * cosAngle2 + rotatedZ * sinAngle2 + + ' Apply perspective projection if point is in view + IF depth < .1 THEN + projectedX(pointIndex) = -1 + ELSE + projectedX(pointIndex) = 160 + ((rotatedX + horizontalViewDistance) / depth * 200) + projectedXRight(pointIndex) = 160 + ((rotatedX - horizontalViewDistance) / depth * 200) + projectedY(pointIndex) = 100 - (rotatedY / depth * 200) + END IF +NEXT pointIndex + +' Draw lines between projected points for left eye view +FOR lineIndex = 1 TO currentLineCount + startPoint = lineStart(lineIndex) + endPoint = lineEnd(lineIndex) + IF projectedX(startPoint) = -1 OR projectedX(endPoint) = -1 THEN + ' Skip drawing if either point is out of view + ELSE + LINE (projectedX(startPoint), projectedY(startPoint))-(projectedX(endPoint), projectedY(endPoint)), 1 + END IF +NEXT lineIndex + +' Draw lines between projected points for right eye view +FOR lineIndex = 1 TO currentLineCount + startPoint = lineStart(lineIndex) + endPoint = lineEnd(lineIndex) + IF projectedX(startPoint) = -1 OR projectedX(endPoint) = -1 THEN + ' Skip drawing if either point is out of view + ELSE + DrawLine INT(projectedXRight(startPoint)), INT(projectedY(startPoint)), INT(projectedXRight(endPoint)), INT(projectedY(endPoint)) + END IF +NEXT lineIndex + +END SUB + +SUB InitializeProgram +SCREEN 7, , , 1 + +OUT &H3C8, 0 +OUT &H3C9, 63 +OUT &H3C9, 63 +OUT &H3C9, 63 + +OUT &H3C8, 1 +OUT &H3C9, 63 +OUT &H3C9, 0 +OUT &H3C9, 0 + +OUT &H3C8, 2 +OUT &H3C9, 0 +OUT &H3C9, 63 +OUT &H3C9, 63 + +OUT &H3C8, 3 +OUT &H3C9, 0 +OUT &H3C9, 0 +OUT &H3C9, 0 + +originalPointCount = 0 +originalLineCount = 0 +currentPointCount = originalPointCount +currentLineCount = originalLineCount +cubeCount = 9 + +cameraX = 0 +cameraY = 4 +cameraZ = 7 +rotationAngle1 = 3.14 / 2 +rotationAngle2 = rotationAngle1 + .6 + +FOR pointIndex = 1 TO 1000 + lineColor(pointIndex) = 4 +NEXT pointIndex + +FOR lineIndex = 1 TO 1000 + originalLineStart(lineIndex) = 1 + originalLineEnd(lineIndex) = 1 +NEXT lineIndex + +END SUB diff --git a/3D GFX/Anaglyph.html b/3D GFX/Anaglyph.html new file mode 100644 index 0000000..43346da --- /dev/null +++ b/3D GFX/Anaglyph.html @@ -0,0 +1,18 @@ + +stereo vision + + + +

stereo vision

+
+
+3D engine producing realtime stereo view. (ANAGLYPH) +Conical grid with cubes flying around. +You can freely fly around and adjust +stereo view properties. Requires stereo glasses. + +
+ +
+ + \ No newline at end of file diff --git a/3D GFX/Anaglyph.png b/3D GFX/Anaglyph.png new file mode 100644 index 0000000..8f81825 Binary files /dev/null and b/3D GFX/Anaglyph.png differ diff --git a/3D GFX/Helicopter/Helicopter.bas b/3D GFX/Helicopter/Helicopter.bas new file mode 100644 index 0000000..d227cbc --- /dev/null +++ b/3D GFX/Helicopter/Helicopter.bas @@ -0,0 +1,1144 @@ +DECLARE SUB DisplayScene1 () +DECLARE SUB DisplayScene9 () +DECLARE SUB DisplayScene2 () +DECLARE SUB DisplayScene8 () +DECLARE SUB DisplayScene3 () +DECLARE SUB DisplayScene4 () +DECLARE SUB DisplayScene5 () +DECLARE SUB DisplayScene7 () +DECLARE SUB InitializeProgram () +DECLARE SUB DisplayScenePart1 () +DECLARE SUB DisplayScenePart2 () +DECLARE SUB DisplayScenePart3 () +DECLARE SUB DisplayScenePart4 () +DECLARE SUB DisplayScenePart5 () +DECLARE SUB DisplayScenePart6 () +DECLARE SUB DisplayScenePart7 () +DECLARE SUB DisplayScenePart8 () +DECLARE SUB DisplayScenePart10 () +DECLARE SUB DisplayScenePart9 () +DECLARE SUB DrawRoundedBox (topLeftX!, topLeftY!, bottomRightX!, bottomRightY!) +DECLARE SUB ComputeShadeValue (firstPointX!, firstPointY!, firstPointZ!, secondPointX!, secondPointY!, secondPointZ!, thirdPointX!, thirdPointY!, thirdPointZ!, shadeValue!) +DECLARE SUB GetAngle (firstPointX!, firstPointY!, secondPointX!, secondPointY!, angleBetween!) +DECLARE SUB RotatePoint (centerX!, centerY!, pointX!, pointY!, rotationAngle!) +DECLARE SUB FillPolygon (vertex1X!, vertex1Y!, vertex2X!, vertex2Y!, vertex3X!, vertex3Y!, fillColor!) +DECLARE SUB InitializeFont () +DECLARE SUB WaitForInput () +DECLARE SUB MakeBackground () +DECLARE SUB SetPalette (red!, green!, blue!, colorIndex!) +DECLARE SUB PrintText (posX!, posY!, scale!, colorValue!, textString$) + +' Presentation demonstrating realtime 3D graphics. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2002, Initial version +' 2025, Improved program readability + +DIM SHARED globalPiValue +DIM SHARED globalPi +DIM SHARED globalAngleOne +DIM SHARED globalAngleTwo + +' Holds the captured font bitmap +DIM SHARED fontData(0 TO 7, 0 TO 7, 32 TO 150) + +InitializeProgram +DisplayScene1 +DisplayScene2 +DisplayScene3 +DisplayScene4 +DisplayScene7 +DisplayScene8 + + +SUB ComputeShadeValue (firstPointX, firstPointY, firstPointZ, secondPointX, secondPointY, secondPointZ, thirdPointX, thirdPointY, thirdPointZ, shadeValue) + ' + ' Computes a brightness value for a 3D triangle based on distance from viewer. + ' The algorithm: + ' 1. Makes local copies of the three points + ' 2. Applies three sequential rotations to simulate 3D perspective + ' 3. Calculates distance from viewer to determine shading + ' + + ' Create local copies of the points + localFirstPointX = firstPointX + localFirstPointY = firstPointY + localFirstPointZ = firstPointZ + localSecondPointX = secondPointX + localSecondPointY = secondPointY + localSecondPointZ = secondPointZ + localThirdPointX = thirdPointX + localThirdPointY = thirdPointY + localThirdPointZ = thirdPointZ + + ' First rotation around Y-axis + GetAngle localFirstPointX, localFirstPointY, localSecondPointX, localSecondPointY, tempAngle1 + RotatePoint localFirstPointX, localFirstPointY, localSecondPointX, localSecondPointY, -tempAngle1 + RotatePoint localFirstPointX, localFirstPointY, localThirdPointX, localThirdPointY, -tempAngle1 + + ' Second rotation around X-axis + GetAngle localFirstPointY, localFirstPointZ, localSecondPointY, localSecondPointZ, tempAngle2 + tempAngle2 = tempAngle2 + globalPi / 2 + RotatePoint localFirstPointY, localFirstPointZ, localSecondPointY, localSecondPointZ, -tempAngle2 + RotatePoint localFirstPointY, localFirstPointZ, localThirdPointY, localThirdPointZ, -tempAngle2 + + ' Third rotation around Z-axis + GetAngle localFirstPointX, localFirstPointZ, localThirdPointX, localThirdPointZ, tempAngle3 + tempAngle3 = tempAngle3 + globalPi / 2 + RotatePoint localFirstPointX, localFirstPointZ, localSecondPointX, localSecondPointZ, -tempAngle3 + RotatePoint localFirstPointX, localFirstPointZ, localThirdPointX, localThirdPointZ, -tempAngle3 + + ' Calculate distance from viewer to determine shading + viewerX = localFirstPointX + viewerY = localFirstPointY + viewerZ = localFirstPointZ + 30 + RotatePoint localFirstPointX, localFirstPointZ, viewerX, viewerZ, tempAngle3 + RotatePoint localFirstPointY, localFirstPointZ, viewerY, viewerZ, tempAngle2 + RotatePoint localFirstPointX, localFirstPointY, viewerX, viewerY, tempAngle1 + + ' Compute distance from viewer to first point + distanceX = firstPointX + 20 + distanceY = firstPointY + 10 + distance = SQR((distanceX - viewerX) ^ 2 + (distanceY - viewerY) ^ 2) + shadeValue = 49 - distance + IF shadeValue < 0 THEN shadeValue = 0 +END SUB + +SUB DisplayScene1 + ' + ' Loads a 3D model from data.dat and demonstrates real-time rotation. + ' The model is projected to 2D and animated with a rotating effect. + ' + + SetPalette 0, 63, 20, 255 + DIM modelVertexX(0 TO 1000) + DIM modelVertexY(0 TO 1000) + DIM modelVertexZ(0 TO 1000) + DIM projectedVertexX(0 TO 1000) + DIM projectedVertexY(0 TO 1000) + DIM lineStartVertex(0 TO 1500) + DIM lineEndVertex(0 TO 1500) + DIM oldLineStartX(1 TO 1500) + DIM oldLineStartY(1 TO 1500) + DIM oldLineEndX(1 TO 1500) + DIM oldLineEndY(1 TO 1500) + DIM totalVertices, totalLines + DIM rotationAngle1, rotationAngle2, rotationAngle3 + DIM rotationSpeed1, rotationSpeed2, rotationSpeed3 + DIM incrementVertices, incrementPolygons + DIM animationTime + DIM currentLines + DIM progressIndex + + animationTime = 0 + progressIndex = 1 + rotationAngle1 = 0 + rotationAngle2 = 0 + totalVertices = -1 + totalLines = 0 + incrementVertices = 0 + incrementPolygons = 0 + currentLines = 0 + + SetPalette 40, 40, 40, 254 + COLOR 254 + LOCATE 2, 11 + PRINT "One moment" + + OPEN "data.dat" FOR INPUT AS #1 + INPUT #1, incrementVertices + INPUT #1, incrementPolygons + + FOR vertexIndex = 1 TO incrementVertices + INPUT #1, xVal, yVal, zVal + totalVertices = totalVertices + 1 + modelVertexX(totalVertices) = xVal - 100 + modelVertexY(totalVertices) = yVal + modelVertexZ(totalVertices) = zVal + NEXT vertexIndex + + INPUT #1, lineVal1, lineVal2, lineVal3 + + FOR polygonIndex = 1 TO incrementPolygons - 1 + INPUT #1, lineVal1!, lineVal2!, lineVal3! + newLineStart! = lineVal1! + newLineEnd! = lineVal2! + GOSUB AddLine + newLineStart! = lineVal2! + newLineEnd! = lineVal3! + GOSUB AddLine + newLineStart! = lineVal1! + newLineEnd! = lineVal3! + GOSUB AddLine + LOCATE 4, 10 + PRINT STR$(INT(polygonIndex / (incrementPolygons - 1) * 100)) + "% ready" + NEXT polygonIndex + + CLOSE 1 + CLS + +RotateLoop: + animationTime = animationTime + 1 + quitKey$ = INKEY$ + IF quitKey$ = "q" THEN END + + varA = COS(animationTime / 25) + rotationAngle1 = COS(animationTime / 29) * varA + rotationAngle2 = (globalPiValue / 2) + SIN(animationTime / 42) * varA + sin1 = SIN(rotationAngle1) + cos1 = COS(rotationAngle1) + sin2 = SIN(rotationAngle2) + cos2 = COS(rotationAngle2) + + IF progressIndex >= 1 THEN + currentLines = currentLines + progressIndex + progressIndex = progressIndex + .03 + IF currentLines > totalLines THEN currentLines = totalLines: progressIndex = 0 + END IF + + ' Project each 3D vertex to 2D + FOR vertexIndex = 0 TO totalVertices + x = modelVertexX(vertexIndex) + y = modelVertexY(vertexIndex) + z = modelVertexZ(vertexIndex) + zTemp = z * sin1 + y * cos1 + yTemp = y * sin1 - z * cos1 + zFinal = zTemp * sin2 + x * cos2 + xFinal = x * sin2 - zTemp * cos2 + zFinal = zFinal + 100 + xFinal = xFinal / zFinal * 74 * 2 + yFinal = yTemp / zFinal * 65 * 2 + projectedVertexX(vertexIndex) = xFinal + 160 + projectedVertexY(vertexIndex) = yFinal + 80 + NEXT vertexIndex + + ' Draw lines between vertices + FOR lineIndex = 1 TO currentLines + startVertex = lineStartVertex(lineIndex) + endVertex = lineEndVertex(lineIndex) + x1 = projectedVertexX(startVertex) + y1 = projectedVertexY(startVertex) + x2 = projectedVertexX(endVertex) + y2 = projectedVertexY(endVertex) + LINE (oldLineStartX(lineIndex), oldLineStartY(lineIndex))-(oldLineEndX(lineIndex), oldLineEndY(lineIndex)), 0 + LINE (x1, y1)-(x2, y2), 255 + oldLineStartX(lineIndex) = x1 + oldLineStartY(lineIndex) = y1 + oldLineEndX(lineIndex) = x2 + oldLineEndY(lineIndex) = y2 + NEXT lineIndex + + SOUND 0, .5 + IF animationTime < 280 THEN GOTO RotateLoop + GOTO EndScene + +AddLine: + FOR checkIndex = 1 TO totalLines + IF lineStartVertex(checkIndex) = newLineStart! THEN + IF lineEndVertex(checkIndex) = newLineEnd! THEN RETURN + END IF + IF lineStartVertex(checkIndex) = newLineEnd! THEN + IF lineEndVertex(checkIndex) = newLineStart! THEN RETURN + END IF + NEXT checkIndex + + totalLines = totalLines + 1 + lineStartVertex(totalLines) = newLineStart! + lineEndVertex(totalLines) = newLineEnd! + RETURN + +EndScene: + globalAngleOne = rotationAngle1 + globalAngleTwo = rotationAngle2 +END SUB + +SUB DisplayScene2 + ' + ' Loads human face 3D model "data.dat" and projects triangular faces in 2D. + ' Each triangle's average depth is computed, and polygons are drawn + ' from back to front with FillPolygon. The shading is computed too. + ' + + SetPalette 0, 63, 20, 255 + CLS + globalAngleOne = 0 + globalAngleTwo = 1.5 + DIM pointX(0 TO 2000) + DIM pointY(0 TO 2000) + DIM pointZ(0 TO 2000) + DIM rotatedX(0 TO 2000) + DIM rotatedY(0 TO 2000) + DIM rotatedZ(0 TO 2000) + DIM polyVertex1(1 TO 2000) + DIM polyVertex2(1 TO 2000) + DIM polyVertex3(1 TO 2000) + numPoints = 0 + numTriangles = 0 + + OPEN "data.dat" FOR INPUT AS #1 + INPUT #1, totalPoints + INPUT #1, totalPolys + + FOR loopIndex = 1 TO totalPoints + INPUT #1, posXVal, posYVal, posZVal + pointX(numPoints) = posXVal - 100 + pointY(numPoints) = posYVal + pointZ(numPoints) = posZVal + numPoints = numPoints + 1 + NEXT loopIndex + + INPUT #1, lineValA, lineValB, lineValC + + FOR loopIndex = 1 TO totalPolys - 1 + INPUT #1, lineValA, lineValB, lineValC + numTriangles = numTriangles + 1 + polyVertex1(numTriangles) = lineValA + polyVertex2(numTriangles) = lineValB + polyVertex3(numTriangles) = lineValC + NEXT loopIndex + + CLOSE #1 + + sin1 = SIN(globalAngleOne) + cos1 = COS(globalAngleOne) + sin2 = SIN(globalAngleTwo) + cos2 = COS(globalAngleTwo) + + ' Project each 3D point + FOR loopIndex = 0 TO numPoints + localX = pointX(loopIndex) + localY = pointY(loopIndex) + localZ = pointZ(loopIndex) + zTmp = localZ * sin1 + localY * cos1 + yTmp = localY * sin1 - localZ * cos1 + zFin = zTmp * sin2 + localX * cos2 + xFin = localX * sin2 - zTmp * cos2 + zFin = zFin + 100 + xFin = xFin / zFin * 74 * 2 + yFin = yTmp / zFin * 65 * 2 + rotatedX(loopIndex) = xFin + 160 + rotatedY(loopIndex) = yFin + 80 + rotatedZ(loopIndex) = zFin + NEXT loopIndex + + ' Adjust palette for shading + FOR loopIndex = 1 TO 49 + SetPalette loopIndex * 1.1 + 20, loopIndex * 1.1 + 10, loopIndex * 1.1, loopIndex + NEXT loopIndex + + DIM polyDepth(1 TO numTriangles) + + FOR loopIndex = 1 TO numTriangles + polyDepth(loopIndex) = (rotatedZ(polyVertex1(loopIndex)) + rotatedZ(polyVertex2(loopIndex)) + rotatedZ(polyVertex3(loopIndex))) + NEXT loopIndex + + endIndex = numTriangles + + ' Sort by descending depth (z) + FOR loopIndex = 1 TO numTriangles + bigVal = -10000 + bigIndex = 1 + FOR checkIdx = 1 TO endIndex + IF polyDepth(checkIdx) > bigVal THEN + bigVal = polyDepth(checkIdx) + bigIndex = checkIdx + END IF + NEXT checkIdx + + vertexA = polyVertex1(bigIndex) + vertexB = polyVertex2(bigIndex) + vertexC = polyVertex3(bigIndex) + polyDepth(bigIndex) = polyDepth(endIndex) + polyVertex1(bigIndex) = polyVertex1(endIndex) + polyVertex2(bigIndex) = polyVertex2(endIndex) + polyVertex3(bigIndex) = polyVertex3(endIndex) + endIndex = endIndex - 1 + + ComputeShadeValue rotatedX(vertexA), rotatedY(vertexA), rotatedZ(vertexA), rotatedX(vertexB), rotatedY(vertexB), rotatedZ(vertexB), rotatedX(vertexC), rotatedY(vertexC), rotatedZ(vertexC), shadeVal + + FillPolygon INT(rotatedX(vertexA)), INT(rotatedY(vertexA)), INT(rotatedX(vertexB)), INT(rotatedY(vertexB)), INT(rotatedX(vertexC)), INT(rotatedY(vertexC)), INT(shadeVal) + NEXT loopIndex + +' Delay before proceeding to next scene + FOR loopIndex = 1 TO 20 + SOUND 0, 1 + NEXT loopIndex + +END SUB + +SUB DisplayScene3 + ' + ' Demonstrates simple raster/wave effects by copying screen slices, + ' does some random shifting, then shows text with circles around the bits. + ' + + DIM bufferArray(1 TO 10000) + DIM waveArray(0 TO 35) + + + ' Build a wave-like boundary in waveArray() + FOR loopIndex = 0 TO 30 + IF loopIndex <= 5 THEN waveArray(loopIndex) = 120 + (SQR((20 - loopIndex) * loopIndex)) + IF (loopIndex > 5) AND (loopIndex < 25) THEN waveArray(loopIndex) = 120 + 10 + IF loopIndex >= 25 THEN waveArray(loopIndex) = 120 + (SQR((30 - loopIndex) * (loopIndex - 10))) + NEXT loopIndex + + ' Slide the screen upward in small blocks + FOR screenY = 0 TO 30 + FOR screenX = 10 TO 300 STEP 10 + GET (screenX, 0)-(screenX + 9, 198), bufferArray(1) + PUT (screenX, 1), bufferArray(1), PSET + NEXT screenX + + ' Slight color shift + FOR colorIx = 1 TO 49 + SetPalette colorIx * 1.1 + (20 - screenY), colorIx * 1.1 + 10 + (screenY / 1.5), colorIx * 1.1, colorIx + NEXT colorIx + + SOUND 0, 1 + LINE (160 - waveArray(screenY), 20)-(160 + waveArray(screenY), 20), 255 + NEXT screenY + + LOCATE 1, 1 + COLOR 254 + SetPalette 0, 0, 0, 254 + PRINT "Test 123456789" + SetPalette 63, 0, 0, 253 + + ' Draw circles around the nonzero pixels of the printed text + FOR rowY = 0 TO 8 + FOR rowX = 0 TO 120 + pixelVal = POINT(rowX, rowY) + IF pixelVal > 0 THEN CIRCLE (rowX * 2 + 50, rowY * 3 + 26), 2, 0 + NEXT rowX + + FOR rowX = 0 TO 120 + pixelVal = POINT(rowX, rowY + 1) + IF pixelVal > 0 THEN CIRCLE (rowX * 2 + 50, (rowY + 1) * 3 + 26), 2, 253 + NEXT rowX + + SOUND 0, 2 + NEXT rowY + + RANDOMIZE 1 + + ' Perform random screen shifts + FOR loopIndex = 1 TO 10 + randY = RND * 100 + 50 + FOR screenX = 10 TO 300 STEP 10 + GET (screenX, randY)-(screenX + 9, 198), bufferArray(1) + PUT (screenX, randY - 1), bufferArray(1), PSET + NEXT screenX + NEXT loopIndex + + COLOR 253 + SetPalette 0, 0, 0, 253 + LOCATE 1 + PRINT " Author: Svjatoslav Agejenko 30.09.2001 " + + GET (0, 0)-(319, 8), bufferArray(1) + LOCATE 1 + PRINT " " + PUT (0, 190), bufferArray(1), PSET + + FOR loopIndex = 1 TO 32 + SetPalette 0, loopIndex, loopIndex * 2, 253 + SOUND 0, 1 + NEXT loopIndex + + WaitForInput +END SUB + +SUB DisplayScene4 + ' + ' Builds a fractal backdrop, prints short text lines + + RANDOMIZE 1 + MakeBackground + DrawRoundedBox 30, 50, 290, 150 + SetPalette 32, 64, 32, 250 + yOffset = 0 + PrintText 30, 70 + yOffset, 1, 250, "Next will be animated helicopter." + yOffset = yOffset + 16 + PrintText 30, 70 + yOffset, 1, 250, "Helicopter chooses and picks up" + yOffset = yOffset + 20 + PrintText 30, 70 + yOffset, 1, 250, "random pyramids. Press any key" + yOffset = yOffset + 16 + PrintText 30, 70 + yOffset, 1, 250, "to proceed to next slide." + WaitForInput +END SUB + +SUB DisplayScene7 + ' + ' Simple transitional effect: draws horizontal lines across the screen + ' in steps, clearing or darkening each row to black. + ' + + SetPalette 0, 0, 0, 0 + FOR outerIndex = 0 TO 19 + FOR drawY = outerIndex TO 199 STEP 20 + LINE (0, drawY)-(319, drawY), 0 + NEXT drawY + SOUND 0, .5 + NEXT outerIndex +END SUB + +SUB DisplayScene8 + ' + ' A more complex 3D scene: + ' Terrain with various heights. + ' Helicopter hovers over terrain. + ' Helicopter randomly chooses small pyramids that are scattered around terrain, + ' flies to pyramids and picks them up one-by-one. + ' Press any key to transition to next slide. + + FOR fadeIndex = 1 TO 50 + SetPalette 0, 0, 0, fadeIndex + NEXT fadeIndex + + DIM mainX(0 TO 800) + DIM mainY(0 TO 800) + DIM mainZ(0 TO 800) + DIM lineStart(0 TO 1000) + DIM lineEnd(0 TO 1000) + DIM lineColor(0 TO 1000) + DIM lineBufferXOne(1 TO 1000) + DIM lineBufferYOne(1 TO 1000) + DIM lineBufferXTwo(1 TO 1000) + DIM lineBufferYTwo(1 TO 1000) + DIM projectedX(0 TO 800) + DIM projectedY(0 TO 800) + DIM holdX(1 TO 50) + DIM holdY(1 TO 50) + DIM holdZ(1 TO 50) + DIM helicopterAngle + DIM helicopterRotorAngle + DIM holdNumber + DIM helicopterPointer + DIM holdAx, holdAy, holdAz + DIM moveX, moveZ, moveY + DIM destinationX, destinationZ + DIM destinationAngle + DIM totalPoints, totalLines + DIM angleOne, angleTwo + DIM timeCounter + DIM incVal + DIM miniCount + DIM minutesVal + + minutesVal = 0 + miniCount = 25 + timeCounter = 0 + incVal = 1 + angleOne = 0 + angleTwo = 0 + totalPoints = 0 + totalLines = 0 + + RANDOMIZE 100 + blockSize = 64 + +FractalSubLoop: + halfBlock = blockSize / 2 + FOR rowY = 0 TO 100 STEP blockSize + FOR rowX = 0 TO 100 STEP blockSize + color1 = POINT(rowX, rowY) + color2 = POINT(rowX + blockSize, rowY) + color3 = POINT(rowX, rowY + blockSize) + color4 = POINT(rowX + blockSize, rowY + blockSize) + color5 = (color1 + color2 + color3 + color4) / 4 + RND * blockSize * 6 - halfBlock * 7 + color6 = (color2 + color4) / 2 + RND * blockSize * 6 - halfBlock * 7 + color7 = (color3 + color4) / 2 + RND * blockSize * 6 - halfBlock * 7 + + IF color5 > 50 THEN color5 = 50 + IF color5 < 0 THEN color5 = 0 + IF color6 > 50 THEN color6 = 50 + IF color6 < 0 THEN color6 = 0 + IF color7 > 50 THEN color7 = 50 + IF color7 < 0 THEN color7 = 0 + + PSET (rowX + halfBlock, rowY + halfBlock), color5 + PSET (rowX + blockSize, rowY + halfBlock), color6 + PSET (rowX + halfBlock, rowY + blockSize), color7 + NEXT rowX + NEXT rowY + + blockSize = blockSize / 2 + IF blockSize > 1 THEN GOTO FractalSubLoop + + ' Build mesh points in mainX(), mainY(), mainZ() + FOR zLoop = 1 TO 400 STEP 20 + FOR xLoop = 1 TO 400 STEP 20 + totalPoints = totalPoints + 1 + mainX(totalPoints) = xLoop + mainY(totalPoints) = POINT(zLoop / 20 + 10, xLoop / 20 + 10) * 2 + mainZ(totalPoints) = zLoop + + IF xLoop > 1 THEN + totalLines = totalLines + 1 + lineStart(totalLines) = totalPoints + lineEnd(totalLines) = totalPoints - 1 + lineColor(totalLines) = 1 + END IF + + IF zLoop > 1 THEN + totalLines = totalLines + 1 + lineStart(totalLines) = totalPoints + lineEnd(totalLines) = totalPoints - 20 + lineColor(totalLines) = 1 + END IF + NEXT xLoop + NEXT zLoop + + LINE (0, 0)-(319, 199), 0, BF + SetPalette 0, 0, 0, 0 + SetPalette 0, 40, 10, 1 + SetPalette 0, 32, 64, 2 + SetPalette 50, 50, 0, 3 + SetPalette 64, 20, 0, 4 + + moveX = 200 + moveZ = 200 + distanceScale = 1000 + holdAx = 200 + holdAy = 0 + holdAz = 200 + destinationX = 200 + destinationZ = 200 + + ' Load helicopter model + OPEN "data2.dat" FOR INPUT AS #1 + indexA = 0 + indexB = 0 + helicopterPointer = totalPoints + 1 + +ReadLoop: + INPUT #1, fileX, fileY, fileZ + IF fileX = 999 THEN GOTO CheckLines + indexA = indexA + 1 + holdX(indexA) = fileX + holdY(indexA) = -fileY + holdZ(indexA) = fileZ + GOTO ReadLoop + +CheckLines: + INPUT #1, readA, readB + IF readA = 999 THEN GOTO CloseData + totalLines = totalLines + 1 + lineStart(totalLines) = readA + totalPoints + 1 + lineEnd(totalLines) = readB + totalPoints + 1 + lineColor(totalLines) = 2 + GOTO CheckLines + +CloseData: + CLOSE #1 + totalPoints = totalPoints + indexA + holdNumber = indexA + + RANDOMIZE 10 + colorVal = 3 + + FOR indexA = 1 TO 25 + randPick = RND * 396 + 2 + xBox = mainX(randPick) + zBox = mainZ(randPick) + yBox = mainY(randPick) - 4 + + mainX(totalPoints + 1) = xBox - 5 + mainY(totalPoints + 1) = yBox + mainZ(totalPoints + 1) = zBox - 5 + mainX(totalPoints + 2) = xBox + 5 + mainY(totalPoints + 2) = yBox + mainZ(totalPoints + 2) = zBox - 5 + mainX(totalPoints + 3) = xBox + 5 + mainY(totalPoints + 3) = yBox + mainZ(totalPoints + 3) = zBox + 5 + mainX(totalPoints + 4) = xBox - 5 + mainY(totalPoints + 4) = yBox + mainZ(totalPoints + 4) = zBox + 5 + mainX(totalPoints + 5) = xBox + mainY(totalPoints + 5) = yBox - 5 + mainZ(totalPoints + 5) = zBox + + lineStart(totalLines + 1) = totalPoints + 1 + lineEnd(totalLines + 1) = totalPoints + 2 + lineColor(totalLines + 1) = colorVal + lineStart(totalLines + 2) = totalPoints + 2 + lineEnd(totalLines + 2) = totalPoints + 3 + lineColor(totalLines + 2) = colorVal + lineStart(totalLines + 3) = totalPoints + 3 + lineEnd(totalLines + 3) = totalPoints + 4 + lineColor(totalLines + 3) = colorVal + lineStart(totalLines + 4) = totalPoints + 4 + lineEnd(totalLines + 4) = totalPoints + 1 + lineColor(totalLines + 4) = colorVal + lineStart(totalLines + 5) = totalPoints + 1 + lineEnd(totalLines + 5) = totalPoints + 5 + lineColor(totalLines + 5) = colorVal + lineStart(totalLines + 6) = totalPoints + 2 + lineEnd(totalLines + 6) = totalPoints + 5 + lineColor(totalLines + 6) = colorVal + lineStart(totalLines + 7) = totalPoints + 3 + lineEnd(totalLines + 7) = totalPoints + 5 + lineColor(totalLines + 7) = colorVal + lineStart(totalLines + 8) = totalPoints + 4 + lineEnd(totalLines + 8) = totalPoints + 5 + lineColor(totalLines + 8) = colorVal + + totalPoints = totalPoints + 5 + totalLines = totalLines + 8 + NEXT indexA + +MainLoop: + SOUND 0, 1 + IF INKEY$ <> "" THEN minutesVal = 1 + IF minutesVal > 150 THEN GOTO FinalArea + IF minutesVal <> 0 THEN minutesVal = minutesVal + 7 + + moveX = holdAx + moveY = 50 - holdAy - minutesVal + moveZ = holdAz + + SELECT CASE incVal + CASE 1 + destinationX = mainX(totalPoints) + destinationZ = mainZ(totalPoints) + GetAngle destinationX, destinationZ, holdAx, holdAz, destinationAngle + + IF destinationAngle - helicopterAngle > globalPi THEN destinationAngle = destinationAngle - (globalPi * 2) + IF helicopterAngle - destinationAngle > globalPi THEN destinationAngle = destinationAngle + (globalPi * 2) + + incVal = 2 + + FOR indexA = totalLines - 7 TO totalLines + lineColor(indexA) = 4 + NEXT indexA + + CASE 2 + angleDiff = destinationAngle - helicopterAngle + IF destinationAngle = helicopterAngle THEN incVal = 3 + IF angleDiff > .05 THEN angleDiff = .05 + IF angleDiff < -.05 THEN angleDiff = -.05 + helicopterAngle = helicopterAngle + angleDiff + + CASE 3 + diffX = destinationX - holdAx + diffZ = destinationZ - holdAz + distVal = SQR(diffX * diffX + diffZ * diffZ) + IF distVal < 5 THEN incVal = 4 + distVal = distVal / 2 + holdAx = holdAx + diffX / distVal + holdAz = holdAz + diffZ / distVal + + CASE 4 + FOR indexA = totalPoints - 4 TO totalPoints + mainY(indexA) = mainY(indexA) - 1 + NEXT indexA + + IF mainY(totalPoints) < 3 - holdAy THEN + FOR indexA = totalLines - 7 TO totalLines + LINE (lineBufferXOne(indexA), lineBufferYOne(indexA))-(lineBufferXTwo(indexA), lineBufferYTwo(indexA)), 0 + NEXT indexA + + totalPoints = totalPoints - 5 + totalLines = totalLines - 8 + miniCount = miniCount - 1 + incVal = 6 + + IF miniCount <= 0 THEN incVal = 7 + END IF + + CASE 6 + incVal = 5 + + CASE 5 + incVal = 1 + END SELECT + + + ' Place helicopter on the scene + localYVal = 60 - mainY(INT((holdAz + 10) / 20) * 20 + INT((holdAx + 10) / 20)) + + IF holdAy > localYVal + 5 THEN holdAy = holdAy - 1 + IF holdAy < localYVal THEN holdAy = holdAy + 1 + IF holdAy > localYVal + 25 THEN holdAy = holdAy - 1 + IF holdAy < localYVal - 20 THEN holdAy = holdAy + 1 + + sinVal = SIN(helicopterAngle) + cosVal = COS(helicopterAngle) + + FOR indexA = 0 TO holdNumber - 5 + tempX = holdX(indexA + 1) + tempZ = holdZ(indexA + 1) + mainX(indexA + helicopterPointer) = tempX * sinVal + tempZ * cosVal + holdAx + mainY(indexA + helicopterPointer) = holdY(indexA + 1) - holdAy + mainZ(indexA + helicopterPointer) = tempZ * sinVal - tempX * cosVal + holdAz + NEXT indexA + + ' Rotate helicopter rotor + helicopterRotorAngle = helicopterRotorAngle + .5 + sinVal = SIN(helicopterRotorAngle) + cosVal = COS(helicopterRotorAngle) + + FOR indexA = holdNumber - 4 TO holdNumber - 1 + tempX = holdX(indexA + 1) + tempZ = holdZ(indexA + 1) + mainX(indexA + helicopterPointer) = tempX * sinVal + tempZ * cosVal + holdAx + mainY(indexA + helicopterPointer) = holdY(indexA + 1) - holdAy + mainZ(indexA + helicopterPointer) = tempZ * sinVal - tempX * cosVal + holdAz + NEXT indexA + + timeCounter = timeCounter + 1 + angleOne = angleOne + SIN(timeCounter / 100) / 20 + angleTwo = SIN(timeCounter / 42) * .3 + 1.15 + sin1 = SIN(angleOne) + cos1 = COS(angleOne) + sin2 = SIN(angleTwo) + cos2 = COS(angleTwo) + + ' Project all points to 2D + FOR indexA = 0 TO totalPoints + shiftX = mainX(indexA) - moveX + shiftY = mainY(indexA) - moveY + shiftZ = mainZ(indexA) - moveZ + zIntermediate = shiftZ * sin1 + shiftX * cos1 + xIntermediate = shiftX * sin1 - shiftZ * cos1 + zProject = zIntermediate * sin2 + shiftY * cos2 + yProject = shiftY * sin2 - zIntermediate * cos2 + zProject = zProject + distanceScale + + IF zProject < 1 THEN projectedX(indexA) = -1: GOTO Skip2D + + xProject = xIntermediate / zProject * 74 * 2 + yProject = yProject / zProject * 65 * 2 + projectedX(indexA) = xProject + 160 + projectedY(indexA) = yProject + 80 + +Skip2D: + NEXT indexA + + ' Erase old lines and draw new ones + FOR indexA = 1 TO totalLines + startIndex = lineStart(indexA) + endIndex = lineEnd(indexA) + x1Temp = projectedX(startIndex) + x2Temp = projectedX(endIndex) + LINE (lineBufferXOne(indexA), lineBufferYOne(indexA))-(lineBufferXTwo(indexA), lineBufferYTwo(indexA)), 0 + + IF (x1Temp = -1) OR (x2Temp = -1) THEN GOTO SkipDrawing + + y1Temp = projectedY(startIndex) + y2Temp = projectedY(endIndex) + LINE (x1Temp, y1Temp)-(x2Temp, y2Temp), lineColor(indexA) + lineBufferXOne(indexA) = x1Temp + lineBufferYOne(indexA) = y1Temp + lineBufferXTwo(indexA) = x2Temp + lineBufferYTwo(indexA) = y2Temp + +SkipDrawing: + NEXT indexA + + IF distanceScale > 200 THEN distanceScale = distanceScale - 10 + IF timeCounter < 28000 THEN GOTO MainLoop + +FinalArea: +END SUB + +SUB DrawRoundedBox (topLeftX, topLeftY, bottomRightX, bottomRightY) + ' + ' Draws a soft-edged rectangular box by fading pixel colors around its edges. + ' This creates a gentle "rounded" or "blurred" border appearance. + ' + + FOR currentY = topLeftY TO bottomRightY + fadeSize = 10 + ' Fade in the upper boundary region + IF currentY - topLeftY <= 10 THEN + fadeSize = (SQR((20 - (currentY - topLeftY)) * (currentY - topLeftY))) + END IF + ' Fade in the lower boundary region + IF bottomRightY - currentY <= 10 THEN + fadeSize = (SQR((20 - (bottomRightY - currentY)) * (bottomRightY - currentY))) + END IF + FOR currentX = topLeftX - fadeSize TO bottomRightX + fadeSize + colorVal = POINT(currentX, currentY) + IF colorVal <= 127 THEN + colorVal = colorVal + 127 + IF colorVal > 245 THEN colorVal = 245 + PSET (currentX, currentY), colorVal + END IF + NEXT currentX + NEXT currentY +END SUB + +SUB FillPolygon (vertex1X, vertex1Y, vertex2X, vertex2Y, vertex3X, vertex3Y, fillColor) + ' + ' Fills a triangular area using a scanline algorithm. + ' 1. Finds intersection points between edges and horizontal scanlines + ' 2. Draws horizontal lines between pairs of intersections + ' + + DIM scanIntersection(-100 TO 300) + startX = vertex1X + startY = vertex1Y + endX = vertex2X + endY = vertex2Y + GOSUB DrawEdges + startX = vertex1X + startY = vertex1Y + endX = vertex3X + endY = vertex3Y + GOSUB DrawEdges + startX = vertex3X + startY = vertex3Y + endX = vertex2X + endY = vertex2Y + GOSUB DrawEdges + GOTO FinishPolygon + +DrawEdges: + ' Swap points if needed to ensure we draw from top to bottom + IF endY < startY THEN + SWAP startY, endY + SWAP startX, endX + END IF + ' For each scanline between the two points + FOR scanY = startY TO endY - 1 + ' Calculate x position along the edge + scanX = startX + (endX - startX) * ((scanY - startY) / (endY - startY)) + ' Store first intersection point + IF scanIntersection(scanY) = 0 THEN + scanIntersection(scanY) = scanX + ELSE + ' Draw horizontal line between intersections + LINE (scanX, scanY)-(scanIntersection(scanY), scanY), fillColor + END IF + NEXT scanY + RETURN + +FinishPolygon: +END SUB + +SUB GetAngle (firstPointX, firstPointY, secondPointX, secondPointY, angleBetween) + ' + ' Calculates the angle between two 2D points in radians. + ' Used for rotation calculations in 3D rendering. + ' + + IF firstPointY = secondPointY THEN + IF secondPointX > firstPointX THEN + angleBetween = globalPi / 2 + ELSE + angleBetween = globalPi * 1.5 + END IF + GOTO SkipSpecialCases + END IF + + IF secondPointY > firstPointY THEN + IF secondPointX = firstPointX THEN + angleBetween = globalPi + GOTO SkipSpecialCases + END IF + IF secondPointX > firstPointX THEN + angleBetween = (globalPi * 1) - ATN((secondPointX - firstPointX) / (secondPointY - firstPointY)) + ELSE + angleBetween = globalPi + ATN((firstPointX - secondPointX) / (secondPointY - firstPointY)) + END IF + ELSE + IF secondPointX = firstPointX THEN + angleBetween = 0 + GOTO SkipSpecialCases + END IF + IF secondPointX > firstPointX THEN + angleBetween = ATN((secondPointX - firstPointX) / (firstPointY - secondPointY)) + ELSE + angleBetween = globalPi * 2 - ATN((firstPointX - secondPointX) / (firstPointY - secondPointY)) + END IF + END IF + +SkipSpecialCases: +END SUB + +SUB InitializeFont + ' + ' Captures the current text font into fontData() for later use in PrintText. + ' This is done by printing each ASCII character (32..150) and reading its bits. + ' + + SetPalette 0, 0, 0, 70 + COLOR 70 + FOR asciiCode = 32 TO 150 + LOCATE 1, 1 + PRINT CHR$(asciiCode); + FOR rowY = 0 TO 7 + FOR rowX = 0 TO 7 + fontData(rowX, rowY, asciiCode) = POINT(rowX, rowY) + NEXT rowX + NEXT rowY + NEXT asciiCode +END SUB + +SUB InitializeProgram + ' + ' Initializes the environment: + ' 1) Switches to SCREEN 13 + ' 2) Sets globalPi and globalPiI + ' 3) Calculates a shared factor (fac) for angles + ' 4) Calls InitializeFont to capture system font data + ' + + SCREEN 13 + globalPi = 3.141592 + globalPiValue = globalPi + angleFactor = 360 / (globalPi * 2) + InitializeFont +END SUB + +DEFINT A-Z +SUB MakeBackground + ' + ' Creates a fractal-like landscape in the background by iteratively sampling + ' and perturbing pixel values. The result is a random terrain effect. + ' + + CLS + SetPalette 0, 5, 5, 250 + SetPalette 0, 5, 5, 251 + SetPalette 0, 5, 5, 252 + SetPalette 0, 5, 5, 253 + SetPalette 0, 5, 5, 254 + SetPalette 0, 5, 5, 255 + + ' Set custom RGB values for palette entries 0..127 + FOR colorIndex = 0 TO 127 + OUT &H3C8, colorIndex + OUT &H3C9, SIN(colorIndex / 22) * 30 + 30 + OUT &H3C9, SIN(colorIndex / 18) * 5 + 5 + OUT &H3C9, COS(colorIndex / 12) * 10 + 10 + NEXT colorIndex + + ' Palette entries 128..245 + FOR colorIndex = 128 TO 245 + OUT &H3C8, colorIndex + offsetIndex = colorIndex - 128 + OUT &H3C9, SIN(offsetIndex / 22) * 4 + 10 + OUT &H3C9, SIN(offsetIndex / 18) * 4 + 10 + OUT &H3C9, COS(offsetIndex / 12) * 4 + 10 + NEXT colorIndex + + maxValue = 127 + blockSize = 2 ^ 8 + +FractalLoop: + blockSize = blockSize \ 2 + numXSteps = (319 \ blockSize) - 1 + numYSteps = (199 \ blockSize) - 1 + + ' Subdivide squares in the image to add random variations + FOR rowY = 0 TO numYSteps + FOR rowX = 0 TO numXSteps + topLeftX = rowX * blockSize + topLeftY = rowY * blockSize + topLeftColor = POINT(topLeftX, topLeftY) + topRightColor = POINT(topLeftX + blockSize, topLeftY) + bottomLeftColor = POINT(topLeftX, topLeftY + blockSize) + bottomRightColor = POINT(topLeftX + blockSize, topLeftY + blockSize) + + midTopColor = ((topLeftColor + topRightColor) / 2) + (RND * 6) - 3 + IF midTopColor > maxValue THEN midTopColor = maxValue + + midLeftColor = ((topLeftColor + bottomLeftColor) / 2) + (RND * 6) - 3 + IF midLeftColor > maxValue THEN midLeftColor = maxValue + + midRightColor = ((topRightColor + bottomRightColor) / 2) + (RND * 6) - 3 + IF midRightColor > maxValue THEN midRightColor = maxValue + + midBottomColor = ((bottomLeftColor + bottomRightColor) / 2) + (RND * 6) - 3 + IF midBottomColor > maxValue THEN midBottomColor = maxValue + + centerColor = ((midTopColor + midLeftColor + midRightColor + midBottomColor) / 4) + (RND * 6) - 3 + IF centerColor > maxValue THEN centerColor = maxValue + + PSET (topLeftX + blockSize / 2, topLeftY + blockSize / 2), centerColor + PSET (topLeftX + blockSize / 2, topLeftY), midTopColor + PSET (topLeftX, topLeftY + blockSize / 2), midLeftColor + PSET (topLeftX + blockSize, topLeftY + blockSize / 2), midRightColor + PSET (topLeftX + blockSize / 2, topLeftY + blockSize), midBottomColor + NEXT rowX + NEXT rowY + + IF blockSize > 2 THEN GOTO FractalLoop +END SUB + +DEFSNG A-Z +SUB PrintText (posX, posY, scale, colorValue, textString$) + ' + ' Renders text at (posX, posY) using the captured fontData(). + ' Currently supports scale=1 for normal size. If scale=1, each character + ' is drawn 1:1 from the font data. + ' + + IF scale = 1 THEN + currentX = posX + FOR charIndex = 1 TO LEN(textString$) + asciiVal = ASC(RIGHT$(LEFT$(textString$, charIndex), 1)) + IF asciiVal > 150 OR asciiVal < 32 THEN GOTO SkipCharacter + FOR rowY = 0 TO 7 + FOR rowX = 0 TO 7 + pixelVal = fontData(rowX, rowY, asciiVal) + IF pixelVal > 0 THEN PSET (rowX + currentX, rowY + posY), colorValue + NEXT rowX + NEXT rowY +SkipCharacter: + currentX = currentX + 8 + NEXT charIndex + END IF +END SUB + +SUB RotatePoint (rotationCenterX, rotationCenterY, pointX, pointY, rotationAngle) + ' + ' Rotates a 2D point around a center using standard rotation formulas. + ' X' = (X - CX)*cos - (Y - CY)*sin + CX + ' Y' = (X - CX)*sin + (Y - CY)*cos + CY + ' + + deltaX = pointX - rotationCenterX + deltaY = pointY - rotationCenterY + sinAngle = SIN(rotationAngle) + cosAngle = COS(rotationAngle) + pointX = deltaX * cosAngle - deltaY * sinAngle + rotationCenterX + pointY = deltaX * sinAngle + deltaY * cosAngle + rotationCenterY +END SUB + +SUB SetPalette (red, green, blue, colorIndex) + ' + ' Sets palette entry 'colorIndex' to (red,green,blue). + ' Each component 0..63. + ' + + IF red < 0 THEN red = 0 + IF green < 0 THEN green = 0 + IF blue < 0 THEN blue = 0 + IF red > 63 THEN red = 63 + IF green > 63 THEN green = 63 + IF blue > 63 THEN blue = 63 + + OUT &H3C8, colorIndex + OUT &H3C9, red + OUT &H3C9, green + OUT &H3C9, blue +END SUB + +SUB WaitForInput + ' + ' Waits for exactly one keystroke and stores it into inputKey$. + ' + + inputKey$ = INPUT$(1) +END SUB + diff --git a/3D GFX/Helicopter/data.dat b/3D GFX/Helicopter/data.dat new file mode 100755 index 0000000..b97fdd7 --- /dev/null +++ b/3D GFX/Helicopter/data.dat @@ -0,0 +1,1129 @@ +410 718 +89 6 10 +88 2 7 +87 6 8 +83 6 6 +99 -6 17 +99 -10 13 +96 -10 12 +95 -6 16 +93 -9 10 +92 -5 15 +90 -4 8 +91 -6 6 +88 -2 2 +90 2 12 +87 5 14 +88 2 16 +91 -3 18 +94 -4 19 +99 -5 20 +83 -1 23 +79 4 17 +76 1 22 +71 6 16 +70 6 19 +66 12 14 +64 12 16 +63 16 11 +62 17 13 +60 23 10 +64 17 7 +63 15 2 +59 22 4 +70 10 5 +83 1 -0 +75 4 -0 +75 7 5 +69 7 0 +57 22 -8 +60 14 -8 +68 4 -8 +74 0 -9 +86 -3 -9 +90 -8 -2 +93 -14 4 +92 -11 1 +92 -14 -1 +88 -14 -6 +90 -18 -5 +88 -12 -9 +91 -10 -14 +89 -8 -16 +85 -8 -19 +77 -1 -20 +71 4 -30 +69 4 -17 +90 -12 -19 +94 -15 -15 +92 -13 -12 +96 -16 6 +99 -17 6 +99 -25 0 +96 -21 1 +93 -17 2 +93 -21 -0 +93 -23 -4 +96 -25 -1 +90 -14 -10 +90 -16 -9 +91 -18 -8 +92 -19 -9 +94 -19 -10 +95 -24 -6 +96 -17 -13 +95 -17 -12 +96 -15 -15 +94 -15 -13 +99 -27 -3 +96 -26 -3 +99 -25 -8 +98 -16 -15 +98 -14 -19 +96 -14 -19 +94 -14 -18 +98 -16 -23 +96 -16 -23 +93 -15 -23 +89 -13 -24 +84 -9 -25 +78 -3 -27 +77 -2 -30 +80 -4 -33 +81 -3 -30 +84 -9 -32 +98 -12 -39 +96 -16 -33 +98 -16 -33 +93 -11 -38 +93 -15 -33 +88 -12 -33 +88 -10 -37 +84 -9 -36 +80 -3 -41 +86 -7 -41 +89 -9 -41 +93 -11 -40 +98 -13 -46 +92 -12 -46 +89 -10 -46 +86 -8 -46 +81 -3 -46 +74 3 -46 +74 3 -40 +61 14 -16 +57 23 -15 +57 23 -24 +62 14 -27 +60 23 -34 +66 15 -38 +62 22 -38 +67 16 -45 +64 22 -45 +69 17 -51 +73 17 -56 +71 21 -56 +79 20 -62 +78 5 -57 +83 5 -61 +67 21 -52 +69 10 -39 +75 4 -52 +80 -3 -52 +98 -13 -54 +93 -13 -54 +93 -9 -59 +98 -10 -59 +98 -2 -63 +93 -2 -62 +88 -3 -61 +89 -9 -57 +89 -11 -53 +86 -9 -53 +83 -3 -57 +98 5 -64 +93 6 -63 +98 20 -67 +92 18 -66 +86 20 -65 +88 6 -62 +61 18 14 +62 12 18 +60 22 20 +63 16 23 +68 5 22 +69 8 27 +61 22 27 +63 19 28 +63 21 32 +70 12 35 +70 10 31 +76 1 25 +76 2 29 +76 4 32 +77 7 37 +76 9 42 +70 14 40 +65 20 38 +71 19 46 +77 12 48 +82 5 43 +75 18 51 +79 18 55 +82 20 59 +85 19 60 +84 14 57 +83 25 62 +87 25 62 +91 24 64 +90 18 62 +95 24 64 +94 17 63 +99 24 64 +99 17 63 +99 11 59 +93 11 59 +89 12 59 +82 8 50 +83 3 38 +82 0 34 +83 -0 31 +82 -1 27 +89 -3 23 +89 -3 28 +93 -3 24 +99 -4 25 +93 -3 28 +99 -4 28 +89 -2 32 +93 -2 32 +99 -2 32 +93 -0 35 +99 -0 35 +93 0 38 +99 0 39 +92 2 44 +99 2 44 +93 7 55 +99 5 52 +93 4 51 +88 6 51 +89 3 43 +89 1 38 +89 -0 34 +66 11 11 +68 10 8 +72 6 12 +74 6 8 +80 4 13 +81 5 9 +84 5 10 +110 6 8 +109 2 7 +109 6 10 +114 6 6 +103 -6 16 +102 -10 12 +105 -5 15 +105 -9 10 +107 -4 8 +107 -6 6 +109 -2 2 +107 2 12 +110 5 13 +110 2 16 +106 -3 18 +103 -4 19 +114 -1 23 +118 5 16 +121 1 21 +128 6 18 +126 7 16 +134 12 15 +132 12 13 +135 17 12 +134 16 11 +138 23 9 +133 17 7 +138 22 4 +134 15 2 +127 10 5 +114 1 -0 +122 4 -0 +122 7 5 +128 8 0 +140 23 -9 +137 14 -9 +129 4 -9 +123 0 -9 +111 -3 -9 +107 -8 -2 +106 -11 1 +104 -14 4 +106 -14 -1 +109 -14 -6 +107 -18 -5 +109 -12 -9 +106 -10 -14 +108 -8 -16 +112 -8 -19 +120 -0 -21 +128 4 -18 +125 4 -30 +107 -12 -19 +103 -15 -15 +105 -13 -12 +102 -16 6 +101 -21 1 +104 -17 2 +104 -21 -0 +104 -23 -4 +101 -25 -1 +107 -14 -10 +107 -16 -9 +106 -18 -8 +105 -19 -9 +102 -24 -6 +104 -19 -10 +102 -17 -12 +101 -17 -13 +101 -15 -15 +103 -15 -13 +102 -26 -3 +101 -14 -19 +103 -14 -18 +101 -16 -23 +104 -15 -23 +108 -13 -24 +113 -9 -25 +118 -3 -28 +120 -1 -30 +117 -4 -34 +116 -2 -30 +113 -9 -32 +101 -16 -33 +104 -11 -38 +104 -15 -33 +109 -12 -33 +109 -10 -37 +112 -8 -36 +116 -3 -41 +110 -7 -41 +108 -9 -41 +103 -11 -40 +104 -12 -46 +108 -10 -46 +111 -8 -46 +116 -3 -47 +122 4 -46 +123 4 -40 +136 14 -17 +140 23 -16 +139 23 -25 +134 14 -27 +136 23 -34 +135 23 -38 +131 16 -38 +132 22 -46 +129 16 -45 +125 21 -56 +123 18 -56 +127 17 -51 +117 21 -62 +119 5 -57 +113 6 -61 +129 21 -52 +127 10 -39 +121 4 -52 +116 -3 -52 +103 -13 -54 +103 -9 -59 +103 -2 -62 +109 -3 -61 +108 -9 -57 +108 -11 -54 +111 -9 -53 +113 -3 -57 +104 6 -63 +104 18 -66 +109 6 -63 +110 20 -65 +135 13 18 +136 18 14 +138 22 19 +135 16 22 +128 8 26 +129 6 22 +134 19 27 +136 22 26 +135 22 32 +127 11 30 +128 13 35 +122 1 25 +122 2 29 +121 4 32 +121 7 37 +128 14 39 +121 9 41 +132 20 38 +127 19 46 +121 12 48 +115 5 43 +123 18 51 +119 18 55 +114 14 56 +113 20 60 +116 20 59 +111 25 62 +115 25 61 +108 18 62 +107 24 64 +104 17 63 +103 24 64 +105 11 59 +109 12 58 +115 9 50 +115 3 38 +115 1 34 +115 -0 31 +115 -1 27 +109 -3 23 +109 -3 28 +104 -3 24 +105 -3 28 +109 -2 32 +105 -2 31 +105 -0 34 +105 0 38 +105 2 43 +105 7 55 +105 4 51 +110 6 50 +109 3 43 +109 1 38 +109 -0 34 +129 10 7 +131 11 11 +125 6 12 +123 6 7 +117 5 12 +117 5 9 +113 5 10 +2 0 1 +3 2 1 +6 4 5 +4 6 7 +8 7 6 +7 8 9 +8 10 9 +11 10 8 +12 10 11 +1 10 12 +13 10 1 +9 10 13 +0 13 1 +14 13 0 +15 13 14 +9 15 16 +15 9 13 +17 9 16 +9 17 7 +18 7 17 +7 18 4 +19 15 14 +20 19 14 +19 20 21 +22 21 20 +21 22 23 +24 23 22 +23 24 25 +26 25 24 +25 26 27 +28 27 26 +28 26 29 +31 29 30 +32 30 29 +33 3 1 +12 33 1 +34 3 33 +3 34 35 +36 35 34 +35 36 32 +30 32 36 +31 30 37 +37 30 38 +38 30 36 +39 38 36 +34 39 36 +40 34 33 +40 33 41 +34 40 39 +41 33 12 +42 41 12 +44 8 43 +8 44 11 +42 11 44 +11 42 12 +42 44 45 +46 42 45 +47 46 45 +42 46 41 +48 41 46 +41 48 49 +50 41 49 +41 50 51 +52 41 51 +54 52 53 +52 54 40 +41 52 40 +50 49 55 +51 50 55 +56 55 49 +57 56 49 +8 58 43 +58 8 6 +58 5 59 +5 58 6 +61 59 60 +59 61 58 +62 58 61 +58 62 43 +44 43 62 +45 44 62 +63 45 62 +47 63 64 +63 47 45 +61 63 62 +63 61 65 +48 57 49 +57 48 66 +67 66 48 +46 67 48 +47 68 67 +46 47 67 +69 47 64 +47 69 68 +64 70 69 +70 64 71 +73 71 72 +71 73 70 +74 73 72 +75 74 56 +75 56 57 +74 75 73 +76 61 60 +61 76 65 +64 65 77 +65 64 63 +77 65 76 +78 77 76 +77 78 71 +77 71 64 +79 71 78 +71 79 72 +74 72 79 +80 74 79 +74 80 81 +56 81 82 +81 56 74 +55 56 82 +84 80 83 +80 84 81 +85 81 84 +81 85 82 +55 82 85 +86 55 85 +55 86 87 +51 55 87 +88 51 87 +51 88 52 +52 88 89 +53 52 89 +90 53 89 +89 91 90 +88 91 89 +90 91 92 +95 93 94 +96 94 93 +94 96 97 +98 97 96 +99 98 96 +98 99 100 +92 98 100 +90 92 100 +101 90 100 +102 101 100 +99 102 100 +102 99 103 +96 103 99 +103 96 104 +93 104 96 +106 93 105 +93 106 104 +107 104 106 +104 107 103 +108 103 107 +103 108 102 +101 102 109 +109 102 108 +101 109 110 +111 101 110 +101 111 53 +90 101 53 +39 40 54 +112 39 54 +39 112 38 +113 38 112 +38 113 37 +114 113 112 +115 114 112 +114 115 116 +118 115 117 +115 118 116 +120 117 119 +117 120 118 +123 121 122 +124 123 122 +125 124 122 +124 125 126 +127 119 121 +119 127 120 +128 119 117 +115 128 117 +128 115 53 +111 128 53 +128 111 110 +119 128 110 +121 119 110 +129 121 110 +109 129 110 +129 109 130 +115 54 53 +54 115 112 +127 121 123 +132 105 131 +105 132 106 +132 131 133 +133 131 134 +135 133 134 +133 135 136 +137 133 136 +138 133 137 +133 138 132 +139 132 138 +140 139 138 +141 140 138 +140 141 130 +109 140 130 +140 109 108 +139 140 108 +107 139 108 +142 136 135 +136 142 143 +144 143 142 +143 144 145 +147 145 146 +145 147 143 +124 147 146 +147 124 126 +121 125 122 +125 121 129 +141 129 130 +129 141 125 +126 137 147 +141 126 125 +126 141 137 +138 137 141 +147 136 143 +136 147 137 +132 107 106 +107 132 139 +28 29 31 +148 25 27 +25 148 149 +28 148 27 +148 28 150 +151 148 150 +148 151 149 +153 152 149 +151 153 149 +154 151 150 +151 154 155 +156 155 154 +158 156 157 +156 158 155 +151 155 158 +153 151 158 +149 152 25 +25 152 23 +152 21 23 +21 152 159 +153 159 152 +159 153 160 +158 160 153 +160 158 161 +162 161 158 +157 162 158 +157 163 162 +163 157 164 +156 164 157 +164 156 165 +164 165 166 +167 164 166 +164 167 163 +168 163 167 +166 169 167 +170 167 169 +172 170 171 +170 172 173 +174 172 171 +172 174 175 +172 176 177 +176 172 175 +179 176 178 +176 179 177 +181 178 180 +178 181 179 +183 181 182 +181 183 179 +184 179 183 +179 184 177 +173 177 184 +177 173 172 +167 173 185 +173 167 170 +167 185 168 +163 168 162 +186 162 168 +161 186 187 +188 161 187 +161 188 160 +189 160 188 +160 189 159 +159 189 19 +21 159 19 +190 19 189 +191 190 189 +19 190 16 +15 19 16 +192 16 190 +16 192 17 +193 17 192 +17 193 18 +194 193 192 +193 194 195 +190 194 192 +194 190 191 +188 191 189 +191 188 196 +194 196 197 +196 194 191 +198 194 197 +194 198 195 +199 198 197 +198 199 200 +201 200 199 +200 201 202 +203 202 201 +202 203 204 +183 182 205 +205 182 206 +207 205 206 +205 207 208 +173 184 185 +185 184 208 +168 185 208 +209 168 208 +168 209 210 +186 168 210 +211 186 210 +186 211 187 +196 187 211 +187 196 188 +199 196 211 +196 199 197 +210 199 211 +199 210 201 +209 201 210 +201 209 203 +207 203 209 +208 207 209 +204 207 206 +207 204 203 +162 186 161 +183 205 184 +205 208 184 +0 2 14 +26 32 29 +213 26 212 +26 24 212 +212 22 214 +22 212 24 +214 213 212 +213 214 215 +22 216 214 +216 22 20 +214 217 215 +217 214 216 +218 217 216 +216 14 218 +14 216 20 +221 219 220 +219 222 220 +5 223 224 +223 5 4 +224 225 226 +225 224 223 +227 226 225 +227 228 226 +227 229 228 +227 220 229 +227 230 220 +227 225 230 +230 221 220 +230 231 221 +230 232 231 +233 230 225 +230 233 232 +233 223 234 +223 233 225 +234 4 18 +4 234 223 +232 235 231 +235 236 231 +236 235 237 +236 238 239 +238 236 237 +239 240 241 +240 239 238 +241 242 243 +242 241 240 +242 244 243 +243 244 245 +245 246 247 +247 248 245 +222 249 220 +249 229 220 +222 250 249 +250 222 251 +251 252 250 +252 251 248 +248 247 252 +247 246 253 +247 253 254 +247 254 252 +254 255 252 +255 250 252 +250 256 249 +249 256 257 +256 250 255 +249 257 229 +257 258 229 +260 228 259 +228 260 226 +259 229 258 +229 259 228 +259 258 261 +258 262 261 +262 263 261 +262 258 257 +257 264 262 +264 257 265 +257 266 265 +266 257 267 +257 268 267 +268 269 270 +269 268 256 +268 257 256 +265 266 271 +266 267 271 +271 272 265 +272 273 265 +260 224 226 +224 260 274 +59 224 274 +224 59 5 +60 274 275 +274 60 59 +275 260 276 +260 275 274 +260 259 276 +259 261 276 +261 277 276 +278 261 263 +261 278 277 +276 279 275 +279 276 277 +265 280 264 +280 265 273 +280 281 264 +281 262 264 +282 263 281 +263 262 281 +278 282 283 +282 278 263 +283 284 278 +284 283 285 +287 285 286 +285 287 284 +286 288 287 +288 289 272 +272 289 273 +289 288 286 +60 279 76 +279 60 275 +290 277 278 +277 290 279 +279 290 76 +76 284 78 +284 76 290 +284 290 278 +284 79 78 +79 284 287 +287 288 79 +79 291 80 +291 79 288 +292 288 272 +288 292 291 +272 271 292 +83 291 293 +291 83 80 +293 292 294 +292 293 291 +292 271 294 +271 295 294 +295 271 296 +271 267 296 +267 297 296 +297 267 268 +297 268 298 +268 270 298 +270 299 298 +300 298 299 +300 297 298 +300 299 301 +93 95 302 +302 303 93 +303 302 304 +304 305 303 +305 306 303 +306 305 307 +305 301 307 +301 299 307 +299 308 307 +308 309 307 +307 310 306 +310 307 309 +306 311 303 +311 306 310 +311 93 303 +105 311 312 +311 105 93 +312 310 313 +310 312 311 +313 309 314 +309 313 310 +309 308 315 +309 315 314 +315 308 316 +308 317 316 +317 308 270 +308 299 270 +256 255 269 +255 318 269 +318 255 254 +254 319 318 +319 254 253 +319 320 318 +320 321 318 +321 320 322 +324 322 323 +322 324 321 +326 323 325 +323 326 324 +329 327 328 +327 330 328 +330 331 328 +331 330 332 +326 333 329 +333 326 325 +326 334 324 +334 321 324 +321 334 270 +334 317 270 +317 334 316 +334 326 316 +326 329 316 +329 335 316 +316 336 315 +336 316 335 +269 321 270 +321 269 318 +329 333 327 +131 312 337 +312 131 105 +131 337 338 +131 338 134 +134 339 135 +339 134 338 +338 340 339 +338 341 340 +341 338 337 +337 342 341 +342 343 341 +343 344 341 +344 343 336 +343 315 336 +315 343 314 +343 342 314 +342 313 314 +135 345 142 +345 135 339 +142 346 144 +346 142 345 +348 345 347 +345 348 346 +348 332 330 +332 348 347 +328 335 329 +335 328 331 +336 331 344 +331 336 335 +340 332 347 +331 340 344 +340 331 332 +340 341 344 +345 340 347 +340 345 339 +312 342 337 +342 312 313 +245 244 246 +242 349 350 +349 242 240 +350 244 242 +244 350 351 +350 352 351 +352 350 349 +354 353 349 +353 352 349 +351 355 356 +355 351 352 +355 357 356 +359 355 358 +355 359 357 +355 352 358 +352 353 358 +354 349 240 +354 240 238 +238 360 354 +360 238 237 +354 361 353 +361 354 360 +353 362 358 +362 353 361 +362 363 358 +363 359 358 +363 364 359 +364 363 365 +359 366 357 +366 359 364 +366 364 367 +367 365 368 +365 367 364 +365 369 368 +370 367 368 +368 371 370 +374 372 373 +372 374 371 +374 375 376 +375 374 373 +377 375 373 +375 377 378 +380 377 379 +377 380 378 +180 379 181 +379 180 380 +182 379 381 +379 182 181 +381 377 382 +377 381 379 +382 373 372 +373 382 377 +383 371 368 +371 383 372 +383 368 369 +369 365 363 +363 384 369 +384 362 385 +385 361 386 +361 385 362 +386 360 387 +360 386 361 +387 360 235 +360 237 235 +235 388 387 +388 389 387 +388 235 233 +235 232 233 +233 390 388 +390 233 234 +234 193 390 +193 234 18 +390 195 391 +195 390 193 +390 389 388 +389 390 391 +387 392 386 +392 387 389 +393 389 391 +389 393 392 +393 195 198 +195 393 391 +393 200 394 +200 393 198 +394 202 395 +202 394 200 +395 204 396 +204 395 202 +182 381 397 +182 397 206 +397 398 206 +398 397 399 +382 372 383 +382 383 399 +383 369 399 +369 400 399 +400 369 401 +369 384 401 +401 385 402 +385 401 384 +402 386 392 +386 402 385 +402 393 394 +393 402 392 +394 401 402 +401 394 395 +401 396 400 +396 401 395 +396 398 400 +398 399 400 +206 396 204 +396 206 398 +384 363 362 +397 381 382 +399 397 382 +219 221 231 +248 243 245 +243 403 404 +241 243 404 +405 241 404 +241 405 239 +404 406 405 +406 404 403 +405 236 239 +236 405 407 +406 407 405 +407 406 408 +408 409 407 +231 407 409 +407 231 236 diff --git a/3D GFX/Helicopter/data2.dat b/3D GFX/Helicopter/data2.dat new file mode 100755 index 0000000..a6a3427 --- /dev/null +++ b/3D GFX/Helicopter/data2.dat @@ -0,0 +1,50 @@ +0 -10 -5 +0 -10 5 +-20 -10 -5 +-20 -10 5 +-20 0 -5 +-20 0 5 +0 10 -5 +0 10 5 +30 10 0 +10 0 -5 +10 0 5 +30 0 0 +40 10 0 +40 20 0 +-30 15 -3 +-30 15 3 +30 15 -3 +30 15 3 +999 999 999 +0 1 +2 3 +0 2 +1 3 +4 5 +2 4 +3 5 +4 0 +5 1 +6 7 +4 6 +5 7 +6 0 +7 1 +6 8 +7 8 +9 10 +6 9 +7 10 +0 9 +1 10 +9 11 +10 11 +11 12 +12 13 +13 8 +14 15 +16 17 +14 17 +15 16 +999 999 \ No newline at end of file diff --git a/3D GFX/Helicopter/demo, 1.png b/3D GFX/Helicopter/demo, 1.png new file mode 100644 index 0000000..2710913 Binary files /dev/null and b/3D GFX/Helicopter/demo, 1.png differ diff --git a/3D GFX/Helicopter/demo, 2.png b/3D GFX/Helicopter/demo, 2.png new file mode 100644 index 0000000..a01153d Binary files /dev/null and b/3D GFX/Helicopter/demo, 2.png differ diff --git a/3D GFX/Helicopter/demo, 3.png b/3D GFX/Helicopter/demo, 3.png new file mode 100644 index 0000000..f6989bc Binary files /dev/null and b/3D GFX/Helicopter/demo, 3.png differ diff --git a/3D GFX/Helicopter/demo, 4.png b/3D GFX/Helicopter/demo, 4.png new file mode 100644 index 0000000..2aa35b3 Binary files /dev/null and b/3D GFX/Helicopter/demo, 4.png differ diff --git a/3D GFX/Miscellaneous/!.bas b/3D GFX/Miscellaneous/!.bas new file mode 100644 index 0000000..5709555 --- /dev/null +++ b/3D GFX/Miscellaneous/!.bas @@ -0,0 +1,289 @@ +' 3D Wireframe Exclamation Mark. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Usage: +' Up, Down, Left, Right, w, z - rotate exclamation mark +' - slow down rotation +' q - quit program +' +' Changelog: +' ~2000 - Initial version + +DECLARE SUB LoadVertexAndLineData () +' Loads vertex and line data from DATA statements into arrays. +' It reads coordinates and line indices, and determines the count of vertices and lines. + +DECLARE SUB NormalizeCoordinates () +' Normalizes coordinates to fit the screen by scaling them. +' It finds the maximum absolute value among the coordinates and scales all coordinates accordingly. + +DECLARE SUB Render3DWireframe () +' Renders the 3D wireframe of an exclamation mark. +' It updates rotation angles, rotates and projects vertices, and draws lines between them. +' It also handles user input to control the rotation and exit the program. + +DECLARE SUB PrecomputeTrigonometricValues () +' Precomputes sine and cosine values for angles from 0 to 360 degrees. +' This allows for faster computation during the rendering process. + +DEFINT A-Z + +' Arrays to store vertex coordinates and projected coordinates +DIM SHARED vertexX(100), vertexY(100), vertexZ(100) +DIM SHARED startX(100), startY(100), endX(100), endY(100) +DIM SHARED x(100), y(100), z(100), lineStartIndex(100), lineEndIndex(100) + +' Arrays to store precomputed sine and cosine values +DIM SHARED cosineValue&(360), sineValue&(360) + +' Variables to store the number of vertices and lines, and rotation angles +DIM SHARED vertexCount, lineCount +DIM SHARED angleX, angleY + +' Initialize rotation angles +angleX = 0 +angleY = 0 + +' Set screen mode and clear the screen +SCREEN 12 +CLS + +' Precompute sine and cosine values for faster rendering +PrecomputeTrigonometricValues + +' Load vertex and line data from DATA statements +LoadVertexAndLineData + +' Normalize coordinates to fit the screen +NormalizeCoordinates + +' Render the 3D wireframe +Render3DWireframe + +' Vertex data +DATA 5,-60,-10 +DATA 15,-50,-10 +DATA 15,0,-10 +DATA 5,10,-10 +DATA -5,10,-10 +DATA -15,0,-10 +DATA -15,-50,-10 +DATA -5,-60,-10 +DATA 5,-60,10 +DATA 15,-50,10 +DATA 15,0,10 +DATA 5,10,10 +DATA -5,10,10 +DATA -15,0,10 +DATA -15,-50,10 +DATA -5,-60,10 +DATA 5,20,10 +DATA 15,30,10 +DATA 15,40,10 +DATA 5,50,10 +DATA -5,50,10 +DATA -15,40,10 +DATA -15,30,10 +DATA -5,20,10 +DATA 5,20,-10 +DATA 15,30,-10 +DATA 15,40,-10 +DATA 5,50,-10 +DATA -5,50,-10 +DATA -15,40,-10 +DATA -15,30,-10 +DATA -5,20,-10 +DATA 999,999,999 + +' Line data +DATA 0,1 +DATA 1,2 +DATA 2,3 +DATA 3,4 +DATA 4,5 +DATA 5,6 +DATA 6,7 +DATA 7,0 +DATA 8,9 +DATA 9,10 +DATA 10,11 +DATA 11,12 +DATA 12,13 +DATA 13,14 +DATA 14,15 +DATA 15,8 +DATA 0,8 +DATA 1,9 +DATA 2,10 +DATA 3,11 +DATA 4,12 +DATA 5,13 +DATA 6,14 +DATA 7,15 +DATA 16,17 +DATA 17,18 +DATA 18,19 +DATA 19,20 +DATA 20,21 +DATA 21,22 +DATA 22,23 +DATA 23,16 +DATA 24,25 +DATA 25,26 +DATA 26,27 +DATA 27,28 +DATA 28,29 +DATA 29,30 +DATA 30,31 +DATA 31,24 +DATA 24,16 +DATA 25,17 +DATA 26,18 +DATA 27,19 +DATA 28,20 +DATA 29,21 +DATA 30,22 +DATA 31,23 +DATA 999,999 + +SUB LoadVertexAndLineData + ' Load vertex coordinates from DATA statements into arrays x, y, and z. + ' The loop continues until a sentinel value (999) is encountered. + FOR i = 0 TO 10000 + READ x(i), y(i), z(i) + IF x(i) = 999 THEN x(i) = 0: y(i) = 0: z(i) = 0: GOTO EndVertexData + NEXT i + +EndVertexData: + vertexCount = i + + ' Load line data from DATA statements into arrays lineStartIndex and lineEndIndex. + ' The loop continues until a sentinel value (999) is encountered. + FOR i = 0 TO 10000 + READ lineStartIndex(i), lineEndIndex(i) + IF lineStartIndex(i) = 999 THEN GOTO EndLineData + NEXT i + +EndLineData: + lineCount = i +END SUB + +SUB NormalizeCoordinates + ' Normalize coordinates to fit the screen by scaling them. + ' First, find the maximum absolute value among the coordinates. + maxValue = 0 + FOR i = 0 TO vertexCount + IF ABS(x(i)) > maxValue THEN maxValue = ABS(x(i)) + IF ABS(y(i)) > maxValue THEN maxValue = ABS(y(i)) + IF ABS(z(i)) > maxValue THEN maxValue = ABS(z(i)) + NEXT i + + ' Scale all coordinates by a factor of 100 / maxValue to fit the screen. + scaleFactor = 100 / maxValue + FOR i = 0 TO vertexCount + x(i) = x(i) * scaleFactor + y(i) = y(i) * scaleFactor + z(i) = z(i) * scaleFactor + NEXT i +END SUB + +SUB PrecomputeTrigonometricValues + ' Precompute sine and cosine values for angles from 0 to 360 degrees. + ' This allows for faster computation during the rendering process. + FOR angle! = 0 TO 359 / 57.29577950999999# STEP 1 / 57.29577950999999# + cosineValue&(angle) = INT(.5 + COS(angle!) * 1024) + sineValue&(angle) = INT(.5 + SIN(angle!) * 1024) + angle = angle + 1 + NEXT angle! +END SUB + +SUB Render3DWireframe + DO + ' Update rotation angles based on user input + angleX = angleX + deltaX + angleY = angleY + deltaY + angleZ = angleZ + deltaZ + SOUND 0, 1 + + ' Ensure rotation angles stay within the range of 0 to 359 degrees + IF angleX <= 0 THEN angleX = angleX + 360 + IF angleY <= 0 THEN angleY = angleY + 360 + IF angleZ <= 0 THEN angleZ = angleZ + 360 + IF angleX >= 360 THEN angleX = angleX - 360 + IF angleY >= 360 THEN angleY = angleY - 360 + IF angleZ >= 360 THEN angleZ = angleZ - 360 + + ' Get precomputed sine and cosine values for the rotation angles + cosX& = cosineValue&(angleX): sinX& = sineValue&(angleX) + cosY& = cosineValue&(angleY): sinY& = sineValue&(angleY) + cosZ& = cosineValue&(angleZ): sinZ& = sineValue&(angleZ) + + ' Rotate and project vertices onto the 2D screen + FOR i = 0 TO vertexCount - 1 + originalX = x(i): originalY = y(i): originalZ = z(i) + rotatedX = (originalX * cosX& - originalY * sinX&) \ 1024 + rotatedY = (originalX * sinX& + originalY * cosX&) \ 1024 + tempX& = (rotatedX * cosY& - originalZ * sinY&) \ 1024 + tempZ = (rotatedX * sinY& + originalZ * cosY&) \ 1024 + tempY& = (rotatedY * cosZ& - tempZ * sinZ&) \ 1024 + finalZ = (rotatedY * sinZ& + tempZ * cosZ&) \ 1024 + + ' Adjust the Z-coordinate to add perspective + finalZ = finalZ + 300 + + ' Project the 3D coordinates onto the 2D screen + vertexX(i) = 320 + (tempX& / finalZ * 500) + vertexY(i) = 240 + (tempY& / finalZ * 500) + NEXT i + + ' Draw lines between the projected vertices + FOR i = 0 TO lineCount - 1 + startVertex = lineStartIndex(i) + endVertex = lineEndIndex(i) + startXCoord = vertexX(startVertex) + startYCoord = vertexY(startVertex) + endXCoord = vertexX(endVertex) + endYCoord = vertexY(endVertex) + + ' Erase the previous line + LINE (startX(i), startY(i))-(endX(i), endY(i)), 0 + + ' Draw the new line + LINE (endXCoord, endYCoord)-(startXCoord, startYCoord), 15 + + ' Store the current coordinates for the next iteration + startX(i) = endXCoord: startY(i) = endYCoord + endX(i) = startXCoord: endY(i) = startYCoord + NEXT i + + ' Handle user input to control the rotation + keyPressed$ = INKEY$ + IF keyPressed$ <> "" THEN + SELECT CASE keyPressed$ + CASE CHR$(0) + CHR$(72) ' Up arrow + deltaX = deltaX + 1 + CASE CHR$(0) + CHR$(80) ' Down arrow + deltaX = deltaX - 1 + CASE CHR$(0) + CHR$(75) ' Left arrow + deltaY = deltaY - 1 + CASE CHR$(0) + CHR$(77) ' Right arrow + deltaY = deltaY + 1 + CASE "w" + deltaZ = deltaZ - 1 + CASE "z" + deltaZ = deltaZ + 1 + CASE " " ' Space bar + deltaX = deltaX / 2 + deltaY = deltaY / 2 + deltaZ = deltaZ / 2 + CASE CHR$(27) ' Escape key + SYSTEM + END SELECT + END IF + LOOP +END SUB + diff --git a/3D GFX/Miscellaneous/!.webm b/3D GFX/Miscellaneous/!.webm new file mode 100644 index 0000000..1786991 Binary files /dev/null and b/3D GFX/Miscellaneous/!.webm differ diff --git a/3D GFX/Miscellaneous/3D ball.bas b/3D GFX/Miscellaneous/3D ball.bas new file mode 100755 index 0000000..dd3de01 --- /dev/null +++ b/3D GFX/Miscellaneous/3D ball.bas @@ -0,0 +1,183 @@ +' 3D animation of point-cloud ball bouncing around the screen +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 1999, Initial version. +' 2024 - 2025, Improved code readability. + +DECLARE SUB InitializeScene () +DECLARE SUB UpdateOrientation () +DECLARE SUB DisplayPoints (angle1 AS SINGLE, angle2 AS SINGLE, angle3 AS SINGLE) +RANDOMIZE TIMER +SCREEN 12 + +' Shared arrays to hold the positions of points in 3D space +DIM SHARED pointX(1 TO 1000) AS SINGLE +DIM SHARED pointY(1 TO 1000) AS SINGLE +DIM SHARED pointZ(1 TO 1000) AS SINGLE + +' Shared arrays to hold the previous on-screen positions of points +DIM SHARED prevX(1 TO 1000) AS INTEGER +DIM SHARED prevY(1 TO 1000) AS INTEGER + +' Shared variables for simulation control +DIM SHARED totalPoints AS INTEGER +DIM SHARED ballX +DIM SHARED ballY +DIM SHARED ballVelocityX +DIM SHARED ballVelocityY + +' Shared variables for rotation angles and their velocities +DIM SHARED rotationAngle1 +DIM SHARED rotationAngle2 +DIM SHARED rotationAngle3 +DIM SHARED angularVelocity1 +DIM SHARED angularVelocity2 +DIM SHARED angularVelocity3 + +' Initialize the total number of points to be displayed +totalPoints = 500 + +CALL InitializeScene + +' Initialization of rotation angles and ball position +rotationAngle1 = 0 +rotationAngle2 = 0 +rotationAngle3 = 0 + +' Main loop +DO + CALL DisplayPoints(rotationAngle1, rotationAngle2, rotationAngle3) + + ' Update the rotation angles based on their velocities + rotationAngle1 = rotationAngle1 + angularVelocity1 + rotationAngle2 = rotationAngle2 + angularVelocity2 + rotationAngle3 = rotationAngle3 + angularVelocity3 + + ' Add force of gravity + ballVelocityY = ballVelocityY + .1 + + ' Update the ball's position and velocity + ballY = ballY + ballVelocityY + ballX = ballX + ballVelocityX + + ' Check for ball bounce conditions + IF ballY > 160 THEN + ballVelocityY = -ballVelocityY + ballVelocityX = ballVelocityX + (RND * 2 - 1) + CALL UpdateOrientation + END IF + + IF ballX < -200 OR ballX > 200 THEN + ballVelocityX = -ballVelocityX + CALL UpdateOrientation + END IF + + ' Check for user input to exit the program + a$ = INKEY$ + IF a$ <> "" THEN + CLS + SYSTEM + END IF +LOOP + +' Subroutine to display the points on the screen +SUB DisplayPoints (angle1 AS SINGLE, angle2 AS SINGLE, angle3 AS SINGLE) + + ' Calculate the sine and cosine for rotation angles + s1 = SIN(angle1) + c1 = COS(angle1) + s2 = SIN(angle2) + c2 = COS(angle2) + s3 = SIN(angle3) + c3 = COS(angle3) + + ' For each point, apply rotation transformations and project to 2D + FOR a = 1 TO totalPoints + x = pointX(a) + y = pointY(a) + z = pointZ(a) + + x1 = x * s1 + y * c1 + y1 = x * c1 - y * s1 + + z1 = z * s2 + y1 * c2 + y2 = z * c2 - y1 * s2 + + z2 = z1 * s3 + x1 * c3 + x2 = z1 * c3 - x1 * s3 + + ' Perspective projection + z2 = z2 + 200 + + ' Convert to screen coordinates and apply ball offset + xScreen = x2 / z2 * 320 + 320 + ballX + yScreen = y2 / z2 * 300 + 240 + ballY + + ' Erase the previous point position and draw the new one + PSET (prevX(a), prevY(a)), 0 + PSET (xScreen, yScreen), 3 + + ' Update the previous on-screen positions + prevX(a) = xScreen + prevY(a) = yScreen + NEXT a +END SUB + +' Subroutine to initialize the 3D points and ball properties +SUB InitializeScene + PRINT "Calculating coordinates" + PRINT "Please wait....." + + ' Generate random 3D coordinates for each point + FOR a = 1 TO totalPoints + ang1 = RND * 100 + ang2 = RND * 100 + ang3 = RND * 100 + + s1 = SIN(ang1) + c1 = COS(ang1) + s2 = SIN(ang2) + c2 = COS(ang2) + s3 = SIN(ang3) + c3 = COS(ang3) + + ' Apply rotation transformations to the point + x = 50 + y = 0 + z = 0 + + x1 = x * s1 + y * c1 + y1 = x * c1 - y * s1 + + z1 = z * s2 + y1 * c2 + y2 = z * c2 - y1 * s2 + + z2 = z1 * s3 + x1 * c3 + x2 = z1 * c3 - x1 * s3 + + pointX(a) = x2 + pointY(a) = y2 + pointZ(a) = z2 + NEXT a + + ' Set the initial ball velocity + ballVelocityX = 2 + RND + ballY = -100 + + CALL UpdateOrientation + + CLS +END SUB + +' Subroutine to update the angular velocities for rotation +SUB UpdateOrientation + angularVelocity1 = (RND - .5) / 16 + angularVelocity2 = (RND - .5) / 16 + angularVelocity3 = (RND - .5) / 16 +END SUB + diff --git a/3D GFX/Miscellaneous/3D ball.webm b/3D GFX/Miscellaneous/3D ball.webm new file mode 100644 index 0000000..cd04bfc Binary files /dev/null and b/3D GFX/Miscellaneous/3D ball.webm differ diff --git a/3D GFX/Miscellaneous/3D text.bas b/3D GFX/Miscellaneous/3D text.bas new file mode 100755 index 0000000..17b52b8 --- /dev/null +++ b/3D GFX/Miscellaneous/3D text.bas @@ -0,0 +1,475 @@ +' Renders 3D text within 3D room. +' User can freely fly around the room and observe the text from different angles. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003, Initial version +' 2024 - 2025, Improved program readability +' +' Keyboard controls: +' cursor keys and to z, w - rotate +' - slow down +' q and - quit program +' + / - - move up / down + + +DECLARE SUB defineOctagon (x!, y!, z!, size!) +DECLARE SUB printText (x AS SINGLE, y AS SINGLE, text AS STRING) +DECLARE SUB renderCharacter (x AS SINGLE, y AS SINGLE, character AS STRING) +DECLARE SUB readFontData () +DECLARE SUB defineSquare (x AS SINGLE, y AS SINGLE, z AS SINGLE, size AS SINGLE) +DECLARE SUB defineRectangle (x AS SINGLE, y AS SINGLE, z AS SINGLE, size AS SINGLE) +DECLARE SUB createFloor () +DECLARE SUB addPoint (x AS INTEGER, y AS INTEGER, z AS INTEGER) +DECLARE SUB initializeProgram () +DECLARE SUB addSquare (x1 AS INTEGER, y1 AS INTEGER, z1 AS INTEGER) +DECLARE SUB defineCubeAndRectangle () +DECLARE SUB multiplyCoordinates () +DECLARE SUB render3DScene () +DECLARE SUB calculateSineCosine () + +DIM SHARED pointX(4000) AS SINGLE, pointY(4000) AS SINGLE, pointZ(4000) AS SINGLE +DIM SHARED x(4000) AS SINGLE, y(4000) AS SINGLE, z(4000) AS SINGLE +DIM SHARED oldPointX(4000) AS SINGLE, oldPointY(4000) AS SINGLE, oldPointZ(4000) AS SINGLE +DIM SHARED lineStart(4000) AS INTEGER, lineEnd(4000) AS INTEGER +DIM SHARED lineColor(4000) AS INTEGER +DIM SHARED numPoints AS INTEGER, numLines AS INTEGER +DIM SHARED userX AS SINGLE, userY AS SINGLE, userZ AS SINGLE, userSpeed AS SINGLE, userDirection AS SINGLE +DIM SHARED fontPointX(0 TO 10, 0 TO 255) AS SINGLE, fontPointY(0 TO 10, 0 TO 255) AS SINGLE +DIM SHARED fontLineStart(0 TO 10, 0 TO 255) AS INTEGER, fontLineEnd(0 TO 10, 0 TO 255) AS INTEGER + +userX = 0 +userY = 0 +userZ = -100 + +initializeProgram +render3DScene + +SUB createFloor +' Create the floor of the 3D room using hexagons and squares +FOR x = -100 TO 0 STEP 12.067 + .3 + FOR z = -100 TO 0 STEP 12.067 + .3 + defineOctagon x, -125, z, 6.53 + defineRectangle x + 6.033 + .15, -125, z + 6.033 + .15, 3.111 + .3 + NEXT z +NEXT x + +' Loop to create squares +FOR y = -100 TO 0 STEP 20.3 + FOR x = -100 TO 0 STEP 20.3 + defineSquare x, y, 200, 10 + NEXT x +NEXT y +END SUB + +SUB defineCubeAndRectangle +' Define the corners of a cube +pointX(numPoints + 1) = -150 +pointY(numPoints + 1) = -125 +pointZ(numPoints + 1) = -200 +pointX(numPoints + 2) = 150 +pointY(numPoints + 2) = -125 +pointZ(numPoints + 2) = -200 +pointX(numPoints + 3) = 150 +pointY(numPoints + 3) = 125 +pointZ(numPoints + 3) = -200 +pointX(numPoints + 4) = -150 +pointY(numPoints + 4) = 125 +pointZ(numPoints + 4) = -200 +pointX(numPoints + 5) = -150 +pointY(numPoints + 5) = -125 +pointZ(numPoints + 5) = 200 +pointX(numPoints + 6) = 150 +pointY(numPoints + 6) = -125 +pointZ(numPoints + 6) = 200 +pointX(numPoints + 7) = 150 +pointY(numPoints + 7) = 125 +pointZ(numPoints + 7) = 200 +pointX(numPoints + 8) = -150 +pointY(numPoints + 8) = 125 +pointZ(numPoints + 8) = 200 + +' Define the lines connecting the corners +lineStart(numLines + 1) = numPoints + 1 +lineEnd(numLines + 1) = numPoints + 2 +lineStart(numLines + 2) = numPoints + 2 +lineEnd(numLines + 2) = numPoints + 3 +lineStart(numLines + 3) = numPoints + 3 +lineEnd(numLines + 3) = numPoints + 4 +lineStart(numLines + 4) = numPoints + 4 +lineEnd(numLines + 4) = numPoints + 1 +lineStart(numLines + 5) = numPoints + 5 +lineEnd(numLines + 5) = numPoints + 6 +lineStart(numLines + 6) = numPoints + 6 +lineEnd(numLines + 6) = numPoints + 7 +lineStart(numLines + 7) = numPoints + 7 +lineEnd(numLines + 7) = numPoints + 8 +lineStart(numLines + 8) = numPoints + 8 +lineEnd(numLines + 8) = numPoints + 5 +lineStart(numLines + 9) = numPoints + 5 +lineEnd(numLines + 9) = numPoints + 1 +lineStart(numLines + 10) = numPoints + 6 +lineEnd(numLines + 10) = numPoints + 2 +lineStart(numLines + 11) = numPoints + 7 +lineEnd(numLines + 11) = numPoints + 3 +lineStart(numLines + 12) = numPoints + 8 +lineEnd(numLines + 12) = numPoints + 4 + +numPoints = numPoints + 8 +numLines = numLines + 12 + +' Define the corners of rectangle +pointX(numPoints + 1) = -150 +pointY(numPoints + 1) = -125 + 201 +pointZ(numPoints + 1) = 0 +pointX(numPoints + 2) = -150 +pointY(numPoints + 2) = -125 + 201 +pointZ(numPoints + 2) = 89 +pointX(numPoints + 3) = -150 +pointY(numPoints + 3) = -125 +pointZ(numPoints + 3) = 89 +pointX(numPoints + 4) = -150 +pointY(numPoints + 4) = -125 +pointZ(numPoints + 4) = 0 + +' Define the lines connecting these corners +lineStart(numLines + 1) = numPoints + 1 +lineEnd(numLines + 1) = numPoints + 2 +lineStart(numLines + 2) = numPoints + 2 +lineEnd(numLines + 2) = numPoints + 3 +lineStart(numLines + 3) = numPoints + 3 +lineEnd(numLines + 3) = numPoints + 4 +lineStart(numLines + 4) = numPoints + 4 +lineEnd(numLines + 4) = numPoints + 1 + +numPoints = numPoints + 4 +numLines = numLines + 4 + +printText 0, 0, "three dimensional " +printText 0, -3, "text example" +printText 0, -6, "etc etc etc" +END SUB + +SUB defineOctagon (x, y, z, size) +' Initialize variables +b = 0 +f = .3925 + +' Loop to create points of the octagon +FOR a = 0 + f TO 6 + f STEP 6.28 / 8 + x1 = SIN(a) * size + y1 = COS(a) * size + b = b + 1 + ' Store the points in the shared arrays + pointX(numPoints + b) = x1 + x + pointY(numPoints + b) = y + pointZ(numPoints + b) = y1 + z +NEXT a + +' Define the lines connecting these points +lineStart(numLines + 1) = numPoints + 1 +lineEnd(numLines + 1) = numPoints + 2 +lineColor(numLines + 1) = 12 +lineStart(numLines + 2) = numPoints + 2 +lineEnd(numLines + 2) = numPoints + 3 +lineColor(numLines + 2) = 12 +lineStart(numLines + 3) = numPoints + 3 +lineEnd(numLines + 3) = numPoints + 4 +lineColor(numLines + 3) = 12 +lineStart(numLines + 4) = numPoints + 4 +lineEnd(numLines + 4) = numPoints + 5 +lineColor(numLines + 4) = 12 +lineStart(numLines + 5) = numPoints + 5 +lineEnd(numLines + 5) = numPoints + 6 +lineColor(numLines + 5) = 12 +lineStart(numLines + 6) = numPoints + 6 +lineEnd(numLines + 6) = numPoints + 7 +lineColor(numLines + 6) = 12 +lineStart(numLines + 7) = numPoints + 7 +lineEnd(numLines + 7) = numPoints + 8 +lineColor(numLines + 7) = 12 +lineStart(numLines + 8) = numPoints + 8 +lineEnd(numLines + 8) = numPoints + 1 +lineColor(numLines + 8) = 12 + +numPoints = numPoints + b +numLines = numLines + 8 +END SUB + +SUB defineRectangle (x AS SINGLE, y AS SINGLE, z AS SINGLE, size AS SINGLE) +' Define the corners of the rectangle +pointX(numPoints + 1) = x +pointY(numPoints + 1) = y +pointZ(numPoints + 1) = z + size +pointX(numPoints + 2) = x + size +pointY(numPoints + 2) = y +pointZ(numPoints + 2) = z +pointX(numPoints + 3) = x +pointY(numPoints + 3) = y +pointZ(numPoints + 3) = z - size +pointX(numPoints + 4) = x - size +pointY(numPoints + 4) = y +pointZ(numPoints + 4) = z + +' Define the lines connecting these corners +lineStart(numLines + 1) = numPoints + 1 +lineEnd(numLines + 1) = numPoints + 2 +lineColor(numLines + 1) = 10 +lineStart(numLines + 2) = numPoints + 2 +lineEnd(numLines + 2) = numPoints + 3 +lineColor(numLines + 2) = 10 +lineStart(numLines + 3) = numPoints + 3 +lineEnd(numLines + 3) = numPoints + 4 +lineColor(numLines + 3) = 10 +lineStart(numLines + 4) = numPoints + 4 +lineEnd(numLines + 4) = numPoints + 1 +lineColor(numLines + 4) = 10 + +' Update the counters +numPoints = numPoints + 4 +numLines = numLines + 4 +END SUB + +SUB defineSquare (x AS SINGLE, y AS SINGLE, z AS SINGLE, size AS SINGLE) +' Define the corners of the square +pointX(numPoints + 1) = x - size +pointY(numPoints + 1) = y - size +pointZ(numPoints + 1) = z +pointX(numPoints + 2) = x + size +pointY(numPoints + 2) = y - size +pointZ(numPoints + 2) = z +pointX(numPoints + 3) = x + size +pointY(numPoints + 3) = y + size +pointZ(numPoints + 3) = z +pointX(numPoints + 4) = x - size +pointY(numPoints + 4) = y + size +pointZ(numPoints + 4) = z + +' Define the lines connecting these corners +lineStart(numLines + 1) = numPoints + 1 +lineEnd(numLines + 1) = numPoints + 2 +lineColor(numLines + 1) = 14 +lineStart(numLines + 2) = numPoints + 2 +lineEnd(numLines + 2) = numPoints + 3 +lineColor(numLines + 2) = 14 +lineStart(numLines + 3) = numPoints + 3 +lineEnd(numLines + 3) = numPoints + 4 +lineColor(numLines + 3) = 14 +lineStart(numLines + 4) = numPoints + 4 +lineEnd(numLines + 4) = numPoints + 1 +lineColor(numLines + 4) = 14 + +' Update the counters +numPoints = numPoints + 4 +numLines = numLines + 4 +END SUB + +SUB initializeProgram +' Initialize the screen and clear it +SCREEN 12 +CLS + +' Set the default color for all points +FOR a = 1 TO 4000 + lineColor(a) = 15 +NEXT a + +' Initialize counters +numPoints = 0 +numLines = 0 + +' Initialize font data +FOR a = 0 TO 255 + FOR b = 0 TO 10 + fontPointX(b, a) = 999 + fontPointY(b, a) = 999 + fontLineStart(b, a) = 999 + fontLineEnd(b, a) = 999 + NEXT b +NEXT a + +' Read the font data +readFontData + +' Define the corners of the cubes +defineCubeAndRectangle +END SUB + +SUB printText (x AS SINGLE, y AS SINGLE, text AS STRING) +' Loop to print each character +FOR b = 1 TO LEN(text) + c$ = RIGHT$(LEFT$(text, b), 1) + renderCharacter x + b * 3, y, c$ +NEXT b +END SUB + +SUB readFontData +' Open the font file +OPEN "font.dat" FOR INPUT AS #1 + +' Loop to read the font data +3 +IF EOF(1) <> 0 THEN GOTO 2 +LINE INPUT #1, a$ + +IF LEFT$(a$, 1) = "#" THEN + chr = ASC(RIGHT$(LEFT$(a$, 3), 1)) + ' Initialize counters + pp = 0 + lp = 0 +END IF + +' Read the points for the character +IF LEFT$(a$, 1) = "p" THEN + fontPointX(pp, chr) = VAL(RIGHT$(LEFT$(a$, 3), 1)) + fontPointY(pp, chr) = VAL(RIGHT$(LEFT$(a$, 5), 1)) + pp = pp + 1 +END IF + +' Read the lines for the character +IF LEFT$(a$, 1) = "l" THEN + fontLineStart(lp, chr) = VAL(RIGHT$(LEFT$(a$, 3), 1)) + fontLineEnd(lp, chr) = VAL(RIGHT$(LEFT$(a$, 5), 1)) + lp = lp + 1 +END IF + +GOTO 3 + +' Close the font file +2 +CLOSE #1 +END SUB + +SUB render3DScene +' Main loop for the 3D rendering +1 +userX = userX + SIN(rotationAngleX) * userSpeed +userZ = userZ + COS(rotationAngleX) * userSpeed +userX = userX + COS(rotationAngleX) * userDirection +userZ = userZ - SIN(rotationAngleX) * userDirection +rotationAngleX = rotationAngleX + angleIncrementX +rotationAngleY = rotationAngleY + angleIncrementY +cosAngleX = COS(rotationAngleX): sinAngleX = SIN(rotationAngleX) +cosAngleY = COS(rotationAngleY): sinAngleY = SIN(rotationAngleY) + +' Transform the coordinates +FOR a = 1 TO numPoints + oldPointX(a) = pointX(a) - userX + oldPointY(a) = -pointY(a) - userY + oldPointZ(a) = pointZ(a) - userZ + x1 = (oldPointX(a) * cosAngleX - oldPointZ(a) * sinAngleX) + z1 = (oldPointX(a) * sinAngleX + oldPointZ(a) * cosAngleX) + y1 = (oldPointY(a) * cosAngleY - z1 * sinAngleY) + z2 = (oldPointY(a) * sinAngleY + z1 * cosAngleY) + + ' Store the transformed coordinates + oldPointX(a) = x(a) + oldPointY(a) = y(a) + + ' Check if the point is within the view + IF z2 < 20 THEN + x(a) = -1 + ELSE + ' Apply perspective transformation + x(a) = 320 + (x1 / z2 * 500) + y(a) = 240 + (y1 / z2 * 500) + END IF +NEXT + +' Draw the lines +FOR a = 1 TO numLines + p1 = lineStart(a) + p2 = lineEnd(a) + + ' Check if the points are within the view + IF oldPointX(p1) = -1 OR oldPointX(p2) = -1 THEN + ' Do nothing + ELSE + ' Erase line at old coordinates + LINE (oldPointX(p1), oldPointY(p1))-(oldPointX(p2), oldPointY(p2)), 0 + END IF + + IF x(p1) = -1 OR x(p2) = -1 THEN + ' Do nothing + ELSE + ' Draw line at new coordinates + LINE (x(p1), y(p1))-(x(p2), y(p2)), lineColor(a) + END IF +NEXT + +' Handle user input +userInput$ = INKEY$ + +IF userInput$ <> "" THEN + SELECT CASE userInput$ + CASE CHR$(0) + "P" + userSpeed = userSpeed - 1 + CASE CHR$(0) + "H" + userSpeed = userSpeed + 1 + CASE CHR$(0) + "M" + userDirection = userDirection + 1 + CASE CHR$(0) + "K" + userDirection = userDirection - 1 + CASE "+" + userY = userY + 3 + CASE "-" + userY = userY - 3 + CASE "6" + angleIncrementX = angleIncrementX + .01 + CASE "4" + angleIncrementX = angleIncrementX - .01 + CASE "8" + angleIncrementY = angleIncrementY - .01 + CASE "2" + angleIncrementY = angleIncrementY + .01 + CASE " " + angleIncrementX = angleIncrementX / 2 + angleIncrementY = angleIncrementY / 2 + angleIncrementZ = angleIncrementZ / 2 + userSpeed = userSpeed / 2 + userDirection = userDirection / 2 + CASE "q" + SYSTEM + CASE CHR$(27) + SYSTEM + END SELECT +END IF + +GOTO 1 +END SUB + +SUB renderCharacter (x AS SINGLE, y AS SINGLE, character AS STRING) +' Initialize variables +b = ASC(character) +up = 0 +ul = 0 + +' Loop to create points for the character +FOR c = 0 TO 100 + IF fontPointX(c, b) = 999 THEN GOTO 4 + up = up + 1 + pointX(numPoints + up) = x + fontPointX(c, b) + pointY(numPoints + up) = y - fontPointY(c, b) + pointZ(numPoints + up) = 0 +NEXT c + +4 +' Loop to define the lines for the character +FOR c = 0 TO 100 + IF fontLineStart(c, b) = 999 THEN GOTO 5 + ul = ul + 1 + lineStart(numLines + ul) = fontLineStart(c, b) + numPoints + 1 + lineEnd(numLines + ul) = fontLineEnd(c, b) + numPoints + 1 + lineColor(numLines + ul) = 4 +NEXT c + +5 +' Update the counters +numPoints = numPoints + up +numLines = numLines + ul +END SUB + diff --git a/3D GFX/Miscellaneous/3D text.webm b/3D GFX/Miscellaneous/3D text.webm new file mode 100644 index 0000000..0846d14 Binary files /dev/null and b/3D GFX/Miscellaneous/3D text.webm differ diff --git a/3D GFX/Miscellaneous/Bouncing cubes.bas b/3D GFX/Miscellaneous/Bouncing cubes.bas new file mode 100755 index 0000000..e87c62d --- /dev/null +++ b/3D GFX/Miscellaneous/Bouncing cubes.bas @@ -0,0 +1,351 @@ +' Program to render flying and bouncing cubes on top of a grid-like floor +' +' By Svjatoslav Agejenko +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2001, Initial version +' 2024 - 2025, Improved program readability +' +' Navigation controls: +' Arrow keys - Move forward/backward/left/right +' 2,6,4,8 - Look around (up/down/left/right) +' - - Fly upward +' + - Fly downward + + +DECLARE SUB updateColliders() +DECLARE SUB initializeColliders() +DECLARE SUB renderScene() +DECLARE SUB initializeEnvironment() +DECLARE SUB initializeProgram() + +DIM SHARED initialNumPoints, initialNumLines, numPoints, numLines +DIM SHARED pointXCoord(1 TO 1000) AS SINGLE +DIM SHARED pointYCoord(1 TO 1000) AS SINGLE +DIM SHARED pointZCoord(1 TO 1000) AS SINGLE +DIM SHARED renderedXCoord(1 TO 1000) AS SINGLE +DIM SHARED renderedYCoord(1 TO 1000) AS SINGLE +DIM SHARED prevRenderedXCoord(1 TO 1000) AS SINGLE +DIM SHARED prevRenderedYCoord(1 TO 1000) AS SINGLE +DIM SHARED lineStart(1 TO 1000) AS INTEGER +DIM SHARED lineEnd(1 TO 1000) AS INTEGER +DIM SHARED lineColor(1 TO 1000) AS INTEGER +DIM SHARED prevLineStart(1 TO 1000) AS INTEGER +DIM SHARED prevLineEnd(1 TO 1000) AS INTEGER +DIM SHARED prevLineCount AS INTEGER +DIM SHARED cameraXPos AS SINGLE, cameraXSpeed AS SINGLE +DIM SHARED cameraYPos AS SINGLE, cameraYSpeed AS SINGLE +DIM SHARED cameraZPos AS SINGLE, cameraZSpeed AS SINGLE +DIM SHARED cameraAngleX AS SINGLE, cameraAngleXSpeed AS SINGLE +DIM SHARED cameraAngleY AS SINGLE, cameraAngleYSpeed AS SINGLE +DIM SHARED cubeXPos(1 TO 10) AS SINGLE +DIM SHARED cubeYPos(1 TO 10) AS SINGLE +DIM SHARED cubeZPos(1 TO 10) AS SINGLE +DIM SHARED cubeXSpeed(1 TO 10) AS SINGLE +DIM SHARED cubeYSpeed(1 TO 10) AS SINGLE +DIM SHARED cubeZSpeed(1 TO 10) AS SINGLE +DIM SHARED numCubes AS INTEGER + +ON ERROR GOTO ErrorHandler + +initializeProgram +initializeEnvironment +initializeColliders + +' The main loop of the program +MainLoop: +numPoints = initialNumPoints +numLines = initialNumLines + +updateColliders +renderScene + +' Update positions and angles +cameraXPos = cameraXPos + cameraXSpeed +cameraYPos = cameraYPos + cameraYSpeed +cameraZPos = cameraZPos + cameraZSpeed +cameraAngleX = cameraAngleX + cameraAngleXSpeed +cameraAngleY = cameraAngleY + cameraAngleYSpeed + +userInput$ = INKEY$ +IF userInput$ <> "" THEN + ' Handle arrow keys for movement + IF userInput$ = CHR$(0) + "H" THEN + cameraZSpeed = cameraZSpeed - SIN(cameraAngleX) / 100 + cameraXSpeed = cameraXSpeed - COS(cameraAngleX) / 100 + END IF + IF userInput$ = CHR$(0) + "P" THEN + cameraZSpeed = cameraZSpeed + SIN(cameraAngleX) / 100 + cameraXSpeed = cameraXSpeed + COS(cameraAngleX) / 100 + END IF + IF userInput$ = CHR$(0) + "M" THEN + cameraZSpeed = cameraZSpeed + COS(cameraAngleX) / 100 + cameraXSpeed = cameraXSpeed - SIN(cameraAngleX) / 100 + END IF + IF userInput$ = CHR$(0) + "K" THEN + cameraZSpeed = cameraZSpeed - COS(cameraAngleX) / 100 + cameraXSpeed = cameraXSpeed + SIN(cameraAngleX) / 100 + END IF + ' Handle number keys for looking around + IF userInput$ = "6" THEN cameraAngleXSpeed = cameraAngleXSpeed - 0.01 + IF userInput$ = "4" THEN cameraAngleXSpeed = cameraAngleXSpeed + 0.01 + IF userInput$ = "8" THEN cameraAngleYSpeed = cameraAngleYSpeed - 0.01 + IF userInput$ = "2" THEN cameraAngleYSpeed = cameraAngleYSpeed + 0.01 + ' Handle plus and minus keys for flying up and down + IF userInput$ = "+" THEN cameraYSpeed = cameraYSpeed - 0.01 + IF userInput$ = "-" THEN cameraYSpeed = cameraYSpeed + 0.01 + ' Exit the program on pressing ESC + IF userInput$ = CHR$(27) THEN SYSTEM +END IF + +GOTO MainLoop + +ErrorHandler: +END +RESUME + +SUB initializeEnvironment +' This subroutine initializes environment points +FOR z = -5 TO 5 + FOR x = -5 TO 5 + numPoints = numPoints + 1 + pointXCoord(numPoints) = x + pointYCoord(numPoints) = 0 + pointZCoord(numPoints) = z + ' Add lines between points + IF x > -5 THEN + numLines = numLines + 1 + lineStart(numLines) = numPoints + lineEnd(numLines) = numPoints - 1 + lineColor(numLines) = 3 + END IF + IF z > -5 THEN + numLines = numLines + 1 + lineStart(numLines) = numPoints + lineEnd(numLines) = numPoints - 11 + lineColor(numLines) = 3 + END IF + NEXT x +NEXT z +' Store the number of points and lines +initialNumPoints = numPoints +initialNumLines = numLines +END SUB + +SUB updateColliders +' This subroutine updates the positions and angles of colliders +FOR a = 1 TO numCubes + x = cubeXPos(a) + y = cubeYPos(a) + z = cubeZPos(a) + xs = cubeXSpeed(a) + ys = cubeYSpeed(a) + zs = cubeZSpeed(a) + ' Update the Y-axis position + ys = ys - 0.01 + ' Update the X and Z positions + x = x + xs + y = y + ys + z = z + zs + ' Bounce off walls + IF x > 5 THEN xs = -0.1 + IF z > 5 THEN zs = -0.1 + IF x < -5 THEN xs = 0.1 + IF z < -5 THEN zs = 0.1 + ' Reset Y position if it falls below a threshold + IF y < 0.5 THEN ys = RND * 0.2 + 0.1 + ' Create lines for visualization + numLines = numLines + 1 + lineStart(numLines) = numPoints + 1 + lineEnd(numLines) = numPoints + 2 + lineColor(numLines) = 14 + numLines = numLines + 1 + lineStart(numLines) = numPoints + 3 + lineEnd(numLines) = numPoints + 2 + lineColor(numLines) = 14 + numLines = numLines + 1 + lineStart(numLines) = numPoints + 3 + lineEnd(numLines) = numPoints + 4 + lineColor(numLines) = 14 + numLines = numLines + 1 + lineStart(numLines) = numPoints + 1 + lineEnd(numLines) = numPoints + 4 + lineColor(numLines) = 14 + numLines = numLines + 1 + lineStart(numLines) = numPoints + 1 + lineEnd(numLines) = numPoints + 5 + lineColor(numLines) = 14 + numLines = numLines + 1 + lineStart(numLines) = numPoints + 2 + lineEnd(numLines) = numPoints + 6 + lineColor(numLines) = 14 + numLines = numLines + 1 + lineStart(numLines) = numPoints + 3 + lineEnd(numLines) = numPoints + 7 + lineColor(numLines) = 14 + numLines = numLines + 1 + lineStart(numLines) = numPoints + 4 + lineEnd(numLines) = numPoints + 8 + lineColor(numLines) = 14 + numLines = numLines + 1 + lineStart(numLines) = numPoints + 5 + lineEnd(numLines) = numPoints + 6 + lineColor(numLines) = 14 + numLines = numLines + 1 + lineStart(numLines) = numPoints + 7 + lineEnd(numLines) = numPoints + 6 + lineColor(numLines) = 14 + numLines = numLines + 1 + lineStart(numLines) = numPoints + 7 + lineEnd(numLines) = numPoints + 8 + lineColor(numLines) = 14 + numLines = numLines + 1 + lineStart(numLines) = numPoints + 5 + lineEnd(numLines) = numPoints + 8 + lineColor(numLines) = 14 + ' Update the array with new positions and speeds + numPoints = numPoints + 1 + pointXCoord(numPoints) = x - 0.5 + pointYCoord(numPoints) = y - 0.5 + pointZCoord(numPoints) = z - 0.5 + numPoints = numPoints + 1 + pointXCoord(numPoints) = x + 0.5 + pointYCoord(numPoints) = y - 0.5 + pointZCoord(numPoints) = z - 0.5 + numPoints = numPoints + 1 + pointXCoord(numPoints) = x + 0.5 + pointYCoord(numPoints) = y + 0.5 + pointZCoord(numPoints) = z - 0.5 + numPoints = numPoints + 1 + pointXCoord(numPoints) = x - 0.5 + pointYCoord(numPoints) = y + 0.5 + pointZCoord(numPoints) = z - 0.5 + numPoints = numPoints + 1 + pointXCoord(numPoints) = x - 0.5 + pointYCoord(numPoints) = y - 0.5 + pointZCoord(numPoints) = z + 0.5 + numPoints = numPoints + 1 + pointXCoord(numPoints) = x + 0.5 + pointYCoord(numPoints) = y - 0.5 + pointZCoord(numPoints) = z + 0.5 + numPoints = numPoints + 1 + pointXCoord(numPoints) = x + 0.5 + pointYCoord(numPoints) = y + 0.5 + pointZCoord(numPoints) = z + 0.5 + numPoints = numPoints + 1 + pointXCoord(numPoints) = x - 0.5 + pointYCoord(numPoints) = y + 0.5 + pointZCoord(numPoints) = z + 0.5 + ' Update the collider array with new positions and speeds + cubeXPos(a) = x + cubeYPos(a) = y + cubeZPos(a) = z + cubeXSpeed(a) = xs + cubeYSpeed(a) = ys + cubeZSpeed(a) = zs +NEXT a +END SUB + +SUB initializeColliders +' This subroutine initializes colliders with random positions and speeds +FOR a = 1 TO numCubes + cubeXPos(a) = RND * 10 - 5 + cubeYPos(a) = 2 + cubeZPos(a) = RND * 10 - 5 + cubeXSpeed(a) = RND * 0.5 - 0.25 + cubeYSpeed(a) = RND * 0.5 + 0.1 + cubeZSpeed(a) = RND * 0.5 - 0.25 +NEXT a +END SUB + +SUB renderScene +' Calculate sine and cosine for angle rotation +s1 = SIN(cameraAngleX) +c1 = COS(cameraAngleX) +s2 = SIN(cameraAngleY) +c2 = COS(cameraAngleY) +' Loop through all points to render them +FOR a = 1 TO numPoints + x = pointXCoord(a) + cameraXPos + y = pointYCoord(a) - cameraYPos + z = pointZCoord(a) + cameraZPos + ' Rotate the point + x1 = x * s1 - z * c1 + z1 = x * c1 + z * s1 + y1 = y * s2 - z1 * c2 + z2 = y * c2 + z1 * s2 + ' Project the 3D point to a 2D screen coordinate + IF z2 < 0.1 THEN + renderedXCoord(a) = -1 + ELSE + renderedXCoord(a) = 320 + (x1 / z2 * 400) + renderedYCoord(a) = 240 - (y1 / z2 * 400) + END IF +NEXT a +' Render all lines +FOR a = 1 TO numLines + l1 = prevLineStart(a) + l2 = prevLineEnd(a) + ' Skip rendering if either end of the line is out of view + IF prevRenderedXCoord(l1) = -1 OR prevRenderedXCoord(l2) = -1 THEN + ELSE + LINE (prevRenderedXCoord(l1), prevRenderedYCoord(l1))-(prevRenderedXCoord(l2), prevRenderedYCoord(l2)), 0 + END IF + ' Update line indices for next frame + l1 = lineStart(a) + l2 = lineEnd(a) + ' Skip rendering if either end of the line is out of view + IF renderedXCoord(l1) = -1 OR renderedXCoord(l2) = -1 THEN + ELSE + LINE (renderedXCoord(l1), renderedYCoord(l1))-(renderedXCoord(l2), renderedYCoord(l2)), lineColor(a) + END IF +NEXT +' Handle lines that were added during the frame +IF numLines < prevLineCount THEN + FOR a = numLines + 1 TO prevLineCount + l1 = prevLineStart(a) + l2 = prevLineEnd(a) + ' Skip rendering if either end of the line is out of view + IF prevRenderedXCoord(l1) = -1 OR prevRenderedXCoord(l2) = -1 THEN + ELSE + LINE (prevRenderedXCoord(l1), prevRenderedYCoord(l1))-(prevRenderedXCoord(l2), prevRenderedYCoord(l2)), 0 + END IF + NEXT +END IF +' Save the current frame's points and lines for next frame +FOR a = 1 TO numPoints + prevRenderedXCoord(a) = renderedXCoord(a) + prevRenderedYCoord(a) = renderedYCoord(a) +NEXT a +FOR a = 1 TO numLines + prevLineStart(a) = lineStart(a) + prevLineEnd(a) = lineEnd(a) +NEXT a +prevLineCount = numLines +END SUB + +SUB initializeProgram +' Initialize the screen and variables +SCREEN 12 +initialNumPoints = 0 +initialNumLines = 0 +numPoints = initialNumPoints +numLines = initialNumLines +numCubes = 9 +cameraXPos = 0 +cameraYPos = 4 +cameraZPos = 7 +cameraAngleX = 3.14 / 2 +cameraAngleY = cameraAngleX + 0.6 +' Initialize all lines to have a thickness of 4 +FOR a = 1 TO 1000 + lineColor(a) = 4 +NEXT a +' Store the initial state of all lines +FOR a = 1 TO 1000 + prevLineStart(a) = 1 + prevLineEnd(a) = 1 +NEXT a +END SUB diff --git a/3D GFX/Miscellaneous/Bouncing cubes.webm b/3D GFX/Miscellaneous/Bouncing cubes.webm new file mode 100644 index 0000000..2328295 Binary files /dev/null and b/3D GFX/Miscellaneous/Bouncing cubes.webm differ diff --git a/3D GFX/Miscellaneous/Matrix math.bas b/3D GFX/Miscellaneous/Matrix math.bas new file mode 100755 index 0000000..431b7e3 --- /dev/null +++ b/3D GFX/Miscellaneous/Matrix math.bas @@ -0,0 +1,75 @@ +' Program to demonstrate 3x3 matrix math for coordinate rotation in 3D space. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.03, Initial version +' 2024.08, Improved program readability + +' Use keys: +' 7 9 - change alpha angle +' 4 6 - change beta angle +' 1 3 - change gamma angle +' ESC - quit program + +DECLARE SUB graphicalCoordinates (xVal AS Single, yVal AS Single, zVal AS Single, x1Val AS Single, y1Val AS Single) +DECLARE SUB setAngles (alphaVal AS Single, betaVal AS Single, gammaVal AS Single) +DIM SHARED matrixX1 AS Single, matrixY1 AS Single, matrixZ1 AS Single +DIM SHARED matrixX2 AS Single, matrixY2 AS Single, matrixZ2 AS Single +DIM SHARED matrixX3 AS Single, matrixY3 AS Single, matrixZ3 AS Single + +SCREEN 7, , , 1 + +' Main loop starts here +DO + CALL setAngles(angleAlpha, angleBeta, angleGamma) + + FOR y = -70 TO 70 STEP 5 + FOR x = -70 TO 70 STEP 5 + CALL graphicalCoordinates(x, y, SIN((ABS(x) + ABS(y)) / 30) * 30, x1Val, y1Val) + PSET (x1Val, y1Val), 15 + NEXT x + NEXT y + PCOPY 0, 1 + CLS + inputChar$ = INPUT$(1) + + ' Adjust rotation angles based on user input + IF inputChar$ = "7" THEN angleAlpha = angleAlpha + 0.1 + IF inputChar$ = "9" THEN angleAlpha = angleAlpha - 0.1 + IF inputChar$ = "4" THEN angleBeta = angleBeta + 0.1 + IF inputChar$ = "6" THEN angleBeta = angleBeta - 0.1 + IF inputChar$ = "1" THEN angleGamma = angleGamma + 0.1 + IF inputChar$ = "3" THEN angleGamma = angleGamma - 0.1 + IF inputChar$ = CHR$(27) THEN SYSTEM ' Exit program if ESC key is pressed +LOOP + +SUB graphicalCoordinates (xVal AS Single, yVal AS Single, zVal AS Single, x1Val AS Single, y1Val AS Single) + ' Perform matrix transformation to rotate coordinates + rxVal = xVal * matrixX1 + yVal * matrixY1 + zVal * matrixZ1 + ryVal = xVal * matrixX2 + yVal * matrixY2 + zVal * matrixZ2 + rzVal = xVal * matrixX3 + yVal * matrixY3 + zVal * matrixZ3 + + ' Apply perspective calculation to give the illusion of depth + rzVal = rzVal + 100 + x1Val = rxVal / rzVal * 120 + 160 + y1Val = ryVal / rzVal * 120 + 100 +END SUB + +SUB setAngles (alphaVal AS Single, betaVal AS Single, gammaVal AS Single) + ' Calculate the elements of the rotation matrix based on the angles + matrixX1 = SIN(gammaVal) * SIN(betaVal) * SIN(alphaVal) + COS(gammaVal) * COS(alphaVal) + matrixY1 = COS(betaVal) * SIN(alphaVal) + matrixZ1 = SIN(gammaVal) * COS(alphaVal) - COS(gammaVal) * SIN(betaVal) * SIN(alphaVal) + + matrixX2 = SIN(gammaVal) * SIN(betaVal) * COS(alphaVal) - COS(gammaVal) * SIN(alphaVal) + matrixY2 = COS(betaVal) * COS(alphaVal) + matrixZ2 = -COS(gammaVal) * SIN(betaVal) * COS(alphaVal) - SIN(gammaVal) * SIN(alphaVal) + + matrixX3 = -SIN(gammaVal) * COS(betaVal) + matrixY3 = SIN(betaVal) + matrixZ3 = COS(gammaVal) * COS(betaVal) +END SUB \ No newline at end of file diff --git a/3D GFX/Miscellaneous/Matrix math.webm b/3D GFX/Miscellaneous/Matrix math.webm new file mode 100644 index 0000000..5e6ea9a Binary files /dev/null and b/3D GFX/Miscellaneous/Matrix math.webm differ diff --git a/3D GFX/Miscellaneous/Maze explorer.bas b/3D GFX/Miscellaneous/Maze explorer.bas new file mode 100755 index 0000000..f733f57 --- /dev/null +++ b/3D GFX/Miscellaneous/Maze explorer.bas @@ -0,0 +1,293 @@ +' Evolving 3D Maze explorer. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2003.12, Initial version +' 2024 - 2025, Improved program readability +' +' Navigation: +' WASD - move around +' Drag mouse - look around +' Press left and right mouse buttons simultaneously while dragging mouse - move in X and Z axis +' Press right mouse button while dragging mouse - move in Y axis +' +' Press 'q' to quit the program + +DECLARE SUB verifyTsrIsLoaded () +DECLARE SUB startText () +DECLARE SUB handleInput () +DECLARE SUB putByte (addr!, dat!) +DECLARE SUB putWord (addr!, dat!) +DECLARE FUNCTION getWord! (addr!) +DECLARE FUNCTION getByte! (addr!) +DECLARE SUB initializeProgram () +DECLARE SUB render3DScene () + +DIM SHARED pointX(1 TO 500) +DIM SHARED pointY(1 TO 500) +DIM SHARED pointZ(1 TO 500) +DIM SHARED renderedPointX(1 TO 500) +DIM SHARED renderedPointY(1 TO 500) +DIM SHARED renderedPointEnabled(1 TO 500) + +DIM SHARED lineStart(1 TO 500) +DIM SHARED lineEnd(1 TO 500) +DIM SHARED lineColor(1 TO 500) + +DIM SHARED lineCount, pointCount + +DIM SHARED angleY, angleX, angleZ + +DIM SHARED frameTime + +DIM SHARED extensionSegment, extensionAddress + +DIM SHARED cameraX, cameraY, cameraZ +DIM SHARED cameraXSpeed, cameraYSpeed, cameraZSpeed +DIM SHARED leftMouseButton, rightMouseButton +DIM SHARED maxMove + +lineCount = 0 +pointCount = 0 + +initializeProgram + +' Initialize position variables +currentX = 0 +currentY = 0 +currentZ = 0 + +pointCount = 1 +pointX(pointCount) = currentX +pointY(pointCount) = currentY +pointZ(pointCount) = currentZ + +1 + +IF pointCount < 500 THEN + + ' Increase the number of points and add a new point at the current position + pointCount = pointCount + 1 + pointX(pointCount) = currentX + pointY(pointCount) = currentY + pointZ(pointCount) = currentZ + + ' Increase the number of lines and define a line between the new point and the previous one + lineCount = lineCount + 1 + lineStart(lineCount) = pointCount + lineEnd(lineCount) = pointCount - 1 + lineColor(lineCount) = INT(RND * 15) + 1 + + ' Randomly choose orientation for the next move + SELECT CASE INT(RND * 3) + CASE 0 + currentX = RND * 500 - 250 + CASE 1 + currentY = RND * 100 - 50 + CASE 2 + currentZ = RND * 500 - 250 + END SELECT +END IF + +handleInput +render3DScene + +' Copy the current screen to page 1 and clear the screen +PCOPY 0, 1 +CLS +GOTO 1 + +SUB render3DScene + +' Calculate sine and cosine for Y-axis rotation +sinY = SIN(angleY) +cosY = COS(angleY) + +' Calculate sine and cosine for X-axis rotation +sinX = SIN(angleX) +cosX = COS(angleX) + +' Calculate sine and cosine for Z-axis rotation (not used in current code) +sinZ = SIN(angleZ) +cosZ = COS(angleZ) + +' Project 3D points to 2D screen coordinates +FOR a = 1 TO pointCount + deltaX = pointX(a) - cameraX + deltaY = pointY(a) - cameraY + deltaZ = pointZ(a) - cameraZ + + ' Rotate around Y axis + rotatedX = deltaX * cosY + deltaZ * sinY + rotatedZ = deltaZ * cosY - deltaX * sinY + + ' Rotate around X axis + rotatedY = deltaY * cosX + rotatedZ * sinX + finalZ = rotatedZ * cosX - deltaY * sinX + + ' Check if the point is in front of the camera (finalZ > 3) + IF finalZ > 3 THEN + renderedPointEnabled(a) = 1 + renderedPointX(a) = rotatedX / finalZ * 130 + 160 + renderedPointY(a) = rotatedY / finalZ * 130 + 100 + ELSE + renderedPointEnabled(a) = 0 + END IF +NEXT a + +' Draw lines between visible points +FOR a = 1 TO lineCount + + p1 = lineStart(a) + p2 = lineEnd(a) + IF (renderedPointEnabled(p1) = 1) AND (renderedPointEnabled(p2) = 1) THEN + LINE (renderedPointX(p1), renderedPointY(p1))-(renderedPointX(p2), renderedPointY(p2)), lineColor(a) + END IF + +NEXT a + +END SUB + +SUB handleInput + +' Read mouse data +IF getByte(8) <> 0 THEN + putByte 8, 0 + ' Read mouse translation along x axis + mouseXDelta = getWord(2) + putWord 2, 0 + ' Read mouse translation along y axis + mouseYDelta = getWord(4) + putWord 4, 0 + ' Read pressed mouse buttons + button = getWord(6) + putWord 6, 0 + + ' Detect if left, right or both mouse buttons were pressed + leftMouseButton = 0 + rightMouseButton = 0 + IF button = 1 THEN leftMouseButton = 1 + IF button = 2 THEN rightMouseButton = 1 + IF button = 3 THEN leftMouseButton = 1: rightMouseButton = 1 + + IF rightMouseButton = 1 THEN + IF leftMouseButton = 1 THEN + ' If mouse left and right buttons are pressed at the same time, + ' use mouse translation to move avatar around X and Z axis. + cameraXSpeed = cameraXSpeed + SIN(angleY) * mouseYDelta / 4 + cameraZSpeed = cameraZSpeed - COS(angleY) * mouseYDelta / 4 + GOTO 3 + END IF + ' If only right button is pressed, move around Y axis + cameraYSpeed = cameraYSpeed + mouseYDelta / 4 +3 + mouseYDelta = 0 + END IF + +END IF + +' Limit mouse movement to maxMove +IF mouseXDelta < -maxMove THEN mouseXDelta = -maxMove +IF mouseXDelta > maxMove THEN mouseXDelta = maxMove +angleY = angleY - mouseXDelta / 150 + +IF mouseYDelta < -maxMove THEN mouseYDelta = -maxMove +IF mouseYDelta > maxMove THEN mouseYDelta = maxMove +angleX = angleX - mouseYDelta / 150 + +' Read keyboard input and update player position +keyInput$ = INKEY$ + +IF keyInput$ = "a" THEN cameraXSpeed = cameraXSpeed - COS(angleY): cameraZSpeed = cameraZSpeed - SIN(angleY) +IF keyInput$ = "d" THEN cameraXSpeed = cameraXSpeed + COS(angleY): cameraZSpeed = cameraZSpeed + SIN(angleY) +IF keyInput$ = "w" THEN cameraXSpeed = cameraXSpeed - SIN(angleY): cameraZSpeed = cameraZSpeed + COS(angleY) +IF keyInput$ = "s" THEN cameraXSpeed = cameraXSpeed + SIN(angleY): cameraZSpeed = cameraZSpeed - COS(angleY) +IF keyInput$ = "q" THEN SYSTEM + +' Apply friction to player movement +cameraXSpeed = cameraXSpeed / 1.1 +cameraYSpeed = cameraYSpeed / 1.1 +cameraZSpeed = cameraZSpeed / 1.1 + +' Update player position +cameraX = cameraX + cameraXSpeed +cameraZ = cameraZ + cameraZSpeed +cameraY = cameraY + cameraYSpeed + +END SUB + +FUNCTION getByte (addr) +getByte = PEEK(extensionAddress + addr) +END FUNCTION + +FUNCTION getWord (addr) +a = PEEK(extensionAddress + addr) +b = PEEK(extensionAddress + addr + 1) + +' Convert bytes to a hex string and then to an integer +c$ = HEX$(a) +IF LEN(c$) = 1 THEN c$ = "0" + c$ +IF LEN(c$) = 0 THEN c$ = "00" + +c = VAL("&H" + HEX$(b) + c$) + +getWord = c +END FUNCTION + +SUB putByte (addr, dat) +POKE (extensionAddress + addr), dat +END SUB + +SUB putWord (addr, dat) + +b$ = HEX$(dat) + +2 +IF LEN(b$) < 4 THEN b$ = "0" + b$: GOTO 2 + +n1 = VAL("&H" + LEFT$(b$, 2)) +n2 = VAL("&H" + RIGHT$(b$, 2)) + +POKE (extensionAddress + addr), n2 +POKE (extensionAddress + addr + 1), n1 + +END SUB + +SUB initializeProgram +verifyTsrIsLoaded + +SCREEN 7, , , 1 + +' Set camera speed limit +maxMove = 50 + +END SUB + +SUB verifyTsrIsLoaded + +DEF SEG = 0 ' Read first from interrupt table + +extensionSegment = PEEK(&H79 * 4 + 3) * 256 +extensionSegment = extensionSegment + PEEK(&H79 * 4 + 2) + +PRINT "Segment is: " + HEX$(extensionSegment) + +extensionAddress = PEEK(&H79 * 4 + 1) * 256 +extensionAddress = extensionAddress + PEEK(&H79 * 4 + 0) + +PRINT "relative address is:"; extensionAddress + +DEF SEG = extensionSegment + +' Verify TSR signature +IF getWord(0) <> 1983 THEN + PRINT "FATAL ERROR: you must load" + PRINT "QBasic extension TSR first!" + SYSTEM +END IF + +END SUB diff --git a/3D GFX/Miscellaneous/Maze explorer.png b/3D GFX/Miscellaneous/Maze explorer.png new file mode 100644 index 0000000..96348a3 Binary files /dev/null and b/3D GFX/Miscellaneous/Maze explorer.png differ diff --git a/3D GFX/Miscellaneous/Tank.bas b/3D GFX/Miscellaneous/Tank.bas new file mode 100755 index 0000000..479e421 --- /dev/null +++ b/3D GFX/Miscellaneous/Tank.bas @@ -0,0 +1,800 @@ +' Program to render animated 3D tank driving back and forth on a 3D bridge +' Tank tracks are synchronized with movement. Free camera navigation available. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2000, Initial version +' 2024 - 2025, Improved code readability +' +' Controls: +' Arrow keys - Look around +' +/- - Move forward/backward +' Q - Quit +' Space - Stop movement + +DECLARE SUB InitializeProgram () +DECLARE SUB SavePosition (x1%, y1%, x2%, y3%) +DECLARE SUB LoadBridgeGeometry () +DECLARE SUB UpdateTankTracks () +DECLARE SUB InitializeTrackSegments () +DECLARE SUB GetTrackSegmentPoints (x1%, y1%, x2%, Y2%) +DECLARE SUB DisplayText () +DECLARE SUB LoadInitialGeometry () +DECLARE SUB MultiplyCoordinates () +DECLARE SUB RenderSceneLoop () +DECLARE SUB PrecomputeTrigTables () + +DEFINT A-Y +' Screen coordinate arrays for projected points +DIM SHARED screenX(1000), screenY(1000), depthZ(1000) +' World space coordinates for all 3D points +DIM SHARED worldPointX(2000), worldPointY(2000), worldPointZ(2000) +' Previous frame's rotated point coordinates for motion trails +DIM SHARED prevStartX(1000), prevStartY(1000), prevEndX(1000), prevEndY(1000) +' Line connections between points +DIM SHARED lineStartIndex(1000), lineEndIndex(1000) +' Precomputed sine/cosine tables for fast rotation calculations +DIM SHARED precomputedCosine&(360), precomputedSine&(360) +DIM SHARED totalPoints, totalLines + +' Track system arrays and counters +DIM SHARED trackX(1 TO 3000) +DIM SHARED trackY(1 TO 3000) +DIM SHARED trackSegmentCount +DIM SHARED currentTrackSegmentIndex + +' Geometry pointers for different object types +DIM SHARED trackStartPointIndex ' Point index for first track segment +DIM SHARED trackStartLineIndex ' Line index for first track segment +DIM SHARED bridgeStartPointIndex ' Point index for bridge geometry +DIM SHARED bridgeStartLineIndex ' Line index for bridge geometry + +' Tank position tracking +DIM SHARED tracksXOffset +DIM SHARED tankPosX, tankPosY, tankPosZ +DIM SHARED previousTankPosX, previousTankPosY, previousTankPosZZ + +' Camera rotation angles in degrees +DIM SHARED yawRotationDeg, pitchRotationDeg, rollRotationDeg +DIM SHARED movementSpeed + +DIM SHARED tankMovementDirection + +InitializeProgram +RenderSceneLoop + +' 3D Model Data Section +' Contains coordinates for: +' - Tank body +' - Bridge structure +' - Connection lines between points +DATA -10,-30,-20 +DATA 30,-30,-20 +DATA 30,-10,-20 +DATA -10,-10,-20 + +DATA -10,-30,20 +DATA 30,-30,20 +DATA 30,-10,20 +DATA -10,-10,20 + +DATA -10,-40,-15 +DATA 30,-40,-15 +DATA -10,-40,15 +DATA 30,-40,15 + +DATA -20,-30,-15 +DATA -20,-30, 15 + +DATA -70,-10,-50 +DATA 60,-10, -50 +DATA 70, 0, -50 +DATA 70, 20, -50 +DATA 60, 30, -50 +DATA -70,30, -50 +DATA -80,20, -50 +DATA -80, 0, -50 + +DATA -70,-10,-30 +DATA 60,-10, -30 +DATA 70, 0, -30 +DATA 70, 20, -30 +DATA 60, 30, -30 +DATA -70,30, -30 +DATA -80,20, -30 +DATA -80, 0, -30 + +DATA -70,-10, 50 +DATA 60,-10, 50 +DATA 70, 0, 50 +DATA 70, 20, 50 +DATA 60, 30, 50 +DATA -70,30, 50 +DATA -80,20, 50 +DATA -80, 0, 50 + +DATA -70,-10, 30 +DATA 60,-10, 30 +DATA 70, 0, 30 +DATA 70, 20, 30 +DATA 60, 30, 30 +DATA -70,30, 30 +DATA -80,20, 30 +DATA -80, 0, 30 + +DATA -50,-7,-30 +DATA 50,-7,-30 +DATA 50, 15,-30 +DATA -50, 15,-30 + +DATA -50,-7, 30 +DATA 50,-7, 30 +DATA 50, 15,30 +DATA -50, 15,30 + +DATA -20,-20,-5 +DATA -20,-20, 5 +DATA -20,-30, 5 +DATA -20,-30,-5 + +DATA -100,-30,-5 +DATA -100,-30, 5 +DATA -100,-40, 5 +DATA -100,-40,-5 + +DATA 999,999,999 + +DATA 0,1 +DATA 1,2 +DATA 2,3 +DATA 3,0 + +DATA 4,5 +DATA 5,6 +DATA 6,7 +DATA 7,4 + +DATA 0,8 +DATA 1,9 +DATA 4,10 +DATA 5,11 + +DATA 0,12 +DATA 4,13 +DATA 12,8 +DATA 13,10 + +DATA 8,9 +DATA 10,11 +DATA 8,10 +DATA 9,11 + +DATA 12,13 +DATA 12,3 +DATA 13,7 +DATA 3,7 +DATA 1,5 +DATA 2,6 + +DATA 14,15 +DATA 15,16 +DATA 16,17 +DATA 17,18 +DATA 18,19 +DATA 19,20 +DATA 20,21 +DATA 21,14 + +DATA 22,23 +DATA 23,24 +DATA 24,25 +DATA 25,26 +DATA 26,27 +DATA 27,28 +DATA 28,29 +DATA 29,22 + +DATA 30,31 +DATA 31,32 +DATA 32,33 +DATA 33,34 +DATA 34,35 +DATA 35,36 +DATA 36,37 +DATA 37,30 + +DATA 38,39 +DATA 39,40 +DATA 40,41 +DATA 41,42 +DATA 42,43 +DATA 43,44 +DATA 44,45 +DATA 45,38 + +DATA 46,47 +DATA 47,48 +DATA 48,49 +DATA 49,46 + +DATA 50,51 +DATA 51,52 +DATA 52,53 +DATA 53,50 + +DATA 50,46 +DATA 51,47 +DATA 52,48 +DATA 53,49 + +DATA 54,55 +DATA 55,56 +DATA 56,57 +DATA 57,54 + +DATA 54,58 +DATA 55,59 +DATA 56,60 +DATA 57,61 + +DATA 58,59 +DATA 59,60 +DATA 60,61 +DATA 61,58 + +DATA 54,3 +DATA 55,7 + +DATA 999, 999 +' BRIDGE +' right handlebars +DATA 100,0,100 +DATA 100,50,100 + +DATA 50,0,100 +DATA 50,50,100 + +DATA 0,0,100 +DATA 0,50,100 + +DATA -50,0,100 +DATA -50,50,100 + +DATA -100,0,100 +DATA -100,50,100 + ' 5 +DATA -150,0,100 +DATA -150,50,100 + +DATA -200,0,100 +DATA -200,50,100 + +DATA -250,0,100 +DATA -250,50,100 + +DATA -300,0,100 +DATA -300,50,100 + +DATA -350,0,100 +DATA -350,50,100 + ' 10 + +DATA -400,0,100 +DATA -400,50,100 + +DATA -450,0,100 +DATA -450,50,100 + +DATA -500,0,100 +DATA -500,50,100 + +DATA -550,0,100 +DATA -550,50,100 + +DATA -600,0,100 +DATA -600,50,100 + +DATA -650,0,100 +DATA -650,50,100 + + ' left handlebars +DATA 100,0,-100 +DATA 100,50,-100 + +DATA 50,0,-100 +DATA 50,50,-100 + +DATA 0,0,-100 +DATA 0,50,-100 + +DATA -50,0,-100 +DATA -50,50,-100 + +DATA -100,0,-100 +DATA -100,50,-100 + ' 5 +DATA -150,0,-100 +DATA -150,50,-100 + +DATA -200,0,-100 +DATA -200,50,-100 + +DATA -250,0,-100 +DATA -250,50,-100 + +DATA -300,0,-100 +DATA -300,50,-100 + +DATA -350,0,-100 +DATA -350,50,-100 + ' 10 + +DATA -400,0,-100 +DATA -400,50,-100 + +DATA -450,0,-100 +DATA -450,50,-100 + +DATA -500,0,-100 +DATA -500,50,-100 + +DATA -550,0,-100 +DATA -550,50,-100 + +DATA -600,0,-100 +DATA -600,50,-100 + +DATA -650,0,-100 +DATA -650,50,-100 + ' bottom line +DATA 100,75,-100 +DATA -650,75,-100 + +DATA 100,75,100 +DATA -650,75,100 + ' shore +DATA 75,75,-100 +DATA 75,75,100 + 'right +DATA -50,200,-100 +DATA -50,200,100 + +DATA 75,200,-190 +DATA 75,200, 190 + 'left +DATA -525,200,-100 +DATA -525,200, 100 + +DATA -600,200,-190 +DATA -600,200, 190 + +' + +DATA 999,999,999 + + 'right handlebars + +DATA 2,3 +DATA 4,5 +DATA 6,7 +DATA 8,9 + +DATA 10,11 +DATA 12,13 +DATA 14,15 +DATA 16,17 +DATA 18,19 + +DATA 20,21 +DATA 22,23 +DATA 24,25 +DATA 26,27 +DATA 28,29 + + + 'left handlebars +DATA 34,35 +DATA 36,37 +DATA 38,39 +DATA 40,41 + +DATA 42,43 +DATA 44,45 +DATA 46,47 +DATA 48,49 +DATA 50,51 + +DATA 52,53 +DATA 54,55 +DATA 56,57 +DATA 58,59 +DATA 60,61 + +' long features +DATA 0,4 +DATA 4,8 +DATA 8,12 +DATA 12,16 +DATA 16,20 +DATA 20,24 +DATA 24,28 +DATA 28,30 + +DATA 1,5 +DATA 5,9 +DATA 9,13 +DATA 13,17 +DATA 17,21 +DATA 21,25 +DATA 25,29 +DATA 29,31 + +DATA 32,36 +DATA 36,40 +DATA 40,44 +DATA 44,48 +DATA 48,52 +DATA 52,56 +DATA 56,60 +DATA 60,62 + +DATA 33,37 +DATA 37,41 +DATA 41,45 +DATA 45,49 +DATA 49,53 +DATA 53,57 +DATA 57,61 +DATA 61,63 + +' + +' end + +DATA 1,33 +DATA 31,63 + +DATA 64,65 +DATA 66,67 +DATA 64,66 +DATA 65,67 + +DATA 0,66 +DATA 32,64 +DATA 30,67 +DATA 62,65 + ' shore +DATA 68,69 +DATA 70,71 +DATA 68,70 +DATA 69,71 + +DATA 72,70 +DATA 72,68 + +DATA 73,71 +DATA 73,69 + 'left +DATA 74,76 +DATA 75,77 +DATA 74,75 + +DATA 74,65 +DATA 76,65 + +DATA 75,67 +DATA 77,67 + +DATA 999, 999 + +SUB GetTrackSegmentPoints (startX%, startY%, endX%, endY%) +' Calculates evenly spaced points along a straight line between two coordinates +' Used to create smooth tank track paths +dx = ABS(startX - endX) +dy = ABS(endY - startY) +length = SQR(dx ^ 2 + dy ^ 2) * 1.017142857# + +' Calculate direction vectors +directionX = (startX - endX) / length +directionY = (endY - startY) / length + +currentX = startX% +currentY = startY% + +FOR segment = 1 TO length + currentX = currentX - directionX + currentY = currentY + directionY + trackX(trackSegmentCount) = currentX + trackY(trackSegmentCount) = currentY + trackSegmentCount = trackSegmentCount + 1 +NEXT segment + +END SUB + +SUB InitializeProgram +' Sets up initial program state and loads geometry +SCREEN 12 +CLS +movementSpeed = 0 + +yawRotationDeg = 210 +pitchRotationDeg = 20 +rollRotationDeg = 90 + +currentTrackSegmentIndex = 1 +tracksXOffset = 0 + +previousTankPosX = 0 +previousTankPosY = 0 +previousTankPosZZ = 0 +tankPosX = 0 +tankPosY = -300 +tankPosZ = 100 +currentTrackSegmentIndex = 1 + +tankMovementDirection = 1 + +PrecomputeTrigTables +LoadInitialGeometry +LoadBridgeGeometry +InitializeTrackSegments + +END SUB + +SUB InitializeTrackSegments +' Sets up predefined track path segments connecting key points on the tank chassis +trackSegmentCount = 1 +GetTrackSegmentPoints -70, -10, -80, 0 +GetTrackSegmentPoints -80, 0, -80, 20 +GetTrackSegmentPoints -80, 20, -70, 30 +GetTrackSegmentPoints -70, 30, 60, 30 +GetTrackSegmentPoints 60, 30, 70, 20 +GetTrackSegmentPoints 70, 20, 70, 0 +GetTrackSegmentPoints 70, 0, 60, -10 +GetTrackSegmentPoints 60, -10, -70, -10 + +END SUB + +SUB LoadBridgeGeometry +' Loads bridge geometry from DATA statements and adjusts indices +bridgeStartLineIndex = totalLines +bridgeStartPointIndex = totalPoints + +ReadNextPoint: +READ worldPointX(totalPoints), worldPointY(totalPoints), worldPointZ(totalPoints) +IF worldPointX(totalPoints) = 999 THEN + worldPointX(totalPoints) = 0: worldPointY(totalPoints) = 0: worldPointZ(totalPoints) = 0: GOTO FoundEndOfBridgePoints +END IF +totalPoints = totalPoints + 1 +GOTO ReadNextPoint + +FoundEndOfBridgePoints: +ReadNextLine: +READ lineStartIndex(totalLines), lineEndIndex(totalLines) +IF lineStartIndex(totalLines) = 999 THEN GOTO EndOfBridgeLines +lineStartIndex(totalLines) = lineStartIndex(totalLines) + bridgeStartPointIndex +lineEndIndex(totalLines) = lineEndIndex(totalLines) + bridgeStartPointIndex +totalLines = totalLines + 1 +GOTO ReadNextLine + +EndOfBridgeLines: + +END SUB + +SUB LoadInitialGeometry +' Loads all 3D model vertices and connection lines from DATA statements +FOR pointIndex = 0 TO 10000 + READ worldPointX(pointIndex), worldPointY(pointIndex), worldPointZ(pointIndex) + IF worldPointX(pointIndex) = 999 THEN + worldPointX(pointIndex) = 0: worldPointY(pointIndex) = 0: worldPointZ(pointIndex) = 0: GOTO FoundEndOfPoints + END IF +NEXT + +FoundEndOfPoints: +totalPoints = pointIndex + +FOR lineIndex = 0 TO 10000 + READ lineStartIndex(lineIndex), lineEndIndex(lineIndex) + IF lineStartIndex(lineIndex) = 999 THEN GOTO FoundEndOfLines +NEXT + +FoundEndOfLines: +totalLines = lineIndex + +' Save starting indices for different object types +trackStartPointIndex = totalPoints +trackStartLineIndex = totalLines + +' Initialize space for track segments +FOR segmentIndex = 1 TO 48 + lineStartIndex(totalLines) = totalPoints + totalPoints = totalPoints + 1 + lineEndIndex(totalLines) = totalPoints + totalPoints = totalPoints + 1 + totalLines = totalLines + 1 +NEXT segmentIndex + +END SUB + +SUB PrecomputeTrigTables +' Precomputes sine and cosine values for 0-360 degrees +' Values are scaled by 1024 to maintain precision with integer math +FOR angleRadians! = 0 TO 359 / 57.29577950999997# STEP 1 / 57.29577950999997# + precomputedCosine&(angle) = INT(.5 + COS(angleRadians!) * 1024) + precomputedSine&(angle) = INT(.5 + SIN(angleRadians!) * 1024) + angle = angle + 1 +NEXT +CLS +END SUB + +SUB RenderSceneLoop +' Main rendering loop with camera controls and 3D projection +DO + ' Update animated tank tracks + UpdateTankTracks + + ' Apply rotation deltas to camera angles + yawRotationDeg = yawRotationDeg + rotationDeltaYaw + pitchRotationDeg = pitchRotationDeg + rotationDeltaPitch + rollRotationDeg = rollRotationDeg + rotationDeltaRoll + + ' Keep angles within 0-360 degree range + IF yawRotationDeg <= 0 THEN yawRotationDeg = yawRotationDeg + 360 + IF pitchRotationDeg <= 0 THEN pitchRotationDeg = pitchRotationDeg + 360 + IF rollRotationDeg <= 0 THEN rollRotationDeg = rollRotationDeg + 360 + + IF yawRotationDeg >= 360 THEN yawRotationDeg = yawRotationDeg - 360 + IF pitchRotationDeg >= 360 THEN pitchRotationDeg = pitchRotationDeg - 360 + IF rollRotationDeg >= 360 THEN rollRotationDeg = rollRotationDeg - 360 + + ' Lookup precomputed trig values + cosYaw& = precomputedCosine&(yawRotationDeg) + sinYaw& = precomputedSine&(yawRotationDeg) + cosPitch& = precomputedCosine&(pitchRotationDeg) + sinPitch& = precomputedSine&(pitchRotationDeg) + cosRoll& = precomputedCosine&(rollRotationDeg) + sinRoll& = precomputedSine&(rollRotationDeg) + + ' Update tank position based on movement speed + tankPosX = tankPosX - (sinYaw& * movementSpeed / 100) + tankPosY = tankPosY - (cosYaw& * movementSpeed / 100) + tankPosZ = tankPosZ - (sinPitch& * movementSpeed / 100) + + ' Transform all points through rotation matrices + FOR pointIndex = 0 TO totalPoints - 1 + ' Translate point by tank position + worldX = worldPointX(pointIndex) + tankPosX + worldY = worldPointY(pointIndex) + tankPosZ + worldZ = worldPointZ(pointIndex) + tankPosY + + ' Apply Yaw rotation (around Y axis) + rotatedX = (worldX * cosYaw& - worldZ * sinYaw&) \ 1024 + rotatedZ = (worldX * sinYaw& + worldZ * cosYaw&) \ 1024 + + ' Apply Pitch rotation (around X axis) + rotatedY = (worldY * cosPitch& - rotatedZ * sinPitch&) \ 1024 + finalZ = (worldY * sinPitch& + rotatedZ * cosPitch&) \ 1024 + + ' Apply Roll rotation (around Z axis) + screenXCoord = (rotatedY * cosRoll& - rotatedX * sinRoll&) \ 1024 + screenYCoord = (rotatedY * sinRoll& + rotatedX * cosRoll&) \ 1024 + + ' Perspective projection if point is in front of camera + IF finalZ > 10 THEN + screenX(pointIndex) = 320 + (screenXCoord / finalZ * 500) + screenY(pointIndex) = 240 + (screenYCoord / finalZ * 500) + ELSE + screenX(pointIndex) = -1 + END IF + NEXT + + ' Draw all connected lines + FOR lineIndex = 0 TO totalLines - 1 + firstPoint = lineStartIndex(lineIndex) + secondPoint = lineEndIndex(lineIndex) + + startX = screenX(firstPoint) + startY = screenY(firstPoint) + endX = screenX(secondPoint) + endY = screenY(secondPoint) + + ' Erase previous frame's line if it was visible + IF prevStartX(lineIndex) <> -1 AND prevEndX(lineIndex) <> -1 THEN + LINE (prevStartX(lineIndex), prevStartY(lineIndex))-(prevEndX(lineIndex), prevEndY(lineIndex)), 0 + END IF + + ' Draw new line if both points are visible + IF endX <> -1 AND startX <> -1 THEN + LINE (endX, endY)-(startX, startY), 15 + END IF + + ' Save current coordinates for next frame + prevStartX(lineIndex) = endX + prevStartY(lineIndex) = endY + prevEndX(lineIndex) = startX + prevEndY(lineIndex) = startY + NEXT + + ' Handle user input + keyInput$ = INKEY$ + IF keyInput$ <> "" THEN + SELECT CASE keyInput$ + ' Camera rotation controls + CASE CHR$(0) + "M" ' Right arrow + rotationDeltaYaw = rotationDeltaYaw - 1 + CASE CHR$(0) + "K" ' Left arrow + rotationDeltaYaw = rotationDeltaYaw + 1 + CASE CHR$(0) + "P" ' Down arrow + rotationDeltaPitch = rotationDeltaPitch + 1 + CASE CHR$(0) + "H" ' Up arrow + rotationDeltaPitch = rotationDeltaPitch - 1 + CASE "w" ' W key + rotationDeltaRoll = rotationDeltaRoll - 1 + CASE "z" ' Z key + rotationDeltaRoll = rotationDeltaRoll + 1 + + ' Movement controls + CASE "-" + movementSpeed = movementSpeed - 1 + CASE "+" + movementSpeed = movementSpeed + 1 + CASE " " ' Spacebar + rotationDeltaYaw = 0: rotationDeltaPitch = 0: rotationDeltaRoll = 0 + movementSpeed = 0 + CASE CHR$(27) ' Escape key + SYSTEM + END SELECT + END IF +LOOP +END SUB + +SUB UpdateTankTracks + +' Animates tank tracks by cycling through predefined track segments +tracksXOffset = tracksXOffset + tankMovementDirection +currentTrackSegmentIndex = currentTrackSegmentIndex + tankMovementDirection + +' Wrap segment index at boundaries +IF currentTrackSegmentIndex > 15 THEN currentTrackSegmentIndex = 1 +IF currentTrackSegmentIndex < 1 THEN currentTrackSegmentIndex = 15 + +segmentIndex = currentTrackSegmentIndex + +' Update right-side track positions +FOR pointIndex = trackStartPointIndex TO trackStartPointIndex + 48 STEP 2 + worldPointX(pointIndex) = trackX(segmentIndex) - tracksXOffset + worldPointY(pointIndex) = trackY(segmentIndex) + worldPointZ(pointIndex) = 50 + worldPointX(pointIndex + 1) = trackX(segmentIndex) - tracksXOffset + worldPointY(pointIndex + 1) = trackY(segmentIndex) + worldPointZ(pointIndex + 1) = 30 + segmentIndex = segmentIndex + 15 +NEXT + +segmentIndex = currentTrackSegmentIndex + +' Update left-side track positions +FOR pointIndex = trackStartPointIndex + 48 TO trackStartPointIndex + 94 STEP 2 + worldPointX(pointIndex) = trackX(segmentIndex) - tracksXOffset + worldPointY(pointIndex) = trackY(segmentIndex) + worldPointZ(pointIndex) = -50 + worldPointX(pointIndex + 1) = trackX(segmentIndex) - tracksXOffset + worldPointY(pointIndex + 1) = trackY(segmentIndex) + worldPointZ(pointIndex + 1) = -30 + segmentIndex = segmentIndex + 15 +NEXT + +' Move entire tank back and forth when hitting boundaries +FOR pointIndex = 0 TO 84 + worldPointX(pointIndex) = worldPointX(pointIndex) - tankMovementDirection +NEXT + +IF worldPointX(84) > 0 THEN tankMovementDirection = 1 +IF worldPointX(83) < -400 THEN tankMovementDirection = -1 + +END SUB + diff --git a/3D GFX/Miscellaneous/Tank.webm b/3D GFX/Miscellaneous/Tank.webm new file mode 100644 index 0000000..4d5e603 Binary files /dev/null and b/3D GFX/Miscellaneous/Tank.webm differ diff --git a/3D GFX/Miscellaneous/Tiled room.bas b/3D GFX/Miscellaneous/Tiled room.bas new file mode 100755 index 0000000..24e3224 --- /dev/null +++ b/3D GFX/Miscellaneous/Tiled room.bas @@ -0,0 +1,502 @@ +' Program renders 3D room with various decorative tiles on the wall and on the floor. +' User can freely fly around and look at the room from different angles. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' ?, Initial version +' 2024, Improved program readability +' +' Keyboard controls: +' , , , - move around +' 2, 6, 4, 8 - look around (number pad) +' - speed down +' q - quit +' + / - - move up / down +' + + +DECLARE SUB renderSquare2 (x!, y!, z!, s!) +DECLARE SUB renderSquare (x%, y%, z%, s%) +DECLARE SUB renderHexagon (x!, y!, z!, s!) +DECLARE SUB generateCube () + +DECLARE SUB start () +DECLARE SUB addSquare (x1%, y1%, z1%) +DECLARE SUB getCornerVertices () +DECLARE SUB multiplyCoordinates () +DECLARE SUB calculateSine () +DIM SHARED xVertex(4000), yVertex(4000), zVertex(4000) +DIM SHARED xCoordinate(4000), yCoordinate(4000), zCoordinate(4000) + +DIM SHARED xOriginal(4000), yOriginal(4000), zOriginal(4000) +DIM SHARED point1Vertex(4000), point2Vertex(4000) +DIM SHARED col(4000) +DIM SHARED vertexCount, edgeCount +DIM SHARED myx, myy, myz, mye, myk + +myx = 0 +myy = 0 +myz = -1000 + +start + +nait3d + +SUB addSquare (x1%, y1%, z1%) + c = 1 + + ' Define the vertices of a square in 3D space + xVertex(vertexCount + 1) = -100 + x1 + yVertex(vertexCount + 1) = y1 + zVertex(vertexCount + 1) = -100 + z1 + + xVertex(vertexCount + 2) = 100 + x1 + yVertex(vertexCount + 2) = y1 + zVertex(vertexCount + 2) = -100 + z1 + + xVertex(vertexCount + 3) = 100 + x1 + yVertex(vertexCount + 3) = y1 + zVertex(vertexCount + 3) = 100 + z1 + + xVertex(vertexCount + 4) = -100 + x1 + yVertex(vertexCount + 4) = y1 + zVertex(vertexCount + 4) = 100 + z1 + + ' Define the edges of the square + point1Vertex(edgeCount + 1) = vertexCount + 1 + point2Vertex(edgeCount + 1) = vertexCount + 2 + col(edgeCount + 1) = c + + point1Vertex(edgeCount + 2) = vertexCount + 2 + point2Vertex(edgeCount + 2) = vertexCount + 3 + col(edgeCount + 2) = c + + point1Vertex(edgeCount + 3) = vertexCount + 3 + point2Vertex(edgeCount + 3) = vertexCount + 4 + col(edgeCount + 3) = c + + point1Vertex(edgeCount + 4) = vertexCount + 4 + point2Vertex(edgeCount + 4) = vertexCount + 1 + col(edgeCount + 4) = c + + ' Update the counters for the next square + vertexCount = vertexCount + 4 + edgeCount = edgeCount + 4 + +END SUB + +SUB getCornerVertices + + ' Define the vertices of a square in 3D space + xVertex(vertexCount + 1) = -150 + yVertex(vertexCount + 1) = -125 + zVertex(vertexCount + 1) = -200 + + xVertex(vertexCount + 2) = 150 + yVertex(vertexCount + 2) = -125 + zVertex(vertexCount + 2) = -200 + + xVertex(vertexCount + 3) = 150 + yVertex(vertexCount + 3) = 125 + zVertex(vertexCount + 3) = -200 + + xVertex(vertexCount + 4) = -150 + yVertex(vertexCount + 4) = 125 + zVertex(vertexCount + 4) = -200 + + ' Define the edges of the square + point1Vertex(edgeCount + 1) = vertexCount + 1 + point2Vertex(edgeCount + 1) = vertexCount + 2 + + point1Vertex(edgeCount + 2) = vertexCount + 2 + point2Vertex(edgeCount + 2) = vertexCount + 3 + + point1Vertex(edgeCount + 3) = vertexCount + 3 + point2Vertex(edgeCount + 3) = vertexCount + 4 + + point1Vertex(edgeCount + 4) = vertexCount + 4 + point2Vertex(edgeCount + 4) = vertexCount + 1 + + ' Define the vertices of another square in 3D space + xVertex(vertexCount + 5) = -150 + yVertex(vertexCount + 5) = -125 + zVertex(vertexCount + 5) = 200 + + xVertex(vertexCount + 6) = 150 + yVertex(vertexCount + 6) = -125 + zVertex(vertexCount + 6) = 200 + + xVertex(vertexCount + 7) = 150 + yVertex(vertexCount + 7) = 125 + zVertex(vertexCount + 7) = 200 + + xVertex(vertexCount + 8) = -150 + yVertex(vertexCount + 8) = 125 + zVertex(vertexCount + 8) = 200 + + ' Define the edges of the second square + point1Vertex(edgeCount + 5) = vertexCount + 5 + point2Vertex(edgeCount + 5) = vertexCount + 6 + + point1Vertex(edgeCount + 6) = vertexCount + 6 + point2Vertex(edgeCount + 6) = vertexCount + 7 + + point1Vertex(edgeCount + 7) = vertexCount + 7 + point2Vertex(edgeCount + 7) = vertexCount + 8 + + point1Vertex(edgeCount + 8) = vertexCount + 8 + point2Vertex(edgeCount + 8) = vertexCount + 5 + + ' Define the edges connecting the two squares into cube + point1Vertex(edgeCount + 9) = vertexCount + 5 + point2Vertex(edgeCount + 9) = vertexCount + 1 + + point1Vertex(edgeCount + 10) = vertexCount + 6 + point2Vertex(edgeCount + 10) = vertexCount + 2 + + point1Vertex(edgeCount + 11) = vertexCount + 7 + point2Vertex(edgeCount + 11) = vertexCount + 3 + + point1Vertex(edgeCount + 12) = vertexCount + 8 + point2Vertex(edgeCount + 12) = vertexCount + 4 + + ' Update the counters for the next set of vertices and edges + vertexCount = vertexCount + 8 + edgeCount = edgeCount + 12 + + ' Define a pyramid in 3D space + xVertex(vertexCount + 1) = -150 + yVertex(vertexCount + 1) = -125 + 201 + zVertex(vertexCount + 1) = 0 + + xVertex(vertexCount + 2) = -150 + yVertex(vertexCount + 2) = -125 + 201 + zVertex(vertexCount + 2) = 89 + + xVertex(vertexCount + 3) = -150 + yVertex(vertexCount + 3) = -125 + zVertex(vertexCount + 3) = 89 + + xVertex(vertexCount + 4) = -150 + yVertex(vertexCount + 4) = -125 + zVertex(vertexCount + 4) = 0 + + ' Define the edges of the pyramid + point1Vertex(edgeCount + 1) = vertexCount + 1 + point2Vertex(edgeCount + 1) = vertexCount + 2 + + point1Vertex(edgeCount + 2) = vertexCount + 2 + point2Vertex(edgeCount + 2) = vertexCount + 3 + + point1Vertex(edgeCount + 3) = vertexCount + 3 + point2Vertex(edgeCount + 3) = vertexCount + 4 + + point1Vertex(edgeCount + 4) = vertexCount + 4 + point2Vertex(edgeCount + 4) = vertexCount + 1 + + ' Update the counters for the next set of vertices and edges + vertexCount = vertexCount + 4 + edgeCount = edgeCount + 4 + +porand + +END SUB + +SUB renderHexagon (x, y, z, s) + +b = 0 +f = .3925 +' Calculate the vertices of a hexagon in 3D space +FOR a = 0 + f TO 6 + f STEP 6.28 / 8 + x1 = SIN(a) * s + y1 = COS(a) * s + b = b + 1 + + xVertex(vertexCount + b) = x + x1 + yVertex(vertexCount + b) = y + zVertex(vertexCount + b) = z + y1 + +NEXT a + +' Define the edges of the hexagon +point1Vertex(edgeCount + 1) = vertexCount + 1 +point2Vertex(edgeCount + 1) = vertexCount + 2 +col(edgeCount + 1) = 12 + +point1Vertex(edgeCount + 2) = vertexCount + 2 +point2Vertex(edgeCount + 2) = vertexCount + 3 +col(edgeCount + 2) = 12 + +point1Vertex(edgeCount + 3) = vertexCount + 3 +point2Vertex(edgeCount + 3) = vertexCount + 4 +col(edgeCount + 3) = 12 + +point1Vertex(edgeCount + 4) = vertexCount + 4 +point2Vertex(edgeCount + 4) = vertexCount + 5 +col(edgeCount + 4) = 12 + +point1Vertex(edgeCount + 5) = vertexCount + 5 +point2Vertex(edgeCount + 5) = vertexCount + 6 +col(edgeCount + 5) = 12 + +point1Vertex(edgeCount + 6) = vertexCount + 6 +point2Vertex(edgeCount + 6) = vertexCount + 7 +col(edgeCount + 6) = 12 + +point1Vertex(edgeCount + 7) = vertexCount + 7 +point2Vertex(edgeCount + 7) = vertexCount + 8 +col(edgeCount + 7) = 12 + +point1Vertex(edgeCount + 8) = vertexCount + 8 +point2Vertex(edgeCount + 8) = vertexCount + 1 +col(edgeCount + 8) = 12 + +' Update the counters for the next set of vertices and edges +vertexCount = vertexCount + b +edgeCount = edgeCount + 8 + +END SUB + +SUB nait3d + + ' Main loop to render the 3D scene +1 + + ' Update the position based on rotation + myx = myx + SIN(deg1) * mye + myz = myz + COS(deg1) * mye + + myx = myx + COS(deg1) * myk + myz = myz - SIN(deg1) * myk + + ' Update the rotation angles + deg1 = deg1 + d1 + Deg2 = Deg2 + d2 + + ' Calculate the rotation matrices + C1 = COS(deg1): S1 = SIN(deg1) + C2 = COS(Deg2): S2 = SIN(Deg2) + + ' Apply the rotation to each vertex + FOR a = 1 TO vertexCount + xo = xVertex(a) - myx + yo = -yVertex(a) - myy + zo = zVertex(a) - myz + + x1 = (xo * C1 - zo * S1) + z1 = (xo * S1 + zo * C1) + + y1 = (yo * C2 - z1 * S2) + z2 = (yo * S2 + z1 * C2) + + ' Project the vertex onto the 2D screen + xOriginal(a) = xCoordinate(a) + yOriginal(a) = yCoordinate(a) + IF z2 < 20 THEN + xCoordinate(a) = -1 + ELSE + xCoordinate(a) = 320 + (x1 / z2 * 500) + yCoordinate(a) = 240 + (y1 / z2 * 500) + END IF + NEXT + + ' Draw the edges of each shape + FOR a = 1 TO edgeCount + p1 = point1Vertex(a) + p2 = point2Vertex(a) + IF xOriginal(p1) = -1 OR xOriginal(p2) = -1 THEN + ' Skip drawing if the vertex is off-screen + ELSE + ' erase edge on old coordinates + LINE (xOriginal(p1), yOriginal(p1))-(xOriginal(p2), yOriginal(p2)), 0 + END IF + + IF xCoordinate(p1) = -1 OR xCoordinate(p2) = -1 THEN + ' Skip drawing if the vertex is off-screen + ELSE + ' draw edge on new coordinates + LINE (xCoordinate(p1), yCoordinate(p1))-(xCoordinate(p2), yCoordinate(p2)), col(a) + END IF + NEXT + + ' Handle user input + K$ = INKEY$ + IF K$ <> "" THEN + + SELECT CASE K$ + + CASE CHR$(0) + "P" + mye = mye - 3 + + CASE CHR$(0) + "H" + mye = mye + 3 + + CASE CHR$(0) + "M" + myk = myk + 3 + + CASE CHR$(0) + "K" + myk = myk - 3 + + CASE "+" + myy = myy + 3 + + CASE "-" + myy = myy - 3 + + CASE "6" + d1 = d1 + .01 + + CASE "4" + d1 = d1 - .01 + + CASE "8" + d2 = d2 - .01 + + CASE "2" + d2 = d2 + .01 + + CASE " " + d1 = d1 / 2 + d2 = d2 / 2 + d3 = d3 / 2 + mye = mye / 2 + myk = myk / 2 + + CASE "q" + SYSTEM + + CASE CHR$(27) + SYSTEM + END SELECT + END IF + + ' Continue the main loop + GOTO 1 +END SUB + +SUB porand + + ' Generate a grid of shapes in 3D space + FOR x = -100 TO 0 STEP 12.067 + .3 + FOR z = -100 TO 0 STEP 12.067 + .3 + renderHexagon x, -125, z, 6.53 + renderSquare x + 6.033 + .15, -125, z + 6.033 + .15, 3.111 + .3 + NEXT z + NEXT x + + ' Generate another grid of shapes in 3D space + FOR y = -100 TO 0 STEP 20.3 + FOR x = -100 TO 0 STEP 20.3 + renderSquare2 x, y, 200, 10 + NEXT x + NEXT y + +END SUB + +SUB renderSquare (x%, y%, z%, s%) + + ' Define the vertices of a square in 3D space + xVertex(vertexCount + 1) = x% + yVertex(vertexCount + 1) = y% + zVertex(vertexCount + 1) = z% + s% + + xVertex(vertexCount + 2) = x% + s% + yVertex(vertexCount + 2) = y% + zVertex(vertexCount + 2) = z% + + xVertex(vertexCount + 3) = x% + yVertex(vertexCount + 3) = y% + zVertex(vertexCount + 3) = z% - s% + + xVertex(vertexCount + 4) = x% - s% + yVertex(vertexCount + 4) = y% + zVertex(vertexCount + 4) = z% + + ' Define the edges of the square + point1Vertex(edgeCount + 1) = vertexCount + 1 + point2Vertex(edgeCount + 1) = vertexCount + 2 + col(edgeCount + 1) = 10 + + point1Vertex(edgeCount + 2) = vertexCount + 2 + point2Vertex(edgeCount + 2) = vertexCount + 3 + col(edgeCount + 2) = 10 + + point1Vertex(edgeCount + 3) = vertexCount + 3 + point2Vertex(edgeCount + 3) = vertexCount + 4 + col(edgeCount + 3) = 10 + + point1Vertex(edgeCount + 4) = vertexCount + 4 + point2Vertex(edgeCount + 4) = vertexCount + 1 + col(edgeCount + 4) = 10 + + ' Update the counters for the next square + vertexCount = vertexCount + 4 + edgeCount = edgeCount + 4 + +END SUB + +SUB renderSquare2 (x, y, z, s) + + ' Define the vertices of a square in 3D space + xVertex(vertexCount + 1) = x - s + yVertex(vertexCount + 1) = y - s + zVertex(vertexCount + 1) = z + + xVertex(vertexCount + 2) = x + s + yVertex(vertexCount + 2) = y - s + zVertex(vertexCount + 2) = z + + xVertex(vertexCount + 3) = x + s + yVertex(vertexCount + 3) = y + s + zVertex(vertexCount + 3) = z + + xVertex(vertexCount + 4) = x - s + yVertex(vertexCount + 4) = y + s + zVertex(vertexCount + 4) = z + + ' Define the edges of the square + point1Vertex(edgeCount + 1) = vertexCount + 1 + point2Vertex(edgeCount + 1) = vertexCount + 2 + col(edgeCount + 1) = 14 + + point1Vertex(edgeCount + 2) = vertexCount + 2 + point2Vertex(edgeCount + 2) = vertexCount + 3 + col(edgeCount + 2) = 14 + + point1Vertex(edgeCount + 3) = vertexCount + 3 + point2Vertex(edgeCount + 3) = vertexCount + 4 + col(edgeCount + 3) = 14 + + point1Vertex(edgeCount + 4) = vertexCount + 4 + point2Vertex(edgeCount + 4) = vertexCount + 1 + col(edgeCount + 4) = 14 + + ' Update the counters for the next square + vertexCount = vertexCount + 4 + edgeCount = edgeCount + 4 + +END SUB + +SUB start + + ' Initialize the screen and clear it + SCREEN 12 + CLS + + ' Set the initial color of all shapes + FOR a = 1 TO 4000 + col(a) = 15 + NEXT a + + ' Initialize counters for vertices and edges + vertexCount = 0 + edgeCount = 0 + + ' Generate the initial set of shapes + getCornerVertices + +END SUB diff --git a/3D GFX/Miscellaneous/Tiled room.webm b/3D GFX/Miscellaneous/Tiled room.webm new file mode 100644 index 0000000..0c4263a Binary files /dev/null and b/3D GFX/Miscellaneous/Tiled room.webm differ diff --git a/3D GFX/Miscellaneous/font.dat b/3D GFX/Miscellaneous/font.dat new file mode 100644 index 0000000..d3c1e68 --- /dev/null +++ b/3D GFX/Miscellaneous/font.dat @@ -0,0 +1,230 @@ +# a +p 1 0 +p 0 1 +p 2 1 +p 0 2 +p 2 2 +l 0 1 +l 0 2 +l 1 2 +l 1 3 +l 2 4 +# b +p 0 0 +p 2 0 +p 0 1 +p 0 2 +p 2 2 +l 0 1 +l 0 3 +l 1 2 +l 3 4 +l 4 2 +# c +p 2 0 +p 1 0 +p 0 1 +p 1 2 +p 2 2 +l 0 1 +l 1 2 +l 2 3 +l 3 4 +# d +p 0 0 +p 1 0 +p 2 1 +p 1 2 +p 0 2 +l 0 1 +l 1 2 +l 2 3 +l 3 4 +l 4 0 +# e +p 0 0 +p 2 0 +p 0 1 +p 2 1 +p 0 2 +p 2 2 +l 0 1 +l 2 3 +l 4 5 +l 0 4 +# f +p 0 0 +p 2 0 +p 0 1 +p 2 1 +p 0 2 +l 0 1 +l 2 3 +l 0 4 +# g +p 2 0 +p 1 0 +p 0 1 +p 1 2 +p 2 2 +p 2 1 +p 1 1 +l 0 1 +l 1 2 +l 2 3 +l 3 4 +l 4 5 +l 5 6 +# h +p 0 0 +p 0 2 +p 2 0 +p 2 2 +p 0 1 +p 2 1 +l 0 1 +l 2 3 +l 4 5 +# i +p 1 0 +p 1 2 +l 0 1 +# j +p 0 1 +p 0 2 +p 1 2 +p 1 0 +l 0 1 +l 1 2 +l 2 3 +# k +p 0 0 +p 0 2 +p 2 0 +p 2 2 +p 0 1 +l 0 1 +l 2 4 +l 4 3 +# l +p 0 0 +p 0 2 +p 2 2 +l 0 1 +l 1 2 +# m +p 0 2 +p 0 0 +p 1 1 +p 2 0 +p 2 2 +l 0 1 +l 1 2 +l 2 3 +l 3 4 +# n +p 0 2 +p 0 0 +p 2 2 +p 2 0 +l 0 1 +l 1 2 +l 2 3 +# o +p 0 0 +p 2 0 +p 2 2 +p 0 2 +l 0 1 +l 1 2 +l 2 3 +l 3 0 +# p +p 0 0 +p 2 0 +p 2 1 +p 0 1 +p 0 2 +l 0 1 +l 1 2 +l 2 3 +l 0 4 +# q +p 0 0 +p 2 0 +p 2 2 +p 0 2 +p 1 1 +l 0 1 +l 1 2 +l 2 3 +l 3 0 +l 2 4 +# r +p 0 0 +p 2 0 +p 2 1 +p 0 1 +p 0 2 +p 2 2 +l 0 1 +l 1 2 +l 2 3 +l 0 4 +l 5 3 +# s +p 2 0 +p 0 0 +p 0 1 +p 2 1 +p 2 2 +p 0 2 +l 0 1 +l 1 2 +l 2 3 +l 3 4 +l 4 5 +# t +p 0 0 +p 2 0 +p 1 0 +p 1 2 +l 0 1 +l 2 3 +# u +p 0 0 +p 0 2 +p 2 2 +p 2 0 +l 0 1 +l 1 2 +l 2 3 +# v +p 0 0 +p 1 2 +p 2 0 +l 0 1 +l 1 2 +# x +p 0 0 +p 2 2 +p 2 0 +p 0 2 +l 0 1 +l 2 3 +# y +p 0 0 +p 2 0 +p 1 1 +p 1 2 +l 0 2 +l 1 2 +l 2 3 +# z +p 0 0 +p 2 0 +p 0 2 +p 2 2 +l 0 1 +l 1 2 +l 2 3 \ No newline at end of file diff --git a/3D GFX/Miscellaneous/index.html b/3D GFX/Miscellaneous/index.html new file mode 100644 index 0000000..ea5b4f2 --- /dev/null +++ b/3D GFX/Miscellaneous/index.html @@ -0,0 +1,416 @@ + + + + + + + +Miscellaneous 3D graphics demos + + + + + + +
+

Miscellaneous 3D graphics demos

+ + + +
+

1. Rotating exclamation mark

+
+

+Wireframe 3D model of a rotating exclamation mark. +

+ +
+ +
+ +

+Source code +

+
+
+ + +
+

2. 3D bouncing ball

+
+

+3D ball made of point cloud. +

+ +
+ +
+ +

+Source code +

+
+
+ + +
+

3. 3D text in a room

+
+

+Wireframe 3D text hanging in a wireframe 3D room. User can look and +fly around in all directions. +

+ +
+ +
+ +

+Source code +

+
+
+ + +
+

4. 3D bouncing cubes on grid floor

+
+

+3D wireframe cubes bouncing on a grid floor, creating an immersive and +dynamic visual effect. +

+ +
+ +
+ +

+Source code +

+
+
+ + +
+

5. Matrix math for rotation in 3D space

+
+

+Instead of combining simple 2D rotors, pixels in this 3D space are +rotated by using matrix multiplications. +

+ +
+ +
+ +

+Source code +

+
+
+ + +
+

6. Maze explorer

+
+

+TODO: add description +

+ + +
+

Maze%20explorer.png +

+
+ +

+Source code +

+
+
+ +
+

7. Tank animation

+
+

+Animated tank driving through the bridge back and forward. User can +look and fly around in all directions. +

+ +
+ +
+ +

+Source code +

+
+
+ + +
+

8. Tiled room

+
+

+Room with some tiles on the wall and on the floor. User can freely fly +around. +

+ +
+ +
+ +

+Source code +

+
+
+
+
+

Created: 2025-07-28 ma 03:33

+

Validate

+
+ + diff --git a/3D GFX/Miscellaneous/index.org b/3D GFX/Miscellaneous/index.org new file mode 100644 index 0000000..3eb03a3 --- /dev/null +++ b/3D GFX/Miscellaneous/index.org @@ -0,0 +1,153 @@ +#+TITLE: Miscellaneous 3D graphics demos +#+LANGUAGE: en +#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry} +#+LATEX_HEADER: \usepackage{parskip} +#+LATEX_HEADER: \usepackage[none]{hyphenat} + +#+OPTIONS: H:20 num:20 +#+OPTIONS: author:nil + +#+begin_export html + +#+end_export + +* Rotating exclamation mark + +Wireframe 3D model of a rotating exclamation mark. + +#+begin_export html +
+ +
+#+end_export + +[[file:!.bas][Source code]] + + +* 3D bouncing ball + +3D ball made of point cloud. + +#+begin_export html +
+ +
+#+end_export + +[[file:3D%20ball.bas][Source code]] + + +* 3D text in a room + +Wireframe 3D text hanging in a wireframe 3D room. User can look and +fly around in all directions. + +#+begin_export html +
+ +
+#+end_export + +[[file:3D%20text.bas][Source code]] + + +* 3D bouncing cubes on grid floor + +3D wireframe cubes bouncing on a grid floor, creating an immersive and +dynamic visual effect. + +#+begin_export html +
+ +
+#+end_export + +[[file:3D%20GFX/Bouncing%20cubes.bas][Source code]] + + +* Matrix math for rotation in 3D space + +Instead of combining simple 2D rotors, pixels in this 3D space are +rotated by using matrix multiplications. + +#+begin_export html +
+ +
+#+end_export + +[[file:Matrix%20math.bas][Source code]] + + +* Maze explorer + +TODO: add description + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Maze%20explorer.bas][file:Maze%20explorer.png]] + +[[file:Maze explorer.bas][Source code]] + +* Tank animation + +Animated tank driving through the bridge back and forward. User can +look and fly around in all directions. + +#+begin_export html +
+ +
+#+end_export + +[[file:Tank.bas][Source code]] + + +* Tiled room + +Room with some tiles on the wall and on the floor. User can freely fly +around. + +#+begin_export html +
+ +
+#+end_export + +[[file:Tiled%20room.bas][Source code]] diff --git a/3D GFX/Miscellaneous/logo.png b/3D GFX/Miscellaneous/logo.png new file mode 100644 index 0000000..f261c1b Binary files /dev/null and b/3D GFX/Miscellaneous/logo.png differ diff --git a/3D GFX/Ray casting engine.bas b/3D GFX/Ray casting engine.bas new file mode 100755 index 0000000..53e17ee --- /dev/null +++ b/3D GFX/Ray casting engine.bas @@ -0,0 +1,422 @@ +DECLARE SUB InitializeProgram () +DECLARE SUB GenerateLandscape () +DECLARE SUB DisplayTopDownLandscape () +DECLARE SUB DisplayFrame () +DECLARE FUNCTION getcol! (r!, g!, b!) +DECLARE SUB FillSquareArea (x1%, y1%, x2%, y2%, c%, h%) +DECLARE SUB CreateTower (towerX%, towerY%) +DECLARE SUB SetupPalette () +DECLARE SUB DrawLineFromPlayer (x%, y%, xl%) +' Realtime 3D rendering with ray casting engine. + +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2003.03, Initial version +' 2024 - 2025, Improved program readability + +' 3D engine automatically adjusts quality to keep constant framerate at 10 fps. +' When framerate is lower than 10 fps, quality will be decreased to speed up rendering. + +' At least Intel Pentium 200 MHz in DOS mode is required to run this program smoothly. + +' keys to use: +' Arrow keys - move around +' 4, 6 - turn left, right +' 8, 2 - look up, down +' Enter - Toggle full quality +' Space - jump up (fly) +' ESC - exit program + +DEFINT A-Y + +DIM SHARED landh(0 TO 180, 0 TO 180) +DIM SHARED landc(0 TO 180, 0 TO 180) + +DIM SHARED zmyx, zmyy, zmyz +DIM SHARED myx, myy, myz +DIM SHARED zmyan, myan2 +DIM SHARED ste, stem, dist +DIM SHARED tim$, frm, frml + +frmrate = 10 ' Desired framerate. + ' Lower framerate, better quality + +InitializeProgram +GenerateLandscape + +DisplayTopDownLandscape +a$ = INPUT$(1) +1 +LOCATE 1, 35 +PRINT frml + +' Increment the frame counter +frm = frm + 1 + +' Check if a new second has passed +IF tim$ <> TIME$ THEN + ' Update the time + tim$ = TIME$ + + ' Adjust the step size based on the current frame rate + IF frm > frmrate THEN + ste = ste - 1 + ELSE + ste = ste + 1 + END IF + + ' Ensure the step size is within bounds + IF ste < 1 THEN + ste = 1 + END IF + + ' Calculate the previous step size + stem = ste - 1 + + ' Update the frame rate and reset the frame counter + frml = frm + frm = 0 +END IF + +' Check for user input +a$ = INKEY$ +IF a$ <> "" THEN + SELECT CASE a$ + CASE "4" + ' Turn left + zmyan = zmyan + .1 + CASE "6" + ' Turn right + zmyan = zmyan - .1 + CASE "8" + ' Look up + myan2 = myan2 + 5 + CASE "2" + ' Look down + myan2 = myan2 - 5 + CASE CHR$(0) + "H" + ' Move forward + zmyx = SIN(zmyan) * 3 + zmyx + zmyy = COS(zmyan) * 3 + zmyy + CASE CHR$(0) + "P" + ' Move backward + zmyx = -SIN(zmyan) * 3 + zmyx + zmyy = -COS(zmyan) * 3 + zmyy + CASE CHR$(0) + "K" + ' Move left + zmyx = COS(zmyan) * 3 + zmyx + zmyy = -SIN(zmyan) * 3 + zmyy + CASE CHR$(0) + "M" + ' Move right + zmyx = -COS(zmyan) * 3 + zmyx + zmyy = SIN(zmyan) * 3 + zmyy + CASE " " + ' Jump up (fly) + zmyzs = 2 + CASE CHR$(13) + ' Toggle full quality + ste = 1 + CASE CHR$(27) + ' Exit the program + SYSTEM + END SELECT +END IF + +' Ensure the player stays within bounds +IF zmyx > 170 THEN + zmyx = 170 +END IF +IF zmyy > 170 THEN + zmyy = 170 +END IF +IF zmyx < 10 THEN + zmyx = 10 +END IF +IF zmyy < 10 THEN + zmyy = 10 +END IF + +' Handle jumping +zmyz = zmyz + zmyzs +zmyzs = zmyzs - .1 + +' Ensure the player does not go below the ground +IF zmyz < landh(myx, myy) + 10 THEN + zmyz = landh(myx, myy) + 10 + ' Adjust jump speed + zmyzs = (zmyzs / 2) + .2 +END IF + +' Update player position +myz = zmyz +myy = zmyy +myx = zmyx +DisplayFrame +GOTO 1 + +SUB CreateTower (towerX%, towerY%) + +' Draw a tower at the specified position +FOR a = 10 TO 0 STEP -1 + ' Fill each level of the tower with color + FillSquareArea towerX% - a, towerY% - a, towerX% + a, towerY% + a, getcol(100, 0, a * 20), 20 - a +NEXT a + +' Draw the top of the tower +FillSquareArea towerX% - 11, towerY% - 11, towerX% - 9, towerY% - 9, getcol(255, 0, 0), 20 +FillSquareArea towerX% + 9, towerY% - 11, towerX% + 11, towerY% - 9, getcol(0, 255, 0), 20 +FillSquareArea towerX% - 11, towerY% + 9, towerX% - 9, towerY% + 11, getcol(0, 0, 255), 20 +FillSquareArea towerX% + 9, towerY% + 9, towerX% + 11, towerY% + 11, getcol(255, 255, 0), 20 + +END SUB + +SUB DisplayFrame + +l = 0 +zst = -.0031 * ste +FOR z = .5 TO -.5 STEP zst + ' Trace a line from the player's perspective + DrawLineFromPlayer SIN(zmyan + z) * dist + myx, COS(zmyan + z) * dist + myy, l + l = l + ste +NEXT z + +END SUB + +SUB DisplayTopDownLandscape + +' Draw the landscape from a top-down perspective +FOR z = 0 TO 180 + zs = 1 + IF z > 120 THEN + ' Adjust the step size for better performance + zs = .7 + END IF + IF z > 160 THEN + ' Further adjust the step size + zs = .6 + END IF + FOR zx = 0 TO 180 STEP zs + y1 = landh(zx, z) - 80 + zx1 = zx - 90 + z1 = 300 - z + zx2 = zx1 / z1 * 190 + zy2 = y1 / z1 * 190 + + ' Draw a line representing the height of the landscape + LINE (zx2 + 160, 40 - zy2)-(zx2 + 160, 200), landc(zx, z) + NEXT zx +NEXT z + +' Display a message to continue +LOCATE 1, 1 +PRINT "Press any key to continue..." + +END SUB + +SUB DrawLineFromPlayer (x%, y%, xl%) + +' Trace a line from the player's perspective +IF x < 0 THEN + ' Calculate the distance to the next point + zpr = myx / (myx - x) + x = 0 + y = myy - ((myy - y) * zpr) +END IF + +IF y < 0 THEN + ' Calculate the distance to the next point + zpr = myy / (myy - y) + y = 0 + x = myx - ((myx - x) * zpr) +END IF + +IF x > 180 THEN + ' Calculate the distance to the next point + zpr = (180 - myx) / (x - myx) + x = 180 + y = myy - ((myy - y) * zpr) +END IF + +IF y > 180 THEN + ' Calculate the distance to the next point + zpr = (180 - myy) / (y - myy) + y = 180 + x = myx - ((myx - x) * zpr) +END IF + +' Calculate the distance to the next point +lp% = SQR(ABS(myx - x) ^ 2 + ABS(myy - y) ^ 2) + +' Save the current player position and orientation +imyx% = myx +imyy% = myy +imyz% = myz +xp% = x - imyx% +yp% = y - imyy% +istem% = stem +imyan2% = myan2 + +' Draw the line +yo% = 200 +FOR a% = 1 TO lp% + cx% = xp% * a% / lp% + imyx% + cy% = yp% * a% / lp% + imyy% + yn% = imyan2% - ((landh(cx%, cy%) - imyz%) / a%) * 300 + + ' Draw the line segment + IF yn% < yo% THEN + LINE (xl%, yn%)-(xl% + istem%, yo% - 1), landc(cx%, cy%), BF + yo% = yn% + END IF +NEXT a% + +' Draw the final line segment +LINE (xl%, yo% - 1)-(xl% + istem%, 0), 0, BF + +END SUB + +SUB FillSquareArea (x1%, y1%, x2%, y2%, c%, h%) + +' Fill a square area with the specified color and height +FOR y = y1 TO y2 + FOR x = x1 TO x2 + landh(x, y) = h + landc(x, y) = c + NEXT x +NEXT y + +END SUB + +SUB GenerateLandscape + +' Create a square landscape +FillSquareArea 0, 0, 180, 180, 15, 0 + +' Generate the landscape height and color +FOR y = 0 TO 180 + FOR x = 0 TO 180 + ' Calculate the checkerboard pattern + x1 = (x \ 10) MOD 2 + y1 = (y \ 10) MOD 2 + c = (x1 + y1) MOD 2 + + IF c = 0 THEN + ' Set the color to blue + landc(x, y) = getcol(0, 0, 250) + ELSE + ' Set the color to gray + landc(x, y) = getcol(50, 50, 50) + END IF + NEXT x +NEXT y + +' Generate a hill +FOR y = 10 TO 90 + FOR x = 90 TO 170 + ' Calculate the height of the hill + v = SQR((ABS(50 - y)) ^ 2 + (ABS(130 - x)) ^ 2) + h = SQR((60 - v) * (60 + v)) - 35 + + ' Ensure the height is positive + IF h > 0 THEN + landh(x, y) = h + END IF + NEXT x +NEXT y + +' Add towers to the landscape +CreateTower 20, 20 +CreateTower 60, 20 +CreateTower 40, 60 + +' Generate a path +FOR y = 100 TO 150 + FOR x = 0 TO 50 + ' Set the color to a dynamic value + landc(x, y) = getcol(SIN((x + y) / 2) * 125 + 125, SIN(x / 2) * 125 + 125, SIN(y / 2) * 125 + 125) + ' Set the height of the path + landh(x, y) = 50 - x + NEXT x +NEXT y + +' Generate a spiral path +FOR za = 0 TO 20 STEP .1 + x = SIN(za) * (1 + (za * 2)) + 100 + y = COS(za) * (1 + (za * 2)) + 100 + + ' Set the color of the spiral path + landc(x, y) = 200 + landc(x + 1, y) = 200 + landc(x, y + 1) = 200 + landc(x + 1, y + 1) = 200 +NEXT za + +END SUB + +DEFSNG A-Y +FUNCTION getcol (r, g, b) +IF r < 0 THEN + ' Ensure the color value is within bounds + r = 0 +END IF +IF g < 0 THEN + g = 0 +END IF +IF b < 0 THEN + b = 0 +END IF +IF r > 255 THEN + r = 255 +END IF +IF g > 255 THEN + g = 255 +END IF +IF b > 255 THEN + b = 255 +END IF +' Calculate the color index +getcol = INT(r / 43) * 36 + INT(g / 43) * 6 + INT(b / 43) +END FUNCTION + +DEFINT A-Y +SUB InitializeProgram +' Set the graphics mode +SCREEN 13 +PRINT "please wait..." + +' Initialize the color palette +SetupPalette + +' Initialize player position and orientation +zmyan = 4.14 +myan2 = 100 +ste = 1 +stem = ste - 1 +dist = 190 +tim$ = TIME$ +zmyx = 170 +zmyy = 170 +zmyz = 20 + +END SUB + +SUB SetupPalette +' Initialize the color palette +c = 0 +FOR r = 0 TO 5 + FOR g = 0 TO 5 + FOR b = 0 TO 5 + OUT &H3C8, c + c = c + 1 + OUT &H3C9, r * 12 + OUT &H3C9, g * 12 + OUT &H3C9, b * 12 + NEXT b + NEXT g +NEXT r +END SUB + diff --git a/3D GFX/Ray casting engine.html b/3D GFX/Ray casting engine.html new file mode 100644 index 0000000..d5184d9 --- /dev/null +++ b/3D GFX/Ray casting engine.html @@ -0,0 +1,16 @@ + +ray casting 3D engine + + + +

ray casting 3D engine

+
+
+3D engine what draws 3D landscape using ray casting alghoritm +in realtime. You can walk/jump around, rotate view and look up and down. +Image Quality will be automatically adjusted, to keep constant framerate. +At least Pentium 200 MHz in DOS mode should be nice. + +
+ + \ No newline at end of file diff --git a/3D GFX/Ray casting engine.png b/3D GFX/Ray casting engine.png new file mode 100644 index 0000000..bc1851d Binary files /dev/null and b/3D GFX/Ray casting engine.png differ diff --git a/3D GFX/Space/Galaxy explorer.bas b/3D GFX/Space/Galaxy explorer.bas new file mode 100755 index 0000000..5a2f74d --- /dev/null +++ b/3D GFX/Space/Galaxy explorer.bas @@ -0,0 +1,347 @@ +' Program to render a 3D point cloud galaxy. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2003, Initial version. +' 2024, Improved program readability. + +' User can navigate through the galaxy using mouse or keyboard controls. +' To use mouse controls, program requires a special TSR (terminate and stay resident) +' program to be loaded. The TSR makes mouse input available to the QBasic program. + +' Navigation controls: +' - Press left and right mouse buttons simultaneously to move in X and Z axis. +' - Press right mouse button to move in Y axis. +' - Use keyboard keys 'a', 'd', 'w', 's' to move in X and Z axis. +' - Press 'q' to quit the program. + +DECLARE SUB temp () +DECLARE SUB mkGalaxy (x!, y!, z!) +DECLARE SUB rndInit () +DECLARE FUNCTION rn! () +DECLARE SUB disp () +DECLARE SUB control () +DECLARE SUB putByte (addr!, dat!) +DECLARE SUB putWord (addr!, dat!) +DECLARE FUNCTION getWord! (addr!) +DECLARE FUNCTION getByte! (addr!) +DECLARE SUB start () +DECLARE SUB animate () + +DIM SHARED angle1, angle2, angle3 + +DIM SHARED time + +DIM SHARED externalSegment, externalAddress + +' Variables for the camera position and movement +DIM SHARED myX, myY, myZ +DIM SHARED speedX, speedY, speedZ +DIM SHARED buttonLeft, buttonRight +DIM SHARED maxMove + +' Variable for zoom level +DIM SHARED zoom + +' Array to store random values +DIM SHARED randomValue(0 TO 10000) +DIM SHARED randomPointer + +' Arrays to store point coordinates and colors. These points make up galaxy. +DIM SHARED pointX(1 TO 12000) +DIM SHARED pointY(1 TO 12000) +DIM SHARED pointZ(1 TO 12000) +DIM SHARED pointColor(1 TO 12000) +DIM SHARED numPoints + +' Temporary register array +DIM SHARED temporaryRegister(0 TO 10) + +newLine = 0 +newPage = 0 + +start + +currentX = 0 +currentY = 0 +currentZ = 0 + +numPoints = 0 +mkGalaxy 0, 0, 0 +1 + +' Generate a random angle for initial camera position +variableAngle = INT(RND * 3) + +SELECT CASE variableAngle +CASE 0 + currentX = RND * 500 - 250 +CASE 1 + currentY = RND * 100 - 50 +CASE 2 + currentZ = RND * 500 - 250 +END SELECT + +control +disp + +PCOPY 0, 1 +CLS +GOTO 1 + +SUB control + +' Check for mouse input +IF getByte(8) <> 0 THEN + putByte 8, 0 + xPosition = getWord(2) + putWord 2, 0 + yPosition = getWord(4) + putWord 4, 0 + button = getWord(6) + putWord 6, 0 + + ' Reset mouse buttons + buttonLeft = 0 + buttonRight = 0 + + ' Handle mouse button states + IF button = 1 THEN buttonLeft = 1 + IF button = 2 THEN buttonRight = 1 + IF button = 3 THEN buttonLeft = 1: buttonRight = 1 + + ' Handle mouse movements + IF buttonRight = 1 THEN + IF buttonLeft = 1 THEN + speedX = speedX + SIN(angle1) * yPosition / 4 + speedZ = speedZ - COS(angle1) * yPosition / 4 + GOTO 3 + END IF + speedY = speedY + yPosition / 4 + 3 + yPosition = 0 + END IF + +END IF + +' Limit the position values to prevent overflow +IF xPosition < -maxMove THEN xPosition = -maxMove +IF xPosition > maxMove THEN xPosition = maxMove +angle1 = angle1 - xPosition / 150 + +IF yPosition < -maxMove THEN yPosition = -maxMove +IF yPosition > maxMove THEN yPosition = maxMove +angle2 = angle2 - yPosition / 150 + +' Check for keyboard input +keyInput$ = INKEY$ + +' Handle keyboard controls +IF keyInput$ = "a" THEN speedX = speedX - COS(angle1): speedZ = speedZ - SIN(angle1) +IF keyInput$ = "d" THEN speedX = speedX + COS(angle1): speedZ = speedZ + SIN(angle1) +IF keyInput$ = "w" THEN speedX = speedX - SIN(angle1): speedZ = speedZ + COS(angle1) +IF keyInput$ = "s" THEN speedX = speedX + SIN(angle1): speedZ = speedZ - COS(angle1) +IF keyInput$ = "q" THEN SYSTEM + +' Decelerate the movement +speedX = speedX / 1.1 +speedY = speedY / 1.1 +speedZ = speedZ / 1.1 + +myX = myX + speedX +myZ = myZ + speedZ +myY = myY + speedY + +END SUB + +SUB disp + +' Calculate sine and cosine values for rotation angles +sinAngle1 = SIN(angle1) +cosAngle1 = COS(angle1) +sinAngle2 = SIN(angle2) +cosAngle2 = COS(angle2) + +' Loop through all points to calculate and display their positions +FOR pointIndex = 1 TO numPoints + + ' Calculate the distance from the camera + xCoordinate = pointX(pointIndex) - myX + yCoordinate = pointY(pointIndex) - myY + zCoordinate = pointZ(pointIndex) - myZ + + ' Rotate the points + rotatedX = xCoordinate * cosAngle1 + zCoordinate * sinAngle1 + rotatedZ = zCoordinate * cosAngle1 - xCoordinate * sinAngle1 + + rotatedY = yCoordinate * cosAngle2 + rotatedZ * sinAngle2 + finalZ = rotatedZ * cosAngle2 - yCoordinate * sinAngle2 + + ' Draw points that are sufficiently close + IF finalZ > 3 THEN + screenX = rotatedX / finalZ * 130 + 160 + screenY = rotatedY / finalZ * 130 + 100 + PSET (screenX, screenY), pointColor(pointIndex) + END IF + +NEXT pointIndex +END SUB + +FUNCTION getByte (address) +getByte = PEEK(externalAddress + address) +END FUNCTION + +FUNCTION getWord (address) +firstByte = PEEK(externalAddress + address) +secondByte = PEEK(externalAddress + address + 1) + +' Combine the two bytes into a single value +combinedHex$ = HEX$(firstByte) +IF LEN(combinedHex$) = 1 THEN combinedHex$ = "0" + combinedHex$ +IF LEN(combinedHex$) = 0 THEN combinedHex$ = "00" + +combinedValue = VAL("&H" + HEX$(secondByte) + combinedHex$) + +getWord = combinedValue +END FUNCTION + +SUB mkGalaxy (localX, localY, localZ) + +' Generate random angles for stars within galaxy +randomAngle1 = rn * 10 +randomAngle2 = rn * 10 + +galaxySin1 = SIN(randomAngle1) +galaxyCos1 = COS(randomAngle1) +galaxySin2 = SIN(randomAngle2) +galaxyCos2 = COS(randomAngle2) + +randomPointer = 0 +size = 100 +piValue = 3.14 +spiralBarsMultiplier = 3 + +FOR pointIndex = 1 TO 10000 + + ' Generate a random star distance from the center + randomVariable = rn * 10 + distanceFromCenter = randomVariable * randomVariable / 30 + + ' Calculate spiral offset and half of it + spiralOffset = rn * (11.5 - randomVariable) / 3 + halfSpiralOffset = spiralOffset / 2 + + ' Generate angle exponent and spiral bar angle + angleExponent = rn * (distanceFromCenter / 2) / spiralBarsMultiplier * 2 + spiralBarAngle = 2 * piValue / spiralBarsMultiplier * INT(rn * spiralBarsMultiplier) + + ' Calculate x, z, and y coordinates + xCoordinate = (SIN(randomVariable - spiralBarAngle + angleExponent) * distanceFromCenter + rn * spiralOffset - halfSpiralOffset) * size + zCoordinate = (COS(randomVariable - spiralBarAngle + angleExponent) * distanceFromCenter + rn * spiralOffset - halfSpiralOffset) * size + yCoordinate = (rn * spiralOffset - halfSpiralOffset) * size + + ' Rotate the coordinates + rotatedX = xCoordinate * galaxyCos1 + zCoordinate * galaxySin1 + rotatedZ = zCoordinate * galaxyCos1 - xCoordinate * galaxySin1 + + rotatedY = yCoordinate * galaxyCos2 + rotatedZ * galaxySin2 + finalZ = rotatedZ * galaxyCos2 - yCoordinate * galaxySin2 + + ' Store the point in arrays + numPoints = numPoints + 1 + + pointX(numPoints) = rotatedX + localX + pointY(numPoints) = rotatedY + localY + pointZ(numPoints) = finalZ + localZ + pointColor(numPoints) = INT(RND * 15) + 1 +NEXT pointIndex + +END SUB + +SUB putByte (address, dataByte) + +POKE (externalAddress + address), dataByte +END SUB + +SUB putWord (address, dataWord) + +' Convert the word to a hexadecimal string +hexValue$ = HEX$(dataWord) + +' Ensure the string has at least 4 characters +2 +IF LEN(hexValue$) < 4 THEN + hexValue$ = "0" + hexValue$: GOTO 2 +END IF + +' Extract the first and second bytes +firstByteValue = VAL("&H" + LEFT$(hexValue$, 2)) +secondByteValue = VAL("&H" + RIGHT$(hexValue$, 2)) + +' Store the bytes in memory +POKE (externalAddress + address), secondByteValue +POKE (externalAddress + address + 1), firstByteValue + +END SUB + +FUNCTION rn + +' Increment the random pointer and get a new random value +randomPointer = randomPointer + 1 +IF randomPointer > 10000 THEN randomPointer = 0 +rn = randomValue(randomPointer) + +END FUNCTION + +SUB rndInit + +' Initialize the array of random values +FOR index = 0 TO 10000 + randomValue(index) = RND +NEXT index + +randomPointer = 0 +END SUB + +SUB start + +starText + +' Set up graphics mode +SCREEN 7, , , 1 + +' Initialize maximum movement and random values +maxMove = 50 +rndInit + +END SUB + +SUB starText + +' Read the segment and address from the interrupt table +DEF SEG = 0 ' read first from interrupt table + +externalSegment = PEEK(&H79 * 4 + 3) * 256 +externalSegment = externalSegment + PEEK(&H79 * 4 + 2) + +PRINT "Segment is: " + HEX$(externalSegment) + +externalAddress = PEEK(&H79 * 4 + 1) * 256 +externalAddress = externalAddress + PEEK(&H79 * 4 + 0) + +PRINT "relative address is:"; externalAddress + +' Read the word at the specified address +DEF SEG = externalSegment + +IF getWord(0) <> 1983 THEN + PRINT "FATAL ERROR: you must load" + PRINT "QBasic extension TSR first!" + SYSTEM +END IF + +END SUB diff --git a/3D GFX/Space/Galaxy explorer.png b/3D GFX/Space/Galaxy explorer.png new file mode 100644 index 0000000..28550e6 Binary files /dev/null and b/3D GFX/Space/Galaxy explorer.png differ diff --git a/3D GFX/Space/Rocket simulator.bas b/3D GFX/Space/Rocket simulator.bas new file mode 100755 index 0000000..deffee8 --- /dev/null +++ b/3D GFX/Space/Rocket simulator.bas @@ -0,0 +1,475 @@ +' 3D rocket simulator. Rocket takes off from the surface of the planet. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2001, Initial version +' 2024 - 2025, Improved program readability +' +' Usage: +' arrow keys - move around +' 2, 6, 4, 8 - look around +' - - fly up +' + - fly down + +DECLARE SUB AddRocketTrailPoints () +DECLARE SUB AddRocketTrailLine () +DEFDBL A-Z +DECLARE SUB GenerateRocket () +DECLARE SUB GenerateEarth () +DECLARE SUB InitializeScene () +DECLARE SUB Render3DScene () + +DIM SHARED pointX(1 TO 1500) +DIM SHARED pointY(1 TO 1500) +DIM SHARED pointZ(1 TO 1500) +DIM SHARED lineStartPoint(1 TO 3000) +DIM SHARED lineEndPoint(1 TO 3000) +DIM SHARED lineColor(1 TO 3000) +DIM SHARED onScreenPointX(1 TO 1900) +DIM SHARED onScreenPointY(1 TO 1900) +DIM SHARED rocketPointX(1 TO 200) +DIM SHARED rocketPointY(1 TO 200) +DIM SHARED rocketPointZ(1 TO 200) +DIM SHARED pointCount, lineCount +DIM SHARED cameraX, cameraY, cameraZ +DIM SHARED cameraXSpeed, cameraYSpeed, cameraZSpeed +DIM SHARED rotationAngleX, rotationAngleY +DIM SHARED oldScreenPointX1(1 TO 2500) +DIM SHARED oldScreenPointY1(1 TO 2500) +DIM SHARED oldScreenPointX2(1 TO 2500) +DIM SHARED oldScreenPointY2(1 TO 2500) +DIM SHARED frameCount, frameCount2, frameRate +DIM SHARED earthRadius, earthStep, rocketScale, rocketStep +DIM SHARED pi +DIM SHARED rocketStartPoint, rocketEndPoint, rocketPointCount +DIM SHARED rocketX, rocketY, rocketZ, rocketXSpeed, rocketYSpeed, rocketZSpeed +DIM SHARED timerString, timeSlice +DIM SHARED lastAddedPoint + +InitializeScene + +rotationAngleX = -pi / 2 + +' Initialize the rocket position and velocity +rocketX = 0 +rocketY = earthRadius / 2 + .009 +rocketZ = 0 +cameraX = 0 +cameraY = earthRadius / 2 +cameraZ = -.05 +timeSlice = 0 +frameCount2 = 999999 +timerString$ = TIME$ + +1 +frameCount = frameCount + 1 +frameCount2 = frameCount2 + 1 + +' Display the current values of some variables +LOCATE 1, 1 +PRINT pointCount, lineCount, earthRadius, earthStep +LOCATE 2, 1 +PRINT rocketStartPoint, rocketEndPoint, TIMER + +' Update rocket position and velocity +rocketX = rocketX + (rocketXSpeed * timeSlice) +rocketY = rocketY + (rocketYSpeed * timeSlice) +rocketZ = rocketZ + (rocketZSpeed * timeSlice) + +' Update the rocket's pitch and roll rates +rocketYSpeed = rocketYSpeed + (.0098 * timeSlice) +rocketXSpeed = SIN(frameCount / 20) / 50 + +' Update the points that make up the rocket +FOR a = 1 TO rocketPointCount + pointX(a + rocketStartPoint - 1) = rocketPointX(a) + rocketX + pointY(a + rocketStartPoint - 1) = rocketPointY(a) + rocketY + pointZ(a + rocketStartPoint - 1) = rocketPointZ(a) + rocketZ +NEXT a + +' Update the observer position and velocity +cameraX = cameraX + (cameraXSpeed * timeSlice) +cameraY = cameraY + (cameraYSpeed * timeSlice) +cameraZ = cameraZ + (cameraZSpeed * timeSlice) + +' Draw the 3D scene +Render3DScene + +' Handle user input +a$ = INKEY$ +IF a$ <> "" THEN + IF a$ = CHR$(0) + "H" THEN + ' Move forward + cameraZSpeed = cameraZSpeed - SIN(rotationAngleX) / 100 + cameraXSpeed = cameraXSpeed + COS(rotationAngleX) / 100 + END IF + IF a$ = CHR$(0) + "P" THEN + ' Move backward + cameraZSpeed = cameraZSpeed + SIN(rotationAngleX) / 100 + cameraXSpeed = cameraXSpeed - COS(rotationAngleX) / 100 + END IF + IF a$ = CHR$(0) + "M" THEN + ' Move right + cameraZSpeed = cameraZSpeed + COS(rotationAngleX) / 100 + cameraXSpeed = cameraXSpeed + SIN(rotationAngleX) / 100 + END IF + IF a$ = CHR$(0) + "K" THEN + ' Move left + cameraZSpeed = cameraZSpeed - COS(rotationAngleX) / 100 + cameraXSpeed = cameraXSpeed - SIN(rotationAngleX) / 100 + END IF + ' Change the viewing angle + IF a$ = CHR$(27) THEN SYSTEM + IF a$ = "4" THEN rotationAngleX = rotationAngleX + .1 + IF a$ = "6" THEN rotationAngleX = rotationAngleX - .1 + IF a$ = "2" THEN rotationAngleY = rotationAngleY + .1 + IF a$ = "8" THEN rotationAngleY = rotationAngleY - .1 + IF a$ = "-" THEN cameraYSpeed = cameraYSpeed + .01 + IF a$ = "+" THEN cameraYSpeed = cameraYSpeed - .01 + IF a$ = " " THEN cameraZSpeed = cameraZSpeed / 2: cameraXSpeed = cameraXSpeed / 2 +END IF + +' Calculate the speed and distance of the rocket +v = SQR(rocketX * rocketX + rocketY * rocketY + rocketZ * rocketZ) +s = SQR(rocketXSpeed * rocketXSpeed + rocketYSpeed * rocketYSpeed + rocketZSpeed * rocketZSpeed) + +' Display the current frame rate and other information +IF timerString$ <> TIME$ THEN + timerString$ = TIME$ + LOCATE 29, 1 + PRINT "speed"; INT(s * 1000) + LOCATE 30, 1 + PRINT "fps"; frameRate; "timeslice"; INT(timeSlice * 1000); "distance"; v; + ' Update the frame rate and time slice + frameRate = frameCount2 + timeSlice = 1 / frameRate + frameCount2 = 0 + ' Add new points to the scene + AddRocketTrailPoints + AddRocketTrailLine +END IF +GOTO 1 + +SUB AddRocketTrailLine +' Adds a new line to the scene to represent the rocket's trail. +' It connects the current rocket position to the last added point, if any. +pointCount = pointCount + 1 +pointX(pointCount) = rocketX +pointY(pointCount) = rocketY +pointZ(pointCount) = rocketZ + +' If there was a previous point, add a line connecting the previous point to the current point +IF lastAddedPoint > 0 THEN + lineCount = lineCount + 1 + lineStartPoint(lineCount) = lastAddedPoint + lineEndPoint(lineCount) = pointCount + lineColor(lineCount) = 13 +END IF +lastAddedPoint = pointCount +END SUB + +SUB AddRocketTrailPoints +' Adds new points to the scene to represent the rocket's trail. +' It adds three points forming a triangle to visualize the rocket's position. +pointCount = pointCount + 1 +pointX(pointCount) = rocketX +pointY(pointCount) = rocketY +pointZ(pointCount) = rocketZ + +pointCount = pointCount + 1 +pointX(pointCount) = rocketX - .001 +pointY(pointCount) = rocketY - .001 +pointZ(pointCount) = rocketZ + +pointCount = pointCount + 1 +pointX(pointCount) = rocketX + .001 +pointY(pointCount) = rocketY - .001 +pointZ(pointCount) = rocketZ + +' Add lines connecting these points to form a triangle +lineCount = lineCount + 1 +lineStartPoint(lineCount) = pointCount +lineEndPoint(lineCount) = pointCount - 1 +lineColor(lineCount) = 14 + +lineCount = lineCount + 1 +lineStartPoint(lineCount) = pointCount - 2 +lineEndPoint(lineCount) = pointCount - 1 +lineColor(lineCount) = 14 + +lineCount = lineCount + 1 +lineStartPoint(lineCount) = pointCount +lineEndPoint(lineCount) = pointCount - 2 +lineColor(lineCount) = 14 +END SUB + +SUB GenerateEarth +' Generates the points that make up the earth. +' It uses nested loops to create points in a spherical shape for the earth +' and adds lines to connect these points to form the earth's surface. +tmpp = pointCount +le2 = 0 +FOR z = -(earthRadius / 3) TO (earthRadius / 3) STEP earthStep + le = 0 + le2 = le2 + 1 + FOR x = -(earthRadius / 3) TO (earthRadius / 3) STEP earthStep + ' Check if the point is within the rocket's radius + IF SQR(x * x + z * z) > (earthRadius / 2.5) THEN GOTO 4 + le = le + 1 + ' Add the first point of the line + IF le = 1 THEN + xs = x / earthStep + END IF + pointCount = pointCount + 1 + pointX(pointCount) = x + v = SQR(x * x + z * z) + pointY(pointCount) = SQR((v + (earthRadius / 2)) * ((earthRadius / 2) - v)) + pointZ(pointCount) = z + ' Add the line to the list of lines + IF le > 1 THEN + lineCount = lineCount + 1 + lineStartPoint(lineCount) = pointCount + lineEndPoint(lineCount) = pointCount - 1 + lineColor(lineCount) = 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 / earthStep) THEN GOTO 4 + IF xso + leo <= (x / earthStep) THEN GOTO 4 + lineCount = lineCount + 1 + lineStartPoint(lineCount) = pointCount + lineEndPoint(lineCount) = pointCount - leo - xso + xs + lineColor(lineCount) = 3 + END IF +4 + NEXT x + ' Update the variables for the next circle + leo = le + xso = xs +NEXT z +END SUB + +SUB GenerateRocket +' Generates the points that make up the rocket. +' It uses loops to create points in a cylindrical shape for the rocket body +' and adds lines to connect these points to form the rocket's structure. +' It also adds points and lines for the top and bottom of the rocket. +s = 50 +FOR y = -9 TO 10 STEP rocketStep + 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 + pointCount = pointCount + 1 + pointX(pointCount) = x1 * rocketScale + pointY(pointCount) = y * 50 * rocketScale + pointZ(pointCount) = z1 * rocketScale + ' Add the line to the list of lines + IF a > 0 THEN + lineCount = lineCount + 1 + lineStartPoint(lineCount) = pointCount + lineEndPoint(lineCount) = pointCount - 1 + lineColor(lineCount) = 10 + END IF + ' Add the line to the list of lines if it is part of a circle + IF y > -9 THEN + lineCount = lineCount + 1 + lineStartPoint(lineCount) = pointCount + lineEndPoint(lineCount) = pointCount - 7 + lineColor(lineCount) = 10 + END IF + NEXT a +NEXT y + +' Add the points that make up the top of the rocket +pointCount = pointCount + 1 +pointX(pointCount) = 0 +pointY(pointCount) = 11 * 50 * rocketScale +pointZ(pointCount) = 0 +FOR a = 1 TO 6 + lineCount = lineCount + 1 + lineStartPoint(lineCount) = pointCount + lineEndPoint(lineCount) = pointCount - a + lineColor(lineCount) = 10 +NEXT a + +' Add the points that make up the bottom of the rocket +pointCount = pointCount + 1 +pointX(pointCount) = -100 * rocketScale +pointY(pointCount) = -450 * rocketScale +pointZ(pointCount) = 0 +pointCount = pointCount + 1 +pointX(pointCount) = 100 * rocketScale +pointY(pointCount) = -450 * rocketScale +pointZ(pointCount) = 0 +pointCount = pointCount + 1 +pointX(pointCount) = 0 +pointY(pointCount) = -200 * rocketScale +pointZ(pointCount) = 0 +lineCount = lineCount + 1 +lineStartPoint(lineCount) = pointCount +lineEndPoint(lineCount) = pointCount - 1 +lineColor(lineCount) = 12 +lineCount = lineCount + 1 +lineStartPoint(lineCount) = pointCount - 2 +lineEndPoint(lineCount) = pointCount - 1 +lineColor(lineCount) = 12 +lineCount = lineCount + 1 +lineStartPoint(lineCount) = pointCount +lineEndPoint(lineCount) = pointCount - 2 +lineColor(lineCount) = 12 +pointCount = pointCount + 1 +pointX(pointCount) = 0 +pointY(pointCount) = -450 * rocketScale +pointZ(pointCount) = -100 * rocketScale +pointCount = pointCount + 1 +pointX(pointCount) = 0 +pointY(pointCount) = -450 * rocketScale +pointZ(pointCount) = 100 * rocketScale +lineCount = lineCount + 1 +lineStartPoint(lineCount) = pointCount +lineEndPoint(lineCount) = pointCount - 1 +lineColor(lineCount) = 12 +lineCount = lineCount + 1 +lineStartPoint(lineCount) = pointCount - 2 +lineEndPoint(lineCount) = pointCount - 1 +lineColor(lineCount) = 12 +lineCount = lineCount + 1 +lineStartPoint(lineCount) = pointCount +lineEndPoint(lineCount) = pointCount - 2 +lineColor(lineCount) = 12 +END SUB + +SUB InitializeScene +' Initializes the graphics mode and sets up the initial scene. +' It sets up the screen, initializes variables, adds initial points and lines, +' and calls subroutines to generate the earth and the rocket. +SCREEN 12 +VIEW PRINT 1 TO 30 +earthRadius = 12714 +earthStep = 500 +rocketStep = 4 +pi = 3.142657 +rocketScale = .00002 +frameCount2 = 0 +lastAddedPoint = -1 +pointX(1) = -.001 +pointY(1) = earthRadius / 2 +pointZ(1) = -.001 +pointX(2) = .001 +pointY(2) = earthRadius / 2 +pointZ(2) = -.001 +pointX(3) = .001 +pointY(3) = earthRadius / 2 +pointZ(3) = .001 +pointX(4) = -.001 +pointY(4) = earthRadius / 2 +pointZ(4) = .001 +pointCount = 4 + +' Set up the initial lines that make up the rocket +lineStartPoint(1) = 1 +lineEndPoint(1) = 2 +lineColor(1) = 14 +lineStartPoint(2) = 2 +lineEndPoint(2) = 3 +lineColor(2) = 14 +lineStartPoint(3) = 3 +lineEndPoint(3) = 4 +lineColor(3) = 14 +lineStartPoint(4) = 4 +lineEndPoint(4) = 1 +lineColor(4) = 14 +lineCount = 4 + +' Initialize the observer position and velocity +cameraX = 0 +cameraY = earthRadius * 2 +cameraZ = -35 +GenerateEarth +cameraXSpeed = 0 +cameraYSpeed = 0 +cameraZSpeed = 0 +rotationAngleX = 0 +rocketStartPoint = pointCount + 1 +GenerateRocket +rocketEndPoint = pointCount + +' Calculate the number of points that make up the rocket +rocketPointCount = rocketEndPoint - rocketStartPoint + 1 + +' Copy the initial points to the arrays for the rocket +FOR a = 1 TO rocketPointCount + p = rocketStartPoint + a - 1 + rocketPointX(a) = pointX(p) + rocketPointY(a) = pointY(p) + rocketPointZ(a) = pointZ(p) +NEXT a +END SUB + +SUB Render3DScene +' Converts the 3D points to 2D for drawing on the screen. +' It applies rotation transformations and projects the 3D points to 2D screen coordinates. +' It then draws lines connecting the points if they are within the screen boundaries. +s1 = SIN(rotationAngleX) +c1 = COS(rotationAngleX) +s2 = SIN(rotationAngleY) +c2 = COS(rotationAngleY) +FOR a = 1 TO pointCount + x = pointX(a) - cameraX + y = pointY(a) - cameraY + z = pointZ(a) - cameraZ + ' 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 + onScreenPointX(a) = -1 + ELSE + onScreenPointX(a) = x1 / z2 * 200 + 320 + onScreenPointY(a) = 240 - y1 / z2 * 200 + ' Check if the point is within the screen boundaries + IF onScreenPointX(a) < -50 OR onScreenPointX(a) > 1000 OR onScreenPointY(a) > 1000 THEN + onScreenPointX(a) = -1 + END IF + END IF +NEXT a + +' Draw the lines that make up the rocket +FOR a = 1 TO lineCount + p1 = lineStartPoint(a) + p2 = lineEndPoint(a) + x1 = onScreenPointX(p1) + y1 = onScreenPointY(p1) + x2 = onScreenPointX(p2) + y2 = onScreenPointY(p2) + ' Check if the line is within the screen boundaries. + ' If so, erase line at old locations + IF oldScreenPointX1(a) = -1 OR oldScreenPointX2(a) = -1 THEN + ELSE + LINE (oldScreenPointX1(a), oldScreenPointY1(a))-(oldScreenPointX2(a), oldScreenPointY2(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), lineColor(a) + END IF + ' Update the old endpoints of the line for the next frame + oldScreenPointX1(a) = x1 + oldScreenPointY1(a) = y1 + oldScreenPointX2(a) = x2 + oldScreenPointY2(a) = y2 +NEXT a +END SUB + diff --git a/3D GFX/Space/Rocket simulator.webm b/3D GFX/Space/Rocket simulator.webm new file mode 100644 index 0000000..7e10602 Binary files /dev/null and b/3D GFX/Space/Rocket simulator.webm differ diff --git a/3D GFX/Space/Stars.bas b/3D GFX/Space/Stars.bas new file mode 100755 index 0000000..b9f9bf1 --- /dev/null +++ b/3D GFX/Space/Stars.bas @@ -0,0 +1,142 @@ +' 3D Starfield Simulation.0 +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.03, Initial version +' 2024 - 2025, Improved code readability + +DECLARE SUB AddStar (xPosition AS SINGLE, yPosition AS SINGLE, zPosition AS SINGLE) +DECLARE SUB CreateGalaxy () + +Dim Shared totalStars As Integer +Dim Shared maxStars As Integer + +Randomize Timer +maxStars = 2000 +totalStars = maxStars +starFieldDepth = 500 + +Dim Shared starXPositions(1 To maxStars + 1000) As Single +Dim Shared starYPositions(1 To maxStars + 1000) As Single +Dim Shared starZPositions(1 To maxStars + 1000) As Single + +' Initialize the positions of the stars +For starIndex = 1 To totalStars + starZPositions(starIndex) = Rnd * starFieldDepth + 20 + angle = Rnd * 100 + starXPositions(starIndex) = Sin(angle) * 20 + starYPositions(starIndex) = Cos(angle) * 20 +Next starIndex + +Screen 13 + + +Do + + ' Calculate the camera's rotation and position offsets + frameCount = frameCount + 1 + cameraRotation = (3.1412 / 2) + Sin(frameCount / 35) / 100 + Sin(frameCount / 21) / 100 + rs1 = Sin(cameraRotation) + rc1 = Cos(cameraRotation) + + ' Update and draw each star + For starIndex = 1 To totalStars + x = starXPositions(starIndex) + y = starYPositions(starIndex) + z = starZPositions(starIndex) + + ' Project the star's 3D position onto the 2D screen + projectedX = (x / z) * 160 + 160 + projectedY = (y / z) * 100 + 100 + PSet (projectedX, projectedY), 0 ' Erase the previous position + + ' Rotate the star's position around the camera + x5 = x * rs1 - y * rc1 + y5 = x * rc1 + y * rs1 + + ' Update the star's position with camera movement + x = x5 + Sin(frameCount / 21) * 3 + y = y5 + Sin(frameCount / 18) * 3 + + ' Move the star closer to the viewer and wrap around if too close + z = z - 3 + If z < 10 Then + z = Rnd * 300 + 400 + x = Rnd * 800 - 400 + y = Rnd * 800 - 400 + End If + + ' Project the new position and draw with perspective-based brightness + projectedX = (x / z) * 160 + 160 + projectedY = (y / z) * 100 + 100 + colorCode = 3000 / z + 15 + If colorCode > 31 Then colorCode = 31 + PSet (projectedX, projectedY), colorCode + + ' Update the star's array positions + starXPositions(starIndex) = x + starYPositions(starIndex) = y + starZPositions(starIndex) = z + Next starIndex + + ' Add new stars to the galaxy if needed + If maxStars - totalStars > Rnd * 800 + 100 Then CreateGalaxy: totalStars = totalStars + 1 + + ' Remove the two farthest stars and replace them with new ones + For a = 1 To 2 + starIndex = Int(Rnd * (totalStars - 10)) + 1 + Swap starXPositions(totalStars), starXPositions(starIndex) + Swap starYPositions(totalStars), starYPositions(starIndex) + Swap starZPositions(totalStars), starZPositions(starIndex) + + x = starXPositions(totalStars) + y = starYPositions(totalStars) + z = starZPositions(totalStars) + projectedX = (x / z) * 160 + 160 + projectedY = (y / z) * 100 + 100 + PSet (projectedX, projectedY), 0 ' Erase the star + totalStars = totalStars - 1 + Next a + + + ' Check for user input to exit the program + If InKey$ <> "" Then System + + ' sleep, to limit framerate + Sound 0, 1 +Loop + +' Subroutine to create a new galaxy of stars +Sub CreateGalaxy + xForce = Rnd * 4 - 2 + yForce = Rnd * 4 - 2 + xPositionOffset = Rnd * 200 - 100 + yPositionOffset = Rnd * 200 - 100 + + ' Add a new set of stars with varying positions and velocities + For starIndex = 1 To Int(Rnd * 15) + 10 Step .04 + x = Sin(starIndex) * starIndex * starIndex / 10 + y = Cos(starIndex) * starIndex * starIndex / 10 + AddStar x + RND * starIndex * starIndex / 30 + xPositionOffset, _ + y + RND * starIndex * starIndex / 30 + yPositionOffset, _ + 700 + RND * starIndex * starIndex / 30 + (x * xForce) + (y * yForce) + Next starIndex + + ' Play a sound when creating new stars (commented out) + ' SOUND 1000, 1 +End Sub + +' Subroutine to add a new star at the specified position +Sub AddStar (xPosition As Single, yPosition As Single, zPosition As Single) + totalStars = totalStars + 1 + starIndex = totalStars + + starXPositions(starIndex) = xPosition + starYPositions(starIndex) = yPosition + starZPositions(starIndex) = zPosition +End Sub + diff --git a/3D GFX/Space/Stars.webm b/3D GFX/Space/Stars.webm new file mode 100644 index 0000000..39cd97e Binary files /dev/null and b/3D GFX/Space/Stars.webm differ diff --git a/3D GFX/Space/Universe explorer/1.png b/3D GFX/Space/Universe explorer/1.png new file mode 100644 index 0000000..ca51227 Binary files /dev/null and b/3D GFX/Space/Universe explorer/1.png differ diff --git a/3D GFX/Space/Universe explorer/2.png b/3D GFX/Space/Universe explorer/2.png new file mode 100644 index 0000000..1b73573 Binary files /dev/null and b/3D GFX/Space/Universe explorer/2.png differ diff --git a/3D GFX/Space/Universe explorer/3.png b/3D GFX/Space/Universe explorer/3.png new file mode 100644 index 0000000..1633045 Binary files /dev/null and b/3D GFX/Space/Universe explorer/3.png differ diff --git a/3D GFX/Space/Universe explorer/Universe explorer.bas b/3D GFX/Space/Universe explorer/Universe explorer.bas new file mode 100755 index 0000000..7fbbc9d --- /dev/null +++ b/3D GFX/Space/Universe explorer/Universe explorer.bas @@ -0,0 +1,731 @@ +' 3D Universe Explorer. User can freely fly around. +' Universe is made of galaxy clusters. +' Galaxy cluster is made of galaxies. +' Galaxies are made of stars. + +' Total amount of stars in the universe is enormous. +' This program implements clever algorithm to dynamically increase +' and decrease level of detail of the universe regions depending +' on where user is in the universe and maintaining reasonable +' quantity of stars to render at any given time. + +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' +' +' Changelog: +' 2003.12, Initial version +' 2024, Improved program readability + +DECLARE SUB loadScript (scriptName$) + +DECLARE SUB timerAdd (element!, time!, value!) +DECLARE SUB timerinit () +DECLARE SUB timerprocess () + +DECLARE SUB getCloudXYZ (a!, x1!, y1!, z2!) +DECLARE FUNCTION gdist! (x!, y!, z!) +DECLARE SUB mkworld () +DECLARE SUB galacloud (rx!, ry!, rz!) +DECLARE SUB temp () +DECLARE SUB mkgalaxy (x!, y!, z!) +DECLARE SUB rndinit () +DECLARE FUNCTION rn! () +DECLARE SUB disp () +DECLARE SUB startext () +DECLARE SUB control () +DECLARE SUB putbyte (addr!, dat!) +DECLARE SUB putword (addr!, dat!) +DECLARE FUNCTION getword! (addr!) +DECLARE FUNCTION getbyte! (addr!) +DECLARE SUB start () +DECLARE SUB animate () + +DIM SHARED an1, an2, an3 + +DIM SHARED tim + +DIM SHARED extSEG, extADDR + +' User position in the universe +DIM SHARED myx, myy, myz +' User velocity in the universe +DIM SHARED myxs, myys, myzs +' User pressed mouse buttons +DIM SHARED buttL, buttR +' Maximum user movement speed +DIM SHARED maxmove + +' Zoom level +DIM SHARED zoom +DIM SHARED rndval(0 TO 10000) +DIM SHARED rndp + +' Star positions and colors +DIM SHARED px(1 TO 10000), py(1 TO 10000), pz(1 TO 10000) +DIM SHARED pc(1 TO 10000) +' Total number of stars +DIM SHARED nump +' User speed multiplier +DIM SHARED myspd + +DIM SHARED tempr(0 TO 10) + +DIM SHARED vd + +DIM SHARED oftcloud(0 TO 3) + +' Galaxy positions +DIM SHARED oftGalaX(0 TO 19), oftGalaY(0 TO 19), oftGalaZ(0 TO 19) + +DIM SHARED timerTime(0 TO 50, 0 TO 100) +DIM SHARED timerValue(0 TO 50, 0 TO 100) + +DIM SHARED timerCplace(0 TO 50) +DIM SHARED timerCtime(0 TO 50) +DIM SHARED timerCvalue(0 TO 50) +DIM SHARED timerLast + +DIM SHARED timerStartScript +DIM SHARED ScriptRunning + +start + +cx = 0 +cy = 0 +cz = 0 + +myx = 123456 +myy = 321 +myz = 23 + +nump = 9999 +1 +' Initialize the universe +mkworld + +va = INT(RND * 3) + +SELECT CASE va +CASE 0 + cx = RND * 500 - 250 +CASE 1 + cy = RND * 100 - 50 +CASE 2 + cz = RND * 500 - 250 +END SELECT + +' Handle user input and movement +control + +' Display the universe +disp + +' Process timers for scripted movements +timerprocess + +' Copy screen buffer to main screen +PCOPY 0, 1 + +' Clear the screen +CLS + +' Loop back to start +GOTO 1 + +SUB control + +' Handle mouse input +IF getbyte(8) <> 0 THEN + putbyte 8, 0 + xp = getword(2) + putword 2, 0 + yp = getword(4) + putword 4, 0 + butt = getword(6) + putword 6, 0 + + ' Determine which mouse buttons are pressed + buttL = 0 + buttR = 0 + IF butt = 1 THEN buttL = 1 + IF butt = 2 THEN buttR = 1 + IF butt = 3 THEN buttL = 1: buttR = 1 + + ' Handle right mouse button for up/down movement + IF buttR = 1 THEN + ' Handle both buttons pressed for back/front movement + IF buttL = 1 THEN + myxs = myxs + SIN(an1) * yp / 4 + myzs = myzs - COS(an1) * yp / 4 + GOTO 3 + END IF + + ' Handle right button for up/down movement + myys = myys + yp / 4 +3 + yp = 0 + END IF + +END IF + +' Clamp user input to maximum movement speed +IF xp < -maxmove THEN xp = -maxmove +IF xp > maxmove THEN xp = maxmove +an1 = an1 - xp / 150 + +IF yp < -maxmove THEN yp = -maxmove +IF yp > maxmove THEN yp = maxmove +an2 = an2 - yp / 150 + +' Handle keyboard input for movement +a$ = INKEY$ + +IF a$ = "a" THEN myxs = myxs - COS(an1): myzs = myzs - SIN(an1) +IF a$ = "d" THEN myxs = myxs + COS(an1): myzs = myzs + SIN(an1) +IF a$ = "w" THEN myxs = myxs - SIN(an1): myzs = myzs + COS(an1) +IF a$ = "s" THEN myxs = myxs + SIN(an1): myzs = myzs - COS(an1) + +' Handle keyboard input for speed multiplier +IF a$ = "1" THEN myspd = .1 +IF a$ = "2" THEN myspd = 1 +IF a$ = "3" THEN myspd = 10 +IF a$ = "4" THEN myspd = 100 +IF a$ = "5" THEN myspd = 1000 +IF a$ = "6" THEN myspd = 10000 +IF a$ = "7" THEN myspd = 100000 +IF a$ = "8" THEN myspd = 1000000 + +' Handle keyboard input for quitting the program +IF a$ = "q" THEN SYSTEM + +' Handle keyboard input for recording script +IF a$ = " " THEN + IF timerStartScript = 0 THEN + OPEN "script.dat" FOR OUTPUT AS #1 + timerStartScript = TIMER + END IF + PRINT #1, TIMER - timerStartScript + PRINT #1, myx; myy; myz; an1; an2 + SOUND 2000, .1 +END IF + +' Handle keyboard input for playing script +IF a$ = "r" THEN + IF ScriptRunning = 0 THEN + timerinit + loadScript "script.dat" + ELSE + ScriptRunning = 0 + END IF +END IF + +' Friction to dampen movement speed over time +myxs = myxs / 1.1 +myys = myys / 1.1 +myzs = myzs / 1.1 + +' Update user position based on velocity and speed multiplier +myx = myx + myxs * myspd +myz = myz + myzs * myspd +myy = myy + myys * myspd + +' Apply scripted movement if running +IF ScriptRunning = 1 THEN + myx = timerCvalue(1) + myy = timerCvalue(2) + myz = timerCvalue(3) + an1 = timerCvalue(4) + an2 = timerCvalue(5) +END IF + +END SUB + +SUB disp + +' Calculate sine and cosine for rotation +s1 = SIN(an1) +c1 = COS(an1) +s2 = SIN(an2) +c2 = COS(an2) + +' Initialize view distance +vdn = 100000000 + +' Loop through all stars to calculate their positions +FOR a = 1 TO nump + + ' Calculate star position relative to user + x = px(a) - myx + y = py(a) - myy + z = pz(a) - myz + + ' Update view distance if star is closer + IF ABS(x) < vdn THEN + IF ABS(y) < vdn THEN + IF ABS(z) < vdn THEN vdn = SQR(x * x + y * y + z * z) + END IF + END IF + + ' Rotate star position based on user orientation + x1 = x * c1 + z * s1 + z1 = z * c1 - x * s1 + + y1 = y * c2 + z1 * s2 + z2 = z1 * c2 - y * s2 + + ' Draw star if it is within view distance + IF z2 > 3 THEN + PSET (x1 / z2 * 130 + 160, y1 / z2 * 130 + 100), pc(a) + END IF + +NEXT a + +' Update average view distance +vd = (vd * 5 + vdn) / 6 + +END SUB + +SUB galacloud (rx, ry, rz) + +' Generate random cloud position +a = INT(RND * 100) +d = (a + 30) * 500 + +x = d +y = 0 +z = 0 + +' Calculate sine and cosine for rotation +a1 = SIN(a * (123.45 - (rx MOD 1235))) * 100 +a2 = SIN(a * 324 + (ry MOD 5431)) * 120 + +s1 = SIN(a1) +c1 = COS(a1) +s2 = SIN(a2) +c2 = COS(a2) + +' Rotate cloud position based on user orientation +x1 = x * c1 + z * s1 +z1 = z * c1 - x * s1 + +y1 = y * c2 + z1 * s2 +z2 = z1 * c2 - y * s2 + +' Calculate distance from cloud to user +fx = x1 + rx +fy = y1 + ry +fz = z2 + rz +dist = gdist(fx, fy, fz) + +' Add cloud to galaxy list if within view distance +IF dist < 20000 THEN + pl = INT(RND * 20) + oftGalaX(pl) = fx + oftGalaY(pl) = fy + oftGalaZ(pl) = fz + mkgalaxy fx, fy, fz +ELSE + ' Add cloud to galaxy list if random or view distance is high + IF (RND * 100 < 10) OR (vd > 500000) THEN + mkgalaxy fx, fy, fz + END IF +END IF + +END SUB + +FUNCTION gdist (x, y, z) +' Calculate distance from user to given coordinates +gdist = SQR((x - myx) ^ 2 + (y - myy) ^ 2 + (z - myz) ^ 2) + +END FUNCTION + +FUNCTION getbyte (addr) +' Retrieve byte value at given RAM address +getbyte = PEEK(extADDR + addr) + +END FUNCTION + +SUB getCloudXYZ (a, x1, y1, z2) + +d = a * 1000000 + +x = d +y = 0 +z = 0 + +' Calculate sine and cosine for rotation +a1 = SIN(a * 123) * 100 +a2 = SIN(a * 975) * 120 + +s1 = SIN(a1) +c1 = COS(a1) +s2 = SIN(a2) +c2 = COS(a2) + +' Rotate cloud position based on user orientation +x1 = x * c1 + z * s1 +z1 = z * c1 - x * s1 + +y1 = y * c2 + z1 * s2 +z2 = z1 * c2 - y * s2 + +END SUB + +FUNCTION getword (addr) +' Retrieve word value at given RAM address +a = PEEK(extADDR + addr) +b = PEEK(extADDR + addr + 1) + +c$ = HEX$(a) +IF LEN(c$) = 1 THEN c$ = "0" + c$ +IF LEN(c$) = 0 THEN c$ = "00" + +c = VAL("&H" + HEX$(b) + c$) + +getword = c + +END FUNCTION + +SUB loadScript (scriptName$) +' Load script from file and start playback +ScriptRunning = 1 +rt = 2 + +OPEN scriptName$ FOR INPUT AS #2 + +5 +IF EOF(2) <> 0 THEN GOTO 6 + +INPUT #2, t +t = t / 2 +rt = rt + 6 +FOR a = 1 TO 5 + INPUT #2, b + timerAdd a, rt, b +NEXT a + +GOTO 5 + +6 +CLOSE #2 + +' Reset all timers to -1 +FOR a = 1 TO 5 + timerAdd a, -1, b +NEXT a + +END SUB + +SUB mkgalaxy (lx, ly, lz) + +' Skip galaxy generation if position is zero +IF (lx = 0) AND (ly = 0) AND (lz = 0) THEN GOTO 4 + +' Generate random seed for galaxy +rndp = ABS(lx + ly + lz) MOD 9000 +n1 = rn * 100 +n2 = rn * 100 +n3 = rn * 100 + +' Calculate sine and cosine for rotation +gs1 = SIN(n1) +gc1 = COS(n1) +gs2 = SIN(n2) +gc2 = COS(n2) +gs3 = SIN(n3) +gc3 = COS(n3) + +' Calculate galaxy size and temperature +siz = rn * 50 + 75 +pi = 3.14 +sbm = INT(rn * 3) + 1 + +' Calculate distance from galaxy to user +dist = gdist(lx, ly, lz) + +' Determine number of stars based on distance +amo = 1 +IF dist < 20000 THEN amo = 1 +IF dist < 5000 THEN amo = 2 +IF dist < 1000 THEN amo = 10 +IF dist < 500 THEN amo = 50 + +' Generate stars in galaxy +FOR a = 1 TO amo + + ' Calculate random values for star position + b = RND * 10 + s = b * b / 30 + + v1 = RND * (11.5 - b) / 3 + v1p = v1 / 2 + + ane = RND * (s / 2) / sbm * 2 + sba = 2 * pi / sbm * INT(RND * sbm) + + x = (SIN(b - sba + ane) * s + RND * v1 - v1p) * siz + z = (COS(b - sba + ane) * s + RND * v1 - v1p) * siz + y = (RND * v1 - v1p) * siz + + ' Rotate star position based on galaxy orientation + x1 = x * gc1 + z * gs1 + z1 = z * gc1 - x * gs1 + + y1 = y * gc2 + z1 * gs2 + z2 = z1 * gc2 - y * gs2 + + y2 = y1 * gc3 + x1 * gs3 + x2 = x1 * gc3 - y1 * gs3 + + ' Add star to universe + pla = INT(RND * nump) + 1 + + px(pla) = x2 + lx + py(pla) = y2 + ly + pz(pla) = z2 + lz + pc(pla) = INT(RND * 15) + 1 + +NEXT a + +4 +END SUB + +SUB mkworld + +' Generate initial galaxy clusters +FOR b = 1 TO 10 + a = INT(RND * 100) + getCloudXYZ a, x, y, z + + ' Add cloud to galaxy list if within view distance + IF gdist(x, y, z) < vd * 3 THEN oftcloud(INT(RND * 4)) = a + + ' Generate galaxy cluster at cloud position + galacloud x, y, z +NEXT b + +' Add additional galaxy clusters if view distance is high +IF vd < 4000000 THEN + FOR b = 0 TO 3 + a = oftcloud(b) + getCloudXYZ a, x, y, z + + ' Generate galaxy cluster at cloud position + galacloud x, y, z + NEXT b +END IF + +' Add galaxies to universe if view distance is low +IF vd < 10000 THEN + + FOR b = 0 TO 19 + x = oftGalaX(b) + y = oftGalaY(b) + z = oftGalaZ(b) + + ' Generate galaxy at given position + mkgalaxy x, y, z + NEXT b + +ELSE +END IF + +END SUB + +SUB putbyte (addr, dat) + +' Store byte value at given RAM address +POKE (extADDR + addr), dat + +END SUB + +SUB putword (addr, dat) + +' Store word value at given RAM address +b$ = HEX$(dat) + +2 +IF LEN(b$) < 4 THEN b$ = "0" + b$: GOTO 2 + +n1 = VAL("&H" + LEFT$(b$, 2)) +n2 = VAL("&H" + RIGHT$(b$, 2)) + +POKE (extADDR + addr), n2 +POKE (extADDR + addr + 1), n1 + +END SUB + +FUNCTION rn + +' Generate random number based on current index +rndp = rndp + 1 +IF rndp > 10000 THEN rndp = 0 +rn = rndval(rndp) + +END FUNCTION + +SUB rndinit + +' Initialize random number array +FOR a = 0 TO 10000 + rndval(a) = RND +NEXT a + +rndp = 0 + +END SUB + +SUB start + +PRINT "Universe Explorer" +PRINT "by Svjatoslav Agejenko, n0@hot.ee" +PRINT "2003.12" +PRINT + +PRINT "Use mouse to aim." +PRINT "Use keys: a, s, d, w to move around," +PRINT "1 2 3 4 5 6 7 to change speed multiplier." +PRINT "r - to start/stop demo." + +PRINT "right mouse button, to move UP <> DOWN." +PRINT "both right & left mouse buttons pressed to move BACK <> FRONT." + +PRINT "At least P3 500 MHz, would be nice." +PRINT "Better CPU, more details and higher framerate." +PRINT "Requires mouse driver, and QBasic extension TSR" +PRINT "to be loaded first." + +PRINT + +PRINT "In this program:" + +PRINT "Several stars, make up galaxy." +PRINT "Several galaxies makes metagalaxy." +PRINT "Several metagalaxies makes up universe." + +PRINT + +PRINT "Press Any key To Continue." +a$ = INPUT$(1) + +startext + +SCREEN 7, , , 1 + +maxmove = 50 +rndinit +myspd = 1000000 + +END SUB + +SUB startext + +' Read interrupt table to find QBasic extension TSR +DEF SEG = 0 + +extSEG = PEEK(&H79 * 4 + 3) * 256 +extSEG = extSEG + PEEK(&H79 * 4 + 2) + +PRINT "Segment is: " + HEX$(extSEG) + +extADDR = PEEK(&H79 * 4 + 1) * 256 +extADDR = extADDR + PEEK(&H79 * 4 + 0) + +PRINT "relative address is:"; extADDR + +DEF SEG = extSEG + +' Check if QBasic extension TSR is loaded +IF getword(0) <> 1983 THEN + PRINT "FATAL ERROR: you must load" + PRINT "QBasic extension TSR first!" + SYSTEM +END IF + +END SUB + +SUB timerAdd (element, time, value) + +' Add timer event to list +FOR a = 0 TO 100 + IF (timerTime(element, a) = 0) AND (timerValue(element, a) = 0) THEN GOTO timer3 +NEXT a +timer3: + +timerTime(element, a) = time +timerValue(element, a) = value + +END SUB + +SUB timerdisp +LOCATE 1, 1 + +' Display all active timers +FOR a = 0 TO 10 + PRINT timerCplace(a), timerCtime(a), timerCvalue(a) +NEXT a + +END SUB + +SUB timerinit + +' Initialize all timers to zero +timerLast = TIMER + +FOR a = 1 TO 50 + FOR b = 1 TO 100 + timerTime(a, b) = 0 + timerValue(a, b) = 0 + NEXT b +NEXT a + +END SUB + +SUB timerprocess + +' Process all active timers +timerCurrent = TIMER +timerDiff = timerCurrent - timerLast +timerLast = timerCurrent + +FOR a = 0 TO 50 + ctim = timerCtime(a) + timerDiff + Cplace = timerCplace(a) +timer2: + IF timerTime(a, Cplace + 1) = -1 THEN + ctim = 0 + Cplace = 0 + END IF + IF timerTime(a, Cplace + 1) < ctim THEN + IF timerTime(a, Cplace + 1) = 0 THEN + timerCvalue(a) = timerValue(a, Cplace) + GOTO timer1: + END IF + Cplace = Cplace + 1 + GOTO timer2 + END IF + + v1 = timerValue(a, Cplace) + t1 = timerTime(a, Cplace) + v2 = timerValue(a, Cplace + 1) + t2 = timerTime(a, Cplace + 1) + + ' Interpolate between two timer values + IF v1 = v2 THEN + timerCvalue(a) = v1 + ELSE + Tdiff1 = t2 - t1 + Tdiff2 = ctim - t1 + Vdiff = v2 - v1 + timerCvalue(a) = Tdiff2 / Tdiff1 * Vdiff + v1 + END IF +timer1: + timerCplace(a) = Cplace + timerCtime(a) = ctim +NEXT a + +END SUB diff --git a/3D GFX/Space/Universe explorer/index.html b/3D GFX/Space/Universe explorer/index.html new file mode 100644 index 0000000..2daf567 --- /dev/null +++ b/3D GFX/Space/Universe explorer/index.html @@ -0,0 +1,45 @@ + +Universe Explorer + + + +

Universe Explorer

+
+
+This QBasic program draws 3D universe consisting of stars in realtime. + +Stars form different galaxies, and galaxies in turn form metagalaxies, witch +finally form universe. + +Program allows you to freely fly around using mouse and the keyboard. +In this simulation universe consists from many millions of stars. +Since QBasic cannot handle large arrays it was quite an art to +invent and optimize formula witch syntheszies any part of the +universe on demand. Every galaxy and metagalaxy is unique. +When user flies near to some galaxy, it will be synthezied, +and detail level will increase. +


+
single metagalaxy +
+


+
single galaxy +
+


+
another galaxy +
+
+
+
+Requirements:
+	CPU 500 MHz or better
+	MS QBasic (preferably QB 4.5)
+	QBEXT TSR (included)
+
+Running program:
+	Since QB has no mouse support there is workaround hack: QBEXT.
+	Thats a tiny TSR that must be loaded first to allow
+	mouse usage.
+
+
+ + \ No newline at end of file diff --git a/3D GFX/Space/Universe explorer/qbext.com b/3D GFX/Space/Universe explorer/qbext.com new file mode 100755 index 0000000..ae54fc4 Binary files /dev/null and b/3D GFX/Space/Universe explorer/qbext.com differ diff --git a/3D GFX/Space/Universe explorer/run.bat b/3D GFX/Space/Universe explorer/run.bat new file mode 100755 index 0000000..15e61be --- /dev/null +++ b/3D GFX/Space/Universe explorer/run.bat @@ -0,0 +1,2 @@ +qbext +qb /run expluniv.bas \ No newline at end of file diff --git a/3D GFX/Space/index.html b/3D GFX/Space/index.html new file mode 100644 index 0000000..d6e9b43 --- /dev/null +++ b/3D GFX/Space/index.html @@ -0,0 +1,334 @@ + + + + + + + +Space themed 3D graphics + + + + + + +
+

Space themed 3D graphics

+ + + +
+

1. Galaxy explorer

+
+

+TODO: add description +

+ + +
+

Galaxy%20explorer.png +

+
+ +

+Source code +

+
+
+ + +
+

2. Rocket simulator

+
+

+TODO: add description +

+ +
+ +
+ +

+Source code +

+
+
+ + +
+

3. Stars

+
+

+TODO: add description +

+ +
+ +
+ +

+Source code +

+
+
+ +
+

4. Universe explorer

+
+

+TODO: add description +

+ + +
+

1.png +

+
+ + +
+

2.png +

+
+ + +
+

3.png +

+
+ +

+Source code +

+
+
+
+
+

Created: 2025-07-28 ma 03:33

+

Validate

+
+ + diff --git a/3D GFX/Space/index.org b/3D GFX/Space/index.org new file mode 100644 index 0000000..8f0b931 --- /dev/null +++ b/3D GFX/Space/index.org @@ -0,0 +1,87 @@ +#+TITLE: Space themed 3D graphics +#+LANGUAGE: en +#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry} +#+LATEX_HEADER: \usepackage{parskip} +#+LATEX_HEADER: \usepackage[none]{hyphenat} + +#+OPTIONS: H:20 num:20 +#+OPTIONS: author:nil + +#+begin_export html + +#+end_export + +* Galaxy explorer + +TODO: add description + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Galaxy%20explorer.bas][file:Galaxy%20explorer.png]] + +[[file:!.bas][Source code]] + + +* Rocket simulator + +TODO: add description + +#+begin_export html +
+ +
+#+end_export + +[[file:Rocket simulator.bas][Source code]] + + +* Stars + +TODO: add description + +#+begin_export html +
+ +
+#+end_export + +[[file:Stars.bas][Source code]] + +* Universe explorer + +TODO: add description + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Universe%20explorer/Universe%20explorer.bas][file:Universe%20explorer/1.png]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Universe%20explorer/Universe%20explorer.bas][file:Universe%20explorer/2.png]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Universe%20explorer/Universe%20explorer.bas][file:Universe%20explorer/3.png]] + +[[file:!.bas][Source code]] diff --git a/3D GFX/Space/logo.png b/3D GFX/Space/logo.png new file mode 100644 index 0000000..d0121eb Binary files /dev/null and b/3D GFX/Space/logo.png differ diff --git a/3D GFX/Space/qbext.com b/3D GFX/Space/qbext.com new file mode 100755 index 0000000..ae54fc4 Binary files /dev/null and b/3D GFX/Space/qbext.com differ diff --git a/3D GFX/Swapping 3D engine/engine.bas b/3D GFX/Swapping 3D engine/engine.bas new file mode 100755 index 0000000..a23a9a3 --- /dev/null +++ b/3D GFX/Swapping 3D engine/engine.bas @@ -0,0 +1,937 @@ +DECLARE SUB createLongLine (x1!, y1!, z1!, x2!, y2!, z2!, c!) +DECLARE SUB makeGrid (x1!, y1!, z1!, x2!, y2!, z2!) +DECLARE SUB prn (a$, x!, y!, z!) +DECLARE SUB fill4 () +DECLARE SUB loadObject (name$, x!, y!, z!) +DECLARE SUB putChar (a$, x!, y!, z!) + +' 3D engine that can theoretically render infinite wireframe 3D worlds. +' This is accomplished by partitioning world into cube shaped fragments. +' Fragments are dynamically loaded into RAM and offloaded from RAM to disk +' while user moves around in world. +' +' As a result, huge world can be stored on-disk while only necessary part of it +' in close proximity is kept in limited RAM. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2004.1 - Initial version +' + +DECLARE SUB fill3 () +DECLARE SUB fill1 () +DECLARE SUB fill2 () +DECLARE SUB addMsg (a$) +DECLARE SUB dispmsg () +DECLARE SUB loadArea (tx1!, ty1!, tz1!, tx2!, ty2!, tz2!) +DECLARE SUB loadCluster (x!, y!, z!) +DECLARE SUB checkVisibility () +DECLARE SUB decVisibility () +DECLARE SUB applyBounds () +DECLARE SUB clearWorld () +DECLARE SUB createNewLine (x1!, y1!, z1!, x2!, y2!, z2!, c!) +DECLARE SUB createWorld () +DECLARE FUNCTION getClustName$ (a!, b!, c!) +DECLARE FUNCTION toStr$ (a!) + +DECLARE SUB insertLine (x1!, y1!, z1!, x2!, y2!, z2!, c!) +DECLARE SUB startext () +DECLARE SUB control () +DECLARE SUB putbyte (addr!, dat!) +DECLARE SUB putword (addr!, dat!) +DECLARE FUNCTION getword! (addr!) +DECLARE FUNCTION getbyte! (addr!) +DECLARE SUB start () +DECLARE SUB render () + + +DIM SHARED an1, an2 + +DIM SHARED extSEG, extADDR +DIM SHARED buttL, buttR +DIM SHARED maxmove + +DIM SHARED linAmo +linAmo = 5000 + +DIM SHARED linX1(0 TO linAmo) AS INTEGER +DIM SHARED linY1(0 TO linAmo) AS INTEGER +DIM SHARED linZ1(0 TO linAmo) AS INTEGER +DIM SHARED linX2(0 TO linAmo) AS INTEGER +DIM SHARED linY2(0 TO linAmo) AS INTEGER +DIM SHARED linZ2(0 TO linAmo) AS INTEGER +DIM SHARED linC(0 TO linAmo) AS INTEGER + +DIM SHARED myx, myy, myz +DIM SHARED myxs, myys, myzs + +DIM SHARED curFreeLine +DIM SHARED worldSize + +DIM SHARED usedLines +DIM SHARED desMaxLines + +DIM SHARED visMaxX, visMaxY, visMaxZ +DIM SHARED visMinX, visMinY, visMinZ + +DIM SHARED visDist +DIM SHARED msgs$(1 TO 10) +DIM SHARED frm + + +'DIM SHARED blkData(1 TO 50) AS STRING * 512 +'DIM SHARED blkFrag(1 TO 50) AS STRING * 512 + + + + +nl = 0 +np = 0 + +start + + +cx = 0 +cy = 0 +cz = 0 + +np = 1 +px(1) = 0 +py(1) = 0 +pz(1) = 0 + +makeGrid -400, -400, -400, 400, 400, 400 + +1 +frm = frm + 1 + +'fill1 +fill2 +fill3 +fill4 + + +control + +render + +LOCATE 1, 1 +PRINT usedLines, visDist + +checkVisibility + +PCOPY 0, 1 +CLS +GOTO 1 + +SUB addMsg (a$) + +FOR a = 1 TO 9 + msgs$(a) = msgs$(a + 1) +NEXT a + +msgs$(10) = a$ +END SUB + +SUB applyBounds + +FOR a = 0 TO linAmo + IF linC(a) > 0 THEN + + + cx = (linX1(a) + linX2(a)) / 2 + cy = (linY1(a) + linY2(a)) / 2 + cz = (linZ1(a) + linZ2(a)) / 2 + + clx = INT(cx / 100) + cly = INT(cy / 100) + clz = INT(cz / 100) + + IF clx > visMaxX THEN GOTO 8 + IF clx < visMinX THEN GOTO 8 + + IF cly > visMaxY THEN GOTO 8 + IF cly < visMinY THEN GOTO 8 + + IF clz > visMaxZ THEN GOTO 8 + IF clz < visMinZ THEN GOTO 8 + + GOTO 7 +8 linC(a) = -1 + usedLines = usedLines - 1 + END IF +7 +NEXT a + +END SUB + +SUB checkVisibility + +'DIM SHARED visMaxX, visMaxY, visMaxZ +'DIM SHARED visMinX, visMinY, visMinZ + + +mx = INT(myx / 100) +my = INT(myy / 100) +mz = INT(myz / 100) + + +IF mx + visDist > visMaxX THEN + newX = mx + visDist + loadArea visMaxX + 1, visMinY, visMinZ, newX, visMaxY, visMaxZ + visMaxX = newX + LOCATE 1, 30 + PRINT "1" +END IF +IF mx - visDist < visMinX THEN + newX = mx - visDist + loadArea visMinX - 1, visMinY, visMinZ, newX, visMaxY, visMaxZ + visMinX = newX + LOCATE 1, 30 + PRINT "2" +END IF + + +IF my + visDist > visMaxY THEN + newY = my + visDist + loadArea visMinX, visMaxY + 1, visMinZ, visMaxX, newY, visMaxZ + visMaxY = newY + LOCATE 1, 30 + PRINT "3" +END IF +IF my - visDist < visMinY THEN + newY = my - visDist + loadArea visMinX, visMinY - 1, visMinZ, visMaxX, newY, visMaxZ + visMinY = newY + LOCATE 1, 30 + PRINT "4" +END IF + + +IF mz + visDist > visMaxZ THEN + newZ = mz + visDist + loadArea visMinX, visMinY, visMaxZ + 1, visMaxX, visMaxY, newZ + visMaxZ = newZ + LOCATE 1, 30 + PRINT "5" +END IF +IF mz - visDist < visMinZ THEN + newZ = mz - visDist + loadArea visMinX, visMinY, visMinZ - 1, visMaxX, visMaxY, newZ + visMinZ = newZ + LOCATE 1, 30 + PRINT "6" +END IF + + +IF usedLines > desMaxLines THEN decVisibility + +END SUB + +SUB clearWorld + + +CHDIR "world" + +FOR x = -worldSize TO worldSize + + n$ = "X" + toStr$(x) + CHDIR n$ + + FOR y = -worldSize TO worldSize + + n2$ = "Y" + toStr$(y) + CHDIR n2$ + + PRINT x, y + FOR z = -worldSize TO worldSize + + n3$ = "z" + toStr$(z) + ".dat" + OPEN n3$ FOR OUTPUT AS #1 +' PRINT #1, "0" + CLOSE #1 + NEXT z + + CHDIR ".." + NEXT y + + CHDIR ".." +NEXT x + +CHDIR ".." + +END SUB + +SUB control + + +IF getbyte(8) <> 0 THEN + putbyte 8, 0 + xp = getword(2) + putword 2, 0 + yp = getword(4) + putword 4, 0 + butt = getword(6) + putword 6, 0 + buttL = 0 + buttR = 0 + IF butt = 1 THEN buttL = 1 + IF butt = 2 THEN buttR = 1 + IF butt = 3 THEN buttL = 1: buttR = 1 + + + IF buttR = 1 THEN + IF buttL = 1 THEN + myxs = myxs + SIN(an1) * yp / 4 + myzs = myzs - COS(an1) * yp / 4 + GOTO 3 + END IF + myys = myys + yp / 4 +3 + yp = 0 + END IF + +END IF + + + + +IF xp < -maxmove THEN xp = -maxmove +IF xp > maxmove THEN xp = maxmove +an1 = an1 - xp / 150 + +IF yp < -maxmove THEN yp = -maxmove +IF yp > maxmove THEN yp = maxmove +an2 = an2 - yp / 150 + + + +a$ = INKEY$ + +IF a$ = "a" THEN myxs = myxs - COS(an1): myzs = myzs - SIN(an1) +IF a$ = "d" THEN myxs = myxs + COS(an1): myzs = myzs + SIN(an1) +IF a$ = "w" THEN myxs = myxs - SIN(an1): myzs = myzs + COS(an1) +IF a$ = "s" THEN myxs = myxs + SIN(an1): myzs = myzs - COS(an1) +IF a$ = "q" THEN SYSTEM + +myxs = myxs / 1.1 +myys = myys / 1.1 +myzs = myzs / 1.1 + +myx = myx + myxs +myz = myz + myzs +myy = myy + myys + +END SUB + +SUB createLongLine (x1, y1, z1, x2, y2, z2, c) +d = SQR((x1 - x2) ^ 2 + (y1 - y2) ^ 2 + (z1 - z2) ^ 2) + +IF d < 100 THEN + createNewLine x1, y1, z1, x2, y2, z2, c +ELSE + xp = (x1 + x2) / 2 + yp = (y1 + y2) / 2 + zp = (z1 + z2) / 2 + createLongLine x1, y1, z1, xp, yp, zp, c + createLongLine xp, yp, zp, x2, y2, z2, c +END IF +END SUB + +SUB createNewLine (x1, y1, z1, x2, y2, z2, c) + +cx = (x1 + x2) / 2 +cy = (y1 + y2) / 2 +cz = (z1 + z2) / 2 + +clx = INT(cx / 100) +cly = INT(cy / 100) +clz = INT(cz / 100) + +IF clx >= visMinX THEN + IF clx <= visMaxX THEN + IF cly >= visMinY THEN + IF cly <= visMaxY THEN + IF clz >= visMinZ THEN + IF clz <= visMaxZ THEN + insertLine x1, y1, z1, x2, y2, z2, c + END IF + END IF + END IF + END IF + END IF +END IF + +cln$ = getClustName(clx, cly, clz) + +' PRINT "Cluster name:" + cln$ +OPEN cln$ FOR APPEND AS #1 + PRINT #1, x1; y1; z1; x2; y2; z2; c +CLOSE #1 + +END SUB + +SUB createWorld + + + +CHDIR "world" + +FOR x = -worldSize TO worldSize + + n$ = "X" + toStr$(x) + MKDIR n$ + CHDIR n$ + + FOR y = -worldSize TO worldSize + + n2$ = "Y" + toStr$(y) + MKDIR n2$ + CHDIR n2$ + + PRINT x, y + FOR z = -worldSize TO worldSize + + n3$ = "z" + toStr$(z) + ".dat" + OPEN n3$ FOR OUTPUT AS #1 +' PRINT #1, "0" + CLOSE #1 + NEXT z + + CHDIR ".." + NEXT y + + CHDIR ".." +NEXT x + +CHDIR ".." + +END SUB + +SUB decVisibility + +mx = INT(myx / 100) +my = INT(myy / 100) +mz = INT(myz / 100) + +6 +de = 0 + +IF visMaxX > mx + visDist THEN + visMaxX = mx + visDist + de = 1 +END IF + +IF visMinX < mx - visDist THEN + visMinX = mx - visDist + de = 1 +END IF + + +IF visMaxY > my + visDist THEN + visMaxY = my + visDist + de = 1 +END IF + +IF visMinY < my - visDist THEN + visMinY = my - visDist + de = 1 +END IF + + +IF visMaxZ > mz + visDist THEN + visMaxZ = mz + visDist + de = 1 +END IF + +IF visMinZ < mz - visDist THEN + visMinZ = mz - visDist + de = 1 +END IF + +IF de = 0 THEN + IF visDist > 3 THEN visDist = visDist - 1: GOTO 6 +ELSE + addMsg "Visibility decareased" +END IF + + +applyBounds +END SUB + +SUB dispmsg +FOR a = 1 TO 10 + LOCATE a, 39 - LEN(msgs$(a)) + PRINT msgs$(a) +NEXT a +END SUB + +SUB fill1 + +x1 = RND * 800 - 400 +y1 = RND * 800 - 400 +z1 = RND * 800 - 400 + +x2 = x1 + RND * 20 +y2 = y1 + RND * 20 +z2 = z1 + RND * 20 + +createNewLine x1, y1, z1, x2, y2, z2, INT(RND * 15) + 1 + +END SUB + +SUB fill2 + + +frmt = frm * 15 + +x1 = SIN(frmt / 533) * 300 + SIN(frmt / 53) * 50 +y1 = COS(frmt / 422) * 300 + SIN(frmt / 31) * 20 +z1 = SIN(frmt / 133) * 300 + SIN(frmt / 39) * 60 + +frmt = (frm - 1) * 15 + +x2 = SIN(frmt / 533) * 300 + SIN(frmt / 53) * 50 +y2 = COS(frmt / 422) * 300 + SIN(frmt / 31) * 20 +z2 = SIN(frmt / 133) * 300 + SIN(frmt / 39) * 60 + + + +createNewLine x1, y1, z1, x2, y2, z2, INT(RND * 15) + 1 + +END SUB + +SUB fill3 + +IF frm / 10 = frm \ 10 THEN ELSE GOTO fill31 + +c = RND * 15 + 1 + +x = RND * 800 - 400 +y = RND * 800 - 400 +z = RND * 800 - 400 + +s = RND * 10 + 3 + +createNewLine x - s, y - s, z - s, x + s, y - s, z - s, c +createNewLine x + s, y - s, z - s, x + s, y + s, z - s, c +createNewLine x + s, y + s, z - s, x - s, y + s, z - s, c +createNewLine x - s, y + s, z - s, x - s, y - s, z - s, c + +createNewLine x - s, y - s, z + s, x + s, y - s, z + s, c +createNewLine x + s, y - s, z + s, x + s, y + s, z + s, c +createNewLine x + s, y + s, z + s, x - s, y + s, z + s, c +createNewLine x - s, y + s, z + s, x - s, y - s, z + s, c + +createNewLine x - s, y - s, z - s, x - s, y - s, z + s, c +createNewLine x + s, y - s, z - s, x + s, y - s, z + s, c +createNewLine x + s, y + s, z - s, x + s, y + s, z + s, c +createNewLine x - s, y + s, z - s, x - s, y + s, z + s, c + +xo = x +yo = y +zo = z + + +x = x + RND * 80 - 40 +y = y + RND * 80 - 40 +z = z + RND * 80 - 40 + +s = RND * 10 + 3 + +createNewLine x - s, y - s, z - s, x + s, y - s, z - s, c +createNewLine x + s, y - s, z - s, x + s, y + s, z - s, c +createNewLine x + s, y + s, z - s, x - s, y + s, z - s, c +createNewLine x - s, y + s, z - s, x - s, y - s, z - s, c + +createNewLine x - s, y - s, z + s, x + s, y - s, z + s, c +createNewLine x + s, y - s, z + s, x + s, y + s, z + s, c +createNewLine x + s, y + s, z + s, x - s, y + s, z + s, c +createNewLine x - s, y + s, z + s, x - s, y - s, z + s, c + +createNewLine x - s, y - s, z - s, x - s, y - s, z + s, c +createNewLine x + s, y - s, z - s, x + s, y - s, z + s, c +createNewLine x + s, y + s, z - s, x + s, y + s, z + s, c +createNewLine x - s, y + s, z - s, x - s, y + s, z + s, c + + +createNewLine x, y, z, xo, yo, zo, c + +fill31: +END SUB + +SUB fill4 +IF RND * 100 < 2 THEN + +b$ = "" +FOR a = 1 TO RND * 3 + 1 +b$ = b$ + CHR$(48 + RND * 9) +NEXT a + +'b$ = "Hello, world!" +prn b$, RND * 800 - 400, RND * 800 - 400, RND * 800 - 400 + +END IF +END SUB + +FUNCTION getbyte (addr) +getbyte = PEEK(extADDR + addr) +END FUNCTION + +FUNCTION getClustName$ (a, b, c) + +getClustName$ = "WORLD\X" + toStr$(a) + "\Y" + toStr$(b) + "\Z" + toStr$(c) + ".DAT" + +END FUNCTION + +FUNCTION getword (addr) +a = PEEK(extADDR + addr) +b = PEEK(extADDR + addr + 1) + + +c$ = HEX$(a) +IF LEN(c$) = 1 THEN c$ = "0" + c$ +IF LEN(c$) = 0 THEN c$ = "00" + + +c = VAL("&H" + HEX$(b) + c$) + +getword = c +END FUNCTION + +SUB importCluster (x, y, z) + +cln$ = getClustName(x, y, z) +'[PRINT cln$ + +OPEN cln$ FOR INPUT AS #1 +5 +IF EOF(1) <> 0 THEN GOTO 4 + +INPUT #1, x1, y1, z1, x2, y2, z2, c +insertLine x1, y1, z1, x2, y2, z2, c + +GOTO 5 +4 +CLOSE #1 + + +END SUB + +SUB insertLine (x1, y1, z1, x2, y2, z2, c) + +insertLine1: +IF linC(curFreeLine) = -1 THEN + linX1(curFreeLine) = x1 + linY1(curFreeLine) = y1 + linZ1(curFreeLine) = z1 + + linX2(curFreeLine) = x2 + linY2(curFreeLine) = y2 + linZ2(curFreeLine) = z2 + + linC(curFreeLine) = c + curFreeLine = curFreeLine + 1 + usedLines = usedLines + 1 + IF curFreeLine > linAmo THEN curFreeLine = 0 +ELSE + curFreeLine = curFreeLine + 1 + IF curFreeLine > linAmo THEN curFreeLine = 0 + GOTO insertLine1 +END IF + + +END SUB + +SUB loadArea (tx1, ty1, tz1, tx2, ty2, tz2) + +LOCATE 3, 1 +addMsg "Loading Area!" +addMsg toStr$(tx1) + " " + toStr$(ty1) + " " + toStr$(tz1) +addMsg toStr$(tx2) + " " + toStr$(ty2) + " " + toStr$(tz2) + + +'PCOPY 0, 1 +'SLEEP + +x1 = tx1 +x2 = tx2 + +y1 = ty1 +y2 = ty2 + +z1 = tz1 +z2 = tz2 + +IF x1 > x2 THEN SWAP x1, x2 +IF y1 > y2 THEN SWAP y1, y2 +IF z1 > z2 THEN SWAP z1, z2 + +FOR x = x1 TO x2 + FOR y = y1 TO y2 + FOR z = z1 TO z2 + loadCluster x, y, z + NEXT z + NEXT y +NEXT x + +END SUB + +SUB loadCluster (x, y, z) + +IF ABS(x) > worldSize THEN GOTO 11 +IF ABS(y) > worldSize THEN GOTO 11 +IF ABS(z) > worldSize THEN GOTO 11 + +cln$ = getClustName(x, y, z) + +OPEN cln$ FOR INPUT AS #1 +10 +IF EOF(1) <> 0 THEN GOTO 9 + +INPUT #1, x1, y1, z1, x2, y2, z2, c +insertLine x1, y1, z1, x2, y2, z2, c + +GOTO 10 +9 +CLOSE #1 + +11 + +END SUB + +SUB loadObject (name$, x, y, z) + +'SCREEN 13 +'PRINT "objects\" + name$ + ".3d" +'END + +OPEN "OBJECTS\" + name$ + ".3d" FOR INPUT AS #2 +13 +IF EOF(2) <> 0 THEN GOTO 12 +INPUT #2, x1, y1, z1, x2, y2, z2, co +createNewLine x1 + x, y1 + y, z1 + z, x2 + x, y2 + y, z2 + z, co +GOTO 13 +12 +CLOSE #2 + +END SUB + +SUB makeGrid (x1, y1, z1, x2, y2, z2) + +s = 100 + +FOR x = x1 TO x2 STEP s + FOR y = y1 TO y2 STEP s + createLongLine x1, y, x, x2, y, x, 1 + createLongLine x, y1, y, x, y2, y, 1 + createLongLine x, y, z1, x, y, z2, 1 + NEXT y +NEXT x + +END SUB + +SUB mousedemo + + + +cx = 150 +cy = 100 +maxmove = 50 +100 +frm = frm + 1 + + +LOCATE 1, 1 +PRINT cx, cy +PRINT frm + +CIRCLE (cx, cy), 10, 0 +xp = getword(2) +putword 2, 0 +yp = getword(4) +putword 4, 0 + + +IF xp < -maxmove THEN xp = -maxmove +IF xp > maxmove THEN xp = maxmove +cx = cx + xp + +IF yp < -maxmove THEN yp = -maxmove +IF yp > maxmove THEN yp = maxmove +cy = cy + yp + + +CIRCLE (cx, cy), 10, 10 + + + +SOUND 0, .05 +GOTO 100 + + +END SUB + +SUB prn (a$, x, y, z) + +FOR a = 1 TO LEN(a$) + b$ = RIGHT$(LEFT$(a$, a), 1) + putChar b$, x + (a - 1) * 8, y, z +NEXT a +END SUB + +SUB putbyte (addr, dat) + +POKE (extADDR + addr), dat +END SUB + +SUB putChar (a$, x, y, z) + +n$ = "FONT\LTR" + toStr(ASC(a$)) +loadObject n$, x, y, z + +END SUB + +SUB putword (addr, dat) + +b$ = HEX$(dat) + +2 +IF LEN(b$) < 4 THEN b$ = "0" + b$: GOTO 2 + +n1 = VAL("&H" + LEFT$(b$, 2)) +n2 = VAL("&H" + RIGHT$(b$, 2)) + + +POKE (extADDR + addr), n2 +POKE (extADDR + addr + 1), n1 + +END SUB + +SUB render + +s1 = SIN(an1) +c1 = COS(an1) + +s2 = SIN(an2) +c2 = COS(an2) + + +FOR a = 0 TO linAmo + + IF linC(a) > 0 THEN + x11 = linX1(a) - myx + y11 = linY1(a) - myy + z11 = linZ1(a) - myz + + x21 = linX2(a) - myx + y21 = linY2(a) - myy + z21 = linZ2(a) - myz + + + x12 = x11 * c1 + z11 * s1 + z12 = z11 * c1 - x11 * s1 + + + y12 = y11 * c2 + z12 * s2 + z13 = z12 * c2 - y11 * s2 + + + IF z13 > 3 THEN + x22 = x21 * c1 + z21 * s1 + z22 = z21 * c1 - x21 * s1 + + + y22 = y21 * c2 + z22 * s2 + z23 = z22 * c2 - y21 * s2 + + + IF z23 > 3 THEN + + rx1 = x12 / z13 * 130 + 160 + ry1 = y12 / z13 * 130 + 100 + + rx2 = x22 / z23 * 130 + 160 + ry2 = y22 / z23 * 130 + 100 + + LINE (rx1, ry1)-(rx2, ry2), linC(a) + END IF + END IF + END IF +NEXT a + + +'dispmsg + +END SUB + +SUB start + +RANDOMIZE TIMER + +FOR a = 0 TO linAmo + linC(a) = -1 +NEXT a + + +startext + +maxmove = 50 +curFreeLine = 0 +worldSize = 5 +usedLines = 0 +desMaxLines = 2000 + +visMaxX = worldSize +visMaxY = worldSize +visMaxZ = worldSize +visMinX = -worldSize +visMinY = -worldSize +visMinZ = -worldSize + +visDist = worldSize + +createWorld + +SCREEN 7, , , 1 + + + +END SUB + +SUB startext + +DEF SEG = 0 ' read first from interrupt table + +extSEG = PEEK(&H79 * 4 + 3) * 256 +extSEG = extSEG + PEEK(&H79 * 4 + 2) + +PRINT "Segment is: " + HEX$(extSEG) + +extADDR = PEEK(&H79 * 4 + 1) * 256 +extADDR = extADDR + PEEK(&H79 * 4 + 0) + +PRINT "relative address is:"; extADDR + +DEF SEG = extSEG + +IF getword(0) <> 1983 THEN + PRINT "FATAL ERROR: you must load" + PRINT "QBasic extension TSR first!" + SYSTEM +END IF + +END SUB + +FUNCTION toStr$ (a) + +b$ = STR$(a) +IF LEFT$(b$, 1) = " " THEN b$ = RIGHT$(b$, LEN(b$) - 1) +toStr$ = b$ + +END FUNCTION + diff --git a/3D GFX/Swapping 3D engine/index.html b/3D GFX/Swapping 3D engine/index.html new file mode 100644 index 0000000..08bf2d5 --- /dev/null +++ b/3D GFX/Swapping 3D engine/index.html @@ -0,0 +1,243 @@ + + + + + + + +Swapping 3D engine + + + + + + +
+

Swapping 3D engine

+

+Idea is to implement 3D engine that can run world with unlimited +complexity. To overcome RAM limits and keep good framerate, world is +divided into cube shaped segments. Those segments are swapped out to +disk when they are too far away. When you move around the world, +segments are swapped in on-demand. +

+ +

+Engine allows user to freely fly around using mouse and keyboard. +

+ +

+Sexment size is 100x100x100 units. Every segment is stored in its own +file within the filesystem. +

+ + +
+

screenshot.png +

+
+ + +
+

screenshot, 2.png +

+
+
+
+

Created: 2025-05-31 la 07:17

+

Validate

+
+ + diff --git a/3D GFX/Swapping 3D engine/index.org b/3D GFX/Swapping 3D engine/index.org new file mode 100755 index 0000000..58010e5 --- /dev/null +++ b/3D GFX/Swapping 3D engine/index.org @@ -0,0 +1,25 @@ + +#+TITLE: Swapping 3D engine +#+LANGUAGE: en +#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry} +#+LATEX_HEADER: \usepackage{parskip} +#+LATEX_HEADER: \usepackage[none]{hyphenat} + +#+OPTIONS: H:20 num:20 +#+OPTIONS: author:nil + + +Idea is to implement 3D engine that can run world with unlimited +complexity. To overcome RAM limits and keep good framerate, world is +divided into cube shaped segments. Those segments are swapped out to +disk when they are too far away. When you move around the world, +segments are swapped in on-demand. + +Engine allows user to freely fly around using mouse and keyboard. + +Sexment size is 100x100x100 units. Every segment is stored in its own +file within the filesystem. + +[[file:screenshot.png]] + +[[file:screenshot, 2.png]] diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR100.3D b/3D GFX/Swapping 3D engine/objects/font/LTR100.3D new file mode 100755 index 0000000..e801017 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR100.3D @@ -0,0 +1,40 @@ + 4 1 0 4 2 0 10 + 7 1 0 7 2 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR101.3D b/3D GFX/Swapping 3D engine/objects/font/LTR101.3D new file mode 100755 index 0000000..ac4241a --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR101.3D @@ -0,0 +1,40 @@ + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 4 0 8 4 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR102.3D b/3D GFX/Swapping 3D engine/objects/font/LTR102.3D new file mode 100755 index 0000000..ac95a57 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR102.3D @@ -0,0 +1,38 @@ + 4 1 0 4 2 0 10 + 7 1 0 7 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 1 4 0 1 5 0 10 + 7 4 0 7 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 2 7 0 2 8 0 10 + 6 7 0 6 8 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR103.3D b/3D GFX/Swapping 3D engine/objects/font/LTR103.3D new file mode 100755 index 0000000..56b4043 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR103.3D @@ -0,0 +1,46 @@ + 2 3 0 2 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 8 6 0 8 7 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 2 8 0 2 9 0 10 + 7 8 0 7 9 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 2 9 0 3 9 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 3 9 0 4 9 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 4 9 0 5 9 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 5 9 0 6 9 0 10 + 6 3 0 7 3 0 10 + 6 9 0 7 9 0 10 + 7 3 0 8 3 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR104.3D b/3D GFX/Swapping 3D engine/objects/font/LTR104.3D new file mode 100755 index 0000000..1ddd2d4 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR104.3D @@ -0,0 +1,38 @@ + 1 1 0 1 2 0 10 + 4 1 0 4 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 + 7 4 0 8 4 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR105.3D b/3D GFX/Swapping 3D engine/objects/font/LTR105.3D new file mode 100755 index 0000000..508952b --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR105.3D @@ -0,0 +1,26 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 7 7 0 7 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR106.3D b/3D GFX/Swapping 3D engine/objects/font/LTR106.3D new file mode 100755 index 0000000..213b922 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR106.3D @@ -0,0 +1,34 @@ + 5 1 0 5 2 0 10 + 7 1 0 7 2 0 10 + 4 3 0 4 4 0 10 + 7 3 0 7 4 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 2 8 0 2 9 0 10 + 6 8 0 6 9 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 7 0 3 7 0 10 + 2 9 0 3 9 0 10 + 3 8 0 4 8 0 10 + 3 9 0 4 9 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 8 0 5 8 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 9 0 6 9 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR107.3D b/3D GFX/Swapping 3D engine/objects/font/LTR107.3D new file mode 100755 index 0000000..1b7f522 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR107.3D @@ -0,0 +1,42 @@ + 1 1 0 1 2 0 10 + 4 1 0 4 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 6 5 0 6 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 8 0 4 8 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 6 3 0 7 3 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR108.3D b/3D GFX/Swapping 3D engine/objects/font/LTR108.3D new file mode 100755 index 0000000..a597be1 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR108.3D @@ -0,0 +1,20 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 7 7 0 7 8 0 10 + 4 1 0 5 1 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR109.3D b/3D GFX/Swapping 3D engine/objects/font/LTR109.3D new file mode 100755 index 0000000..2da5e88 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR109.3D @@ -0,0 +1,36 @@ + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 4 0 2 4 0 10 + 1 8 0 2 8 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 5 0 4 5 0 10 + 4 4 0 5 4 0 10 + 4 7 0 5 7 0 10 + 5 3 0 6 3 0 10 + 5 5 0 6 5 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 + 7 4 0 8 4 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR110.3D b/3D GFX/Swapping 3D engine/objects/font/LTR110.3D new file mode 100755 index 0000000..588fa51 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR110.3D @@ -0,0 +1,34 @@ + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 7 3 0 7 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 4 0 4 4 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 + 7 4 0 8 4 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR111.3D b/3D GFX/Swapping 3D engine/objects/font/LTR111.3D new file mode 100755 index 0000000..7a05ac4 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR111.3D @@ -0,0 +1,36 @@ + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 + 7 4 0 8 4 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR112.3D b/3D GFX/Swapping 3D engine/objects/font/LTR112.3D new file mode 100755 index 0000000..115a6c5 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR112.3D @@ -0,0 +1,40 @@ + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 7 3 0 7 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 4 7 0 4 8 0 10 + 1 8 0 1 9 0 10 + 5 8 0 5 9 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 8 0 2 8 0 10 + 1 9 0 2 9 0 10 + 2 3 0 3 3 0 10 + 2 9 0 3 9 0 10 + 3 4 0 4 4 0 10 + 3 9 0 4 9 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 4 9 0 5 9 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 6 3 0 7 3 0 10 + 6 7 0 7 7 0 10 + 7 4 0 8 4 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR113.3D b/3D GFX/Swapping 3D engine/objects/font/LTR113.3D new file mode 100755 index 0000000..623fcfc --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR113.3D @@ -0,0 +1,40 @@ + 2 3 0 2 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 2 6 0 2 7 0 10 + 7 6 0 7 7 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 4 8 0 4 9 0 10 + 8 8 0 8 9 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 7 0 3 7 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 4 9 0 5 9 0 10 + 5 4 0 6 4 0 10 + 5 9 0 6 9 0 10 + 6 3 0 7 3 0 10 + 6 9 0 7 9 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 8 0 8 8 0 10 + 7 9 0 8 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR114.3D b/3D GFX/Swapping 3D engine/objects/font/LTR114.3D new file mode 100755 index 0000000..dcb0bef --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR114.3D @@ -0,0 +1,32 @@ + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 7 3 0 7 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 1 7 0 1 8 0 10 + 5 7 0 5 8 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 4 0 4 4 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 6 3 0 7 3 0 10 + 6 5 0 7 5 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR115.3D b/3D GFX/Swapping 3D engine/objects/font/LTR115.3D new file mode 100755 index 0000000..25f6cc6 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR115.3D @@ -0,0 +1,40 @@ + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 2 3 0 3 3 0 10 + 2 6 0 3 6 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 8 0 7 8 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR116.3D b/3D GFX/Swapping 3D engine/objects/font/LTR116.3D new file mode 100755 index 0000000..783a7b3 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR116.3D @@ -0,0 +1,34 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 1 3 0 1 4 0 10 + 7 3 0 7 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 4 7 0 4 8 0 10 + 7 7 0 7 8 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 3 1 0 4 1 0 10 + 3 7 0 4 7 0 10 + 4 1 0 5 1 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR117.3D b/3D GFX/Swapping 3D engine/objects/font/LTR117.3D new file mode 100755 index 0000000..f0c5227 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR117.3D @@ -0,0 +1,34 @@ + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 3 0 2 3 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 7 0 6 7 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR118.3D b/3D GFX/Swapping 3D engine/objects/font/LTR118.3D new file mode 100755 index 0000000..bd8b439 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR118.3D @@ -0,0 +1,30 @@ + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 5 7 0 5 8 0 10 + 1 3 0 2 3 0 10 + 1 5 0 2 5 0 10 + 2 3 0 3 3 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 4 6 0 5 6 0 10 + 4 8 0 5 8 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 6 3 0 7 3 0 10 + 6 6 0 7 6 0 10 + 7 3 0 8 3 0 10 + 7 5 0 8 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR119.3D b/3D GFX/Swapping 3D engine/objects/font/LTR119.3D new file mode 100755 index 0000000..7a0cdc4 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR119.3D @@ -0,0 +1,34 @@ + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 4 7 0 4 8 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 1 3 0 2 3 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 6 0 4 6 0 10 + 3 8 0 4 8 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 + 7 3 0 8 3 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR120.3D b/3D GFX/Swapping 3D engine/objects/font/LTR120.3D new file mode 100755 index 0000000..17b3575 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR120.3D @@ -0,0 +1,40 @@ + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 3 0 3 3 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 2 8 0 3 8 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 6 3 0 7 3 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR121.3D b/3D GFX/Swapping 3D engine/objects/font/LTR121.3D new file mode 100755 index 0000000..706a9ac --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR121.3D @@ -0,0 +1,42 @@ + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 2 8 0 2 9 0 10 + 7 8 0 7 9 0 10 + 1 3 0 2 3 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 2 9 0 3 9 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 3 9 0 4 9 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 4 9 0 5 9 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 + 5 9 0 6 9 0 10 + 6 3 0 7 3 0 10 + 6 9 0 7 9 0 10 + 7 3 0 8 3 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR122.3D b/3D GFX/Swapping 3D engine/objects/font/LTR122.3D new file mode 100755 index 0000000..68a6c6e --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR122.3D @@ -0,0 +1,38 @@ + 1 3 0 1 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 7 7 0 7 8 0 10 + 1 3 0 2 3 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 6 0 3 6 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR123.3D b/3D GFX/Swapping 3D engine/objects/font/LTR123.3D new file mode 100755 index 0000000..1554dd6 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR123.3D @@ -0,0 +1,32 @@ + 5 1 0 5 2 0 10 + 8 1 0 8 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 2 4 0 2 5 0 10 + 5 4 0 5 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 5 7 0 5 8 0 10 + 8 7 0 8 8 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 4 2 0 5 2 0 10 + 4 7 0 5 7 0 10 + 5 1 0 6 1 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR124.3D b/3D GFX/Swapping 3D engine/objects/font/LTR124.3D new file mode 100755 index 0000000..52cb916 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR124.3D @@ -0,0 +1,20 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 1 0 5 1 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 8 0 6 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR125.3D b/3D GFX/Swapping 3D engine/objects/font/LTR125.3D new file mode 100755 index 0000000..1c0fbef --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR125.3D @@ -0,0 +1,32 @@ + 2 1 0 2 2 0 10 + 5 1 0 5 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 5 4 0 5 5 0 10 + 8 4 0 8 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 2 7 0 2 8 0 10 + 5 7 0 5 8 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 8 0 5 8 0 10 + 5 2 0 6 2 0 10 + 5 7 0 6 7 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR126.3D b/3D GFX/Swapping 3D engine/objects/font/LTR126.3D new file mode 100755 index 0000000..4229ec1 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR126.3D @@ -0,0 +1,22 @@ + 2 1 0 2 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 4 2 0 4 3 0 10 + 7 2 0 7 3 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 4 1 0 5 1 0 10 + 4 3 0 5 3 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR127.3D b/3D GFX/Swapping 3D engine/objects/font/LTR127.3D new file mode 100755 index 0000000..962efa5 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR127.3D @@ -0,0 +1,32 @@ + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 8 7 0 8 8 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 5 0 3 5 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 8 0 4 8 0 10 + 4 2 0 5 2 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 5 0 7 5 0 10 + 6 8 0 7 8 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR128.3D b/3D GFX/Swapping 3D engine/objects/font/LTR128.3D new file mode 100755 index 0000000..145a357 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR128.3D @@ -0,0 +1,56 @@ + 3 1 0 3 2 0 10 + 7 1 0 7 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 3 5 0 3 6 0 10 + 7 5 0 7 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 2 8 0 2 9 0 10 + 6 8 0 6 9 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 2 0 3 2 0 10 + 2 5 0 3 5 0 10 + 2 7 0 3 7 0 10 + 2 9 0 3 9 0 10 + 3 1 0 4 1 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 6 0 4 6 0 10 + 3 8 0 4 8 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 5 0 6 5 0 10 + 5 9 0 6 9 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR129.3D b/3D GFX/Swapping 3D engine/objects/font/LTR129.3D new file mode 100755 index 0000000..981d948 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR129.3D @@ -0,0 +1,42 @@ + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 8 0 3 8 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR130.3D b/3D GFX/Swapping 3D engine/objects/font/LTR130.3D new file mode 100755 index 0000000..8bc967e --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR130.3D @@ -0,0 +1,48 @@ + 5 1 0 5 2 0 10 + 8 1 0 8 2 0 10 + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR131.3D b/3D GFX/Swapping 3D engine/objects/font/LTR131.3D new file mode 100755 index 0000000..6ece448 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR131.3D @@ -0,0 +1,54 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 6 3 0 6 4 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR132.3D b/3D GFX/Swapping 3D engine/objects/font/LTR132.3D new file mode 100755 index 0000000..cf79614 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR132.3D @@ -0,0 +1,48 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 2 3 0 2 4 0 10 + 6 3 0 6 4 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR133.3D b/3D GFX/Swapping 3D engine/objects/font/LTR133.3D new file mode 100755 index 0000000..6854182 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR133.3D @@ -0,0 +1,44 @@ + 1 1 0 1 2 0 10 + 4 1 0 4 2 0 10 + 2 3 0 2 4 0 10 + 6 3 0 6 4 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR134.3D b/3D GFX/Swapping 3D engine/objects/font/LTR134.3D new file mode 100755 index 0000000..b21e48e --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR134.3D @@ -0,0 +1,40 @@ + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 2 3 0 2 4 0 10 + 6 3 0 6 4 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR135.3D b/3D GFX/Swapping 3D engine/objects/font/LTR135.3D new file mode 100755 index 0000000..bb4e3cb --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR135.3D @@ -0,0 +1,42 @@ + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 2 7 0 2 8 0 10 + 4 7 0 4 8 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 3 8 0 3 9 0 10 + 6 8 0 6 9 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 2 3 0 3 3 0 10 + 2 6 0 3 6 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 9 0 4 9 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 4 9 0 5 9 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 9 0 6 9 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR136.3D b/3D GFX/Swapping 3D engine/objects/font/LTR136.3D new file mode 100755 index 0000000..794ecf8 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR136.3D @@ -0,0 +1,56 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR137.3D b/3D GFX/Swapping 3D engine/objects/font/LTR137.3D new file mode 100755 index 0000000..0c38357 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR137.3D @@ -0,0 +1,52 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR138.3D b/3D GFX/Swapping 3D engine/objects/font/LTR138.3D new file mode 100755 index 0000000..eaa7c4e --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR138.3D @@ -0,0 +1,48 @@ + 1 1 0 1 2 0 10 + 4 1 0 4 2 0 10 + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 4 0 8 4 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR139.3D b/3D GFX/Swapping 3D engine/objects/font/LTR139.3D new file mode 100755 index 0000000..0082063 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR139.3D @@ -0,0 +1,32 @@ + 2 1 0 2 2 0 10 + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 7 7 0 7 8 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR140.3D b/3D GFX/Swapping 3D engine/objects/font/LTR140.3D new file mode 100755 index 0000000..785166a --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR140.3D @@ -0,0 +1,40 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR141.3D b/3D GFX/Swapping 3D engine/objects/font/LTR141.3D new file mode 100755 index 0000000..38359b1 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR141.3D @@ -0,0 +1,28 @@ + 1 1 0 1 2 0 10 + 4 1 0 4 2 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 7 7 0 7 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR142.3D b/3D GFX/Swapping 3D engine/objects/font/LTR142.3D new file mode 100755 index 0000000..ad2032d --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR142.3D @@ -0,0 +1,52 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 4 0 2 4 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR143.3D b/3D GFX/Swapping 3D engine/objects/font/LTR143.3D new file mode 100755 index 0000000..fbf6f01 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR143.3D @@ -0,0 +1,42 @@ + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 5 0 2 5 0 10 + 1 8 0 2 8 0 10 + 2 4 0 3 4 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 4 1 0 5 1 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 5 1 0 6 1 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 5 0 8 5 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR144.3D b/3D GFX/Swapping 3D engine/objects/font/LTR144.3D new file mode 100755 index 0000000..f40ecad --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR144.3D @@ -0,0 +1,48 @@ + 5 1 0 5 2 0 10 + 8 1 0 8 2 0 10 + 1 3 0 1 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 1 5 0 1 6 0 10 + 6 5 0 6 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 1 7 0 1 8 0 10 + 8 7 0 8 8 0 10 + 1 3 0 2 3 0 10 + 1 8 0 2 8 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR145.3D b/3D GFX/Swapping 3D engine/objects/font/LTR145.3D new file mode 100755 index 0000000..17d2a41 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR145.3D @@ -0,0 +1,48 @@ + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 7 4 0 7 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 2 7 0 2 8 0 10 + 4 7 0 4 8 0 10 + 5 7 0 5 8 0 10 + 8 7 0 8 8 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 4 0 5 4 0 10 + 4 7 0 5 7 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 4 0 8 4 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR146.3D b/3D GFX/Swapping 3D engine/objects/font/LTR146.3D new file mode 100755 index 0000000..591171c --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR146.3D @@ -0,0 +1,48 @@ + 2 1 0 2 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 1 4 0 1 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 4 7 0 4 8 0 10 + 8 7 0 8 8 0 10 + 1 2 0 2 2 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 4 1 0 5 1 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR147.3D b/3D GFX/Swapping 3D engine/objects/font/LTR147.3D new file mode 100755 index 0000000..c189294 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR147.3D @@ -0,0 +1,52 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR148.3D b/3D GFX/Swapping 3D engine/objects/font/LTR148.3D new file mode 100755 index 0000000..d402979 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR148.3D @@ -0,0 +1,44 @@ + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 8 0 3 8 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR149.3D b/3D GFX/Swapping 3D engine/objects/font/LTR149.3D new file mode 100755 index 0000000..ed1197e --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR149.3D @@ -0,0 +1,40 @@ + 1 2 0 1 3 0 10 + 4 2 0 4 3 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR150.3D b/3D GFX/Swapping 3D engine/objects/font/LTR150.3D new file mode 100755 index 0000000..859a861 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR150.3D @@ -0,0 +1,50 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR151.3D b/3D GFX/Swapping 3D engine/objects/font/LTR151.3D new file mode 100755 index 0000000..ae77dad --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR151.3D @@ -0,0 +1,38 @@ + 1 2 0 1 3 0 10 + 4 2 0 4 3 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 4 0 8 4 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR152.3D b/3D GFX/Swapping 3D engine/objects/font/LTR152.3D new file mode 100755 index 0000000..0c05150 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR152.3D @@ -0,0 +1,50 @@ + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 2 8 0 2 9 0 10 + 7 8 0 7 9 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 2 9 0 3 9 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 3 9 0 4 9 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 4 9 0 5 9 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 + 5 9 0 6 9 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 9 0 7 9 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR153.3D b/3D GFX/Swapping 3D engine/objects/font/LTR153.3D new file mode 100755 index 0000000..509a938 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR153.3D @@ -0,0 +1,52 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 7 0 3 7 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 6 0 4 6 0 10 + 3 8 0 4 8 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 7 0 7 7 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR154.3D b/3D GFX/Swapping 3D engine/objects/font/LTR154.3D new file mode 100755 index 0000000..e61a78c --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR154.3D @@ -0,0 +1,44 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR155.3D b/3D GFX/Swapping 3D engine/objects/font/LTR155.3D new file mode 100755 index 0000000..8b455ef --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR155.3D @@ -0,0 +1,36 @@ + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 2 3 0 2 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 2 6 0 2 7 0 10 + 8 6 0 8 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 7 0 3 7 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 4 2 0 5 2 0 10 + 4 8 0 5 8 0 10 + 5 2 0 6 2 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR156.3D b/3D GFX/Swapping 3D engine/objects/font/LTR156.3D new file mode 100755 index 0000000..c27bfa8 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR156.3D @@ -0,0 +1,46 @@ + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 1 4 0 1 5 0 10 + 5 4 0 5 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 4 7 0 4 8 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 5 1 0 6 1 0 10 + 5 3 0 6 3 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 5 0 7 5 0 10 + 6 8 0 7 8 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR157.3D b/3D GFX/Swapping 3D engine/objects/font/LTR157.3D new file mode 100755 index 0000000..b7b7caf --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR157.3D @@ -0,0 +1,42 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 7 1 0 7 2 0 10 + 9 1 0 9 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 7 3 0 7 4 0 10 + 2 4 0 2 5 0 10 + 8 4 0 8 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 3 6 0 3 7 0 10 + 7 6 0 7 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 3 2 0 4 2 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 4 3 0 5 3 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 7 1 0 8 1 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 8 1 0 9 1 0 10 + 8 2 0 9 2 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR158.3D b/3D GFX/Swapping 3D engine/objects/font/LTR158.3D new file mode 100755 index 0000000..2c75a85 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR158.3D @@ -0,0 +1,50 @@ + 1 1 0 1 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR159.3D b/3D GFX/Swapping 3D engine/objects/font/LTR159.3D new file mode 100755 index 0000000..7514b13 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR159.3D @@ -0,0 +1,40 @@ + 5 1 0 5 2 0 10 + 7 1 0 7 2 0 10 + 4 2 0 4 3 0 10 + 8 2 0 8 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 2 4 0 2 5 0 10 + 8 4 0 8 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 2 8 0 2 9 0 10 + 5 8 0 5 9 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 7 0 3 7 0 10 + 2 9 0 3 9 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 8 0 4 8 0 10 + 3 9 0 4 9 0 10 + 4 2 0 5 2 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR160.3D b/3D GFX/Swapping 3D engine/objects/font/LTR160.3D new file mode 100755 index 0000000..afaebbf --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR160.3D @@ -0,0 +1,44 @@ + 5 1 0 5 2 0 10 + 8 1 0 8 2 0 10 + 2 3 0 2 4 0 10 + 6 3 0 6 4 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR161.3D b/3D GFX/Swapping 3D engine/objects/font/LTR161.3D new file mode 100755 index 0000000..28d0234 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR161.3D @@ -0,0 +1,28 @@ + 4 1 0 4 2 0 10 + 7 1 0 7 2 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 7 7 0 7 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR162.3D b/3D GFX/Swapping 3D engine/objects/font/LTR162.3D new file mode 100755 index 0000000..0240ffa --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR162.3D @@ -0,0 +1,40 @@ + 5 2 0 5 3 0 10 + 8 2 0 8 3 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 2 4 0 3 4 0 10 + 2 8 0 3 8 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR163.3D b/3D GFX/Swapping 3D engine/objects/font/LTR163.3D new file mode 100755 index 0000000..8d473a4 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR163.3D @@ -0,0 +1,38 @@ + 5 2 0 5 3 0 10 + 8 2 0 8 3 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 4 6 0 4 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 4 0 3 4 0 10 + 2 8 0 3 8 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 6 0 5 6 0 10 + 4 8 0 5 8 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR164.3D b/3D GFX/Swapping 3D engine/objects/font/LTR164.3D new file mode 100755 index 0000000..72d446a --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR164.3D @@ -0,0 +1,46 @@ + 1 2 0 1 3 0 10 + 7 2 0 7 3 0 10 + 1 4 0 1 5 0 10 + 2 4 0 2 5 0 10 + 3 4 0 3 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 5 0 3 5 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 8 0 4 8 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 5 0 8 5 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR165.3D b/3D GFX/Swapping 3D engine/objects/font/LTR165.3D new file mode 100755 index 0000000..8fbee8b --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR165.3D @@ -0,0 +1,50 @@ + 1 1 0 1 2 0 10 + 8 1 0 8 2 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR166.3D b/3D GFX/Swapping 3D engine/objects/font/LTR166.3D new file mode 100755 index 0000000..f208090 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR166.3D @@ -0,0 +1,36 @@ + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 3 3 0 3 4 0 10 + 8 3 0 8 4 0 10 + 2 5 0 2 6 0 10 + 8 5 0 8 6 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 1 0 4 1 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR167.3D b/3D GFX/Swapping 3D engine/objects/font/LTR167.3D new file mode 100755 index 0000000..02c4975 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR167.3D @@ -0,0 +1,40 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 2 1 0 3 1 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 1 0 7 1 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR168.3D b/3D GFX/Swapping 3D engine/objects/font/LTR168.3D new file mode 100755 index 0000000..9b169b6 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR168.3D @@ -0,0 +1,34 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 7 7 0 7 8 0 10 + 2 5 0 3 5 0 10 + 2 7 0 3 7 0 10 + 3 4 0 4 4 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR169.3D b/3D GFX/Swapping 3D engine/objects/font/LTR169.3D new file mode 100755 index 0000000..b42c00a --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR169.3D @@ -0,0 +1,16 @@ + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 2 4 0 3 4 0 10 + 2 7 0 3 7 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR170.3D b/3D GFX/Swapping 3D engine/objects/font/LTR170.3D new file mode 100755 index 0000000..33c680b --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR170.3D @@ -0,0 +1,16 @@ + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 6 4 0 7 4 0 10 + 6 7 0 7 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR171.3D b/3D GFX/Swapping 3D engine/objects/font/LTR171.3D new file mode 100755 index 0000000..0f1d44b --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR171.3D @@ -0,0 +1,50 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 3 8 0 3 9 0 10 + 8 8 0 8 9 0 10 + 1 1 0 2 1 0 10 + 1 4 0 2 4 0 10 + 2 1 0 3 1 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 3 9 0 4 9 0 10 + 4 3 0 5 3 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 4 9 0 5 9 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 9 0 6 9 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 5 0 7 5 0 10 + 6 9 0 7 9 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 + 7 9 0 8 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR172.3D b/3D GFX/Swapping 3D engine/objects/font/LTR172.3D new file mode 100755 index 0000000..8bddea3 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR172.3D @@ -0,0 +1,46 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 3 6 0 3 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 5 8 0 5 9 0 10 + 7 8 0 7 9 0 10 + 1 1 0 2 1 0 10 + 1 4 0 2 4 0 10 + 2 1 0 3 1 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 4 0 4 4 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 8 0 5 8 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 9 0 6 9 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 5 0 7 5 0 10 + 6 9 0 7 9 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR173.3D b/3D GFX/Swapping 3D engine/objects/font/LTR173.3D new file mode 100755 index 0000000..4a91a28 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR173.3D @@ -0,0 +1,24 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 3 5 0 3 6 0 10 + 7 5 0 7 6 0 10 + 3 6 0 3 7 0 10 + 7 6 0 7 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 5 0 7 5 0 10 + 6 7 0 7 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR174.3D b/3D GFX/Swapping 3D engine/objects/font/LTR174.3D new file mode 100755 index 0000000..463c329 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR174.3D @@ -0,0 +1,44 @@ + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 2 3 0 3 3 0 10 + 2 6 0 3 6 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 5 3 0 6 3 0 10 + 5 6 0 6 6 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 7 0 7 7 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR175.3D b/3D GFX/Swapping 3D engine/objects/font/LTR175.3D new file mode 100755 index 0000000..e9c550d --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR175.3D @@ -0,0 +1,44 @@ + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 7 0 3 7 0 10 + 3 3 0 4 3 0 10 + 3 6 0 4 6 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 6 3 0 7 3 0 10 + 6 6 0 7 6 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR176.3D b/3D GFX/Swapping 3D engine/objects/font/LTR176.3D new file mode 100755 index 0000000..6522964 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR176.3D @@ -0,0 +1,64 @@ + 3 1 0 3 2 0 10 + 4 1 0 4 2 0 10 + 7 1 0 7 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 2 2 0 2 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 7 3 0 7 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 2 4 0 2 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 7 5 0 7 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 2 6 0 2 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 4 7 0 4 8 0 10 + 7 7 0 7 8 0 10 + 8 7 0 8 8 0 10 + 1 8 0 1 9 0 10 + 2 8 0 2 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 1 9 0 2 9 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 5 9 0 6 9 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR177.3D b/3D GFX/Swapping 3D engine/objects/font/LTR177.3D new file mode 100755 index 0000000..6e3c67f --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR177.3D @@ -0,0 +1,128 @@ + 2 1 0 2 2 0 10 + 3 1 0 3 2 0 10 + 4 1 0 4 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 7 1 0 7 2 0 10 + 8 1 0 8 2 0 10 + 9 1 0 9 2 0 10 + 1 2 0 1 3 0 10 + 2 2 0 2 3 0 10 + 3 2 0 3 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 7 2 0 7 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 7 3 0 7 4 0 10 + 8 3 0 8 4 0 10 + 9 3 0 9 4 0 10 + 1 4 0 1 5 0 10 + 2 4 0 2 5 0 10 + 3 4 0 3 5 0 10 + 4 4 0 4 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 7 4 0 7 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 7 5 0 7 6 0 10 + 8 5 0 8 6 0 10 + 9 5 0 9 6 0 10 + 1 6 0 1 7 0 10 + 2 6 0 2 7 0 10 + 3 6 0 3 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 7 6 0 7 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 3 7 0 3 8 0 10 + 4 7 0 4 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 7 7 0 7 8 0 10 + 8 7 0 8 8 0 10 + 9 7 0 9 8 0 10 + 1 8 0 1 9 0 10 + 2 8 0 2 9 0 10 + 3 8 0 3 9 0 10 + 4 8 0 4 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 7 8 0 7 9 0 10 + 8 8 0 8 9 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 1 9 0 2 9 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 5 9 0 6 9 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 + 7 9 0 8 9 0 10 + 8 1 0 9 1 0 10 + 8 2 0 9 2 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 + 8 7 0 9 7 0 10 + 8 8 0 9 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR178.3D b/3D GFX/Swapping 3D engine/objects/font/LTR178.3D new file mode 100755 index 0000000..3a8f20f --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR178.3D @@ -0,0 +1,80 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 4 1 0 4 2 0 10 + 7 1 0 7 2 0 10 + 8 1 0 8 2 0 10 + 9 1 0 9 2 0 10 + 2 2 0 2 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 9 2 0 9 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 7 3 0 7 4 0 10 + 8 3 0 8 4 0 10 + 9 3 0 9 4 0 10 + 2 4 0 2 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 9 4 0 9 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 7 5 0 7 6 0 10 + 8 5 0 8 6 0 10 + 9 5 0 9 6 0 10 + 2 6 0 2 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 9 6 0 9 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 4 7 0 4 8 0 10 + 7 7 0 7 8 0 10 + 8 7 0 8 8 0 10 + 9 7 0 9 8 0 10 + 2 8 0 2 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 9 8 0 9 9 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 9 0 3 9 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 9 0 7 9 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 + 7 9 0 8 9 0 10 + 8 1 0 9 1 0 10 + 8 9 0 9 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR179.3D b/3D GFX/Swapping 3D engine/objects/font/LTR179.3D new file mode 100755 index 0000000..f6a2cd7 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR179.3D @@ -0,0 +1,20 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 9 0 6 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR180.3D b/3D GFX/Swapping 3D engine/objects/font/LTR180.3D new file mode 100755 index 0000000..ba2bcc3 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR180.3D @@ -0,0 +1,26 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 9 0 6 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR181.3D b/3D GFX/Swapping 3D engine/objects/font/LTR181.3D new file mode 100755 index 0000000..35e3118 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR181.3D @@ -0,0 +1,32 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 1 3 0 1 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 9 0 6 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR182.3D b/3D GFX/Swapping 3D engine/objects/font/LTR182.3D new file mode 100755 index 0000000..01e2f8f --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR182.3D @@ -0,0 +1,44 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 1 0 4 1 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 6 1 0 7 1 0 10 + 6 9 0 7 9 0 10 + 7 1 0 8 1 0 10 + 7 9 0 8 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR183.3D b/3D GFX/Swapping 3D engine/objects/font/LTR183.3D new file mode 100755 index 0000000..1e0f94e --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR183.3D @@ -0,0 +1,28 @@ + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 9 0 4 9 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 5 0 7 5 0 10 + 6 9 0 7 9 0 10 + 7 5 0 8 5 0 10 + 7 9 0 8 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR184.3D b/3D GFX/Swapping 3D engine/objects/font/LTR184.3D new file mode 100755 index 0000000..8e63e20 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR184.3D @@ -0,0 +1,28 @@ + 1 3 0 1 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 3 0 5 3 0 10 + 4 9 0 5 9 0 10 + 5 3 0 6 3 0 10 + 5 9 0 6 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR185.3D b/3D GFX/Swapping 3D engine/objects/font/LTR185.3D new file mode 100755 index 0000000..b039c9a --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR185.3D @@ -0,0 +1,50 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 1 0 4 1 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 6 1 0 7 1 0 10 + 6 9 0 7 9 0 10 + 7 1 0 8 1 0 10 + 7 9 0 8 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR186.3D b/3D GFX/Swapping 3D engine/objects/font/LTR186.3D new file mode 100755 index 0000000..fac68d2 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR186.3D @@ -0,0 +1,40 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 3 1 0 4 1 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 6 1 0 7 1 0 10 + 6 9 0 7 9 0 10 + 7 1 0 8 1 0 10 + 7 9 0 8 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR187.3D b/3D GFX/Swapping 3D engine/objects/font/LTR187.3D new file mode 100755 index 0000000..3d602cb --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR187.3D @@ -0,0 +1,42 @@ + 1 3 0 1 4 0 10 + 8 3 0 8 4 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 9 0 4 9 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 6 3 0 7 3 0 10 + 6 9 0 7 9 0 10 + 7 3 0 8 3 0 10 + 7 9 0 8 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR188.3D b/3D GFX/Swapping 3D engine/objects/font/LTR188.3D new file mode 100755 index 0000000..8fa7098 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR188.3D @@ -0,0 +1,38 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 1 0 4 1 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 1 0 7 1 0 10 + 6 6 0 7 6 0 10 + 7 1 0 8 1 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR189.3D b/3D GFX/Swapping 3D engine/objects/font/LTR189.3D new file mode 100755 index 0000000..0cd5eb6 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR189.3D @@ -0,0 +1,32 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 1 0 4 1 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 6 0 5 6 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 1 0 7 1 0 10 + 6 6 0 7 6 0 10 + 7 1 0 8 1 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR190.3D b/3D GFX/Swapping 3D engine/objects/font/LTR190.3D new file mode 100755 index 0000000..dd40100 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR190.3D @@ -0,0 +1,26 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 1 3 0 1 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 6 5 0 6 6 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 6 0 6 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR191.3D b/3D GFX/Swapping 3D engine/objects/font/LTR191.3D new file mode 100755 index 0000000..b1446fc --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR191.3D @@ -0,0 +1,18 @@ + 1 5 0 1 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 5 5 0 6 5 0 10 + 5 9 0 6 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR192.3D b/3D GFX/Swapping 3D engine/objects/font/LTR192.3D new file mode 100755 index 0000000..7e7021b --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR192.3D @@ -0,0 +1,20 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 9 5 0 9 6 0 10 + 4 1 0 5 1 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 6 0 6 6 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR193.3D b/3D GFX/Swapping 3D engine/objects/font/LTR193.3D new file mode 100755 index 0000000..68ac02f --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR193.3D @@ -0,0 +1,26 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 6 0 6 6 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR194.3D b/3D GFX/Swapping 3D engine/objects/font/LTR194.3D new file mode 100755 index 0000000..0908537 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR194.3D @@ -0,0 +1,24 @@ + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 5 5 0 6 5 0 10 + 5 9 0 6 9 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR195.3D b/3D GFX/Swapping 3D engine/objects/font/LTR195.3D new file mode 100755 index 0000000..9eed92f --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR195.3D @@ -0,0 +1,26 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 9 5 0 9 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 9 0 6 9 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR196.3D b/3D GFX/Swapping 3D engine/objects/font/LTR196.3D new file mode 100755 index 0000000..f26d8f5 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR196.3D @@ -0,0 +1,18 @@ + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR197.3D b/3D GFX/Swapping 3D engine/objects/font/LTR197.3D new file mode 100755 index 0000000..84a2312 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR197.3D @@ -0,0 +1,32 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 9 0 6 9 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR198.3D b/3D GFX/Swapping 3D engine/objects/font/LTR198.3D new file mode 100755 index 0000000..e5ce811 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR198.3D @@ -0,0 +1,32 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 9 3 0 9 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 9 5 0 9 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 9 0 6 9 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR199.3D b/3D GFX/Swapping 3D engine/objects/font/LTR199.3D new file mode 100755 index 0000000..72cc1a2 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR199.3D @@ -0,0 +1,42 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 9 5 0 9 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 3 1 0 4 1 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 6 1 0 7 1 0 10 + 6 9 0 7 9 0 10 + 7 1 0 8 1 0 10 + 7 9 0 8 9 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR200.3D b/3D GFX/Swapping 3D engine/objects/font/LTR200.3D new file mode 100755 index 0000000..17db339 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR200.3D @@ -0,0 +1,34 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 9 3 0 9 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 3 5 0 3 6 0 10 + 9 5 0 9 6 0 10 + 3 1 0 4 1 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 6 0 5 6 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 1 0 7 1 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 1 0 8 1 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR201.3D b/3D GFX/Swapping 3D engine/objects/font/LTR201.3D new file mode 100755 index 0000000..42542d1 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR201.3D @@ -0,0 +1,38 @@ + 3 3 0 3 4 0 10 + 9 3 0 9 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 9 5 0 9 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 3 3 0 4 3 0 10 + 3 9 0 4 9 0 10 + 4 3 0 5 3 0 10 + 4 9 0 5 9 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 9 0 7 9 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 9 0 8 9 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR202.3D b/3D GFX/Swapping 3D engine/objects/font/LTR202.3D new file mode 100755 index 0000000..96712e3 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR202.3D @@ -0,0 +1,44 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 9 3 0 9 4 0 10 + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 1 0 4 1 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 1 0 7 1 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 1 0 8 1 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR203.3D b/3D GFX/Swapping 3D engine/objects/font/LTR203.3D new file mode 100755 index 0000000..f56d3fd --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR203.3D @@ -0,0 +1,48 @@ + 1 3 0 1 4 0 10 + 9 3 0 9 4 0 10 + 1 5 0 1 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 9 5 0 9 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 9 0 4 9 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 9 0 7 9 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 9 0 8 9 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR204.3D b/3D GFX/Swapping 3D engine/objects/font/LTR204.3D new file mode 100755 index 0000000..aec08e8 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR204.3D @@ -0,0 +1,46 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 9 3 0 9 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 9 5 0 9 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 3 1 0 4 1 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 6 1 0 7 1 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 9 0 7 9 0 10 + 7 1 0 8 1 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 9 0 8 9 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR205.3D b/3D GFX/Swapping 3D engine/objects/font/LTR205.3D new file mode 100755 index 0000000..3101e8e --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR205.3D @@ -0,0 +1,36 @@ + 1 3 0 1 4 0 10 + 9 3 0 9 4 0 10 + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR206.3D b/3D GFX/Swapping 3D engine/objects/font/LTR206.3D new file mode 100755 index 0000000..819590c --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR206.3D @@ -0,0 +1,56 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 9 3 0 9 4 0 10 + 1 5 0 1 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 9 5 0 9 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 1 0 4 1 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 6 1 0 7 1 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 9 0 7 9 0 10 + 7 1 0 8 1 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 9 0 8 9 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR207.3D b/3D GFX/Swapping 3D engine/objects/font/LTR207.3D new file mode 100755 index 0000000..74674ba --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR207.3D @@ -0,0 +1,40 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 1 3 0 1 4 0 10 + 9 3 0 9 4 0 10 + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR208.3D b/3D GFX/Swapping 3D engine/objects/font/LTR208.3D new file mode 100755 index 0000000..b5f8341 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR208.3D @@ -0,0 +1,34 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 1 0 4 1 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 6 0 5 6 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 1 0 7 1 0 10 + 6 6 0 7 6 0 10 + 7 1 0 8 1 0 10 + 7 6 0 8 6 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR209.3D b/3D GFX/Swapping 3D engine/objects/font/LTR209.3D new file mode 100755 index 0000000..2cfaaa1 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR209.3D @@ -0,0 +1,42 @@ + 1 3 0 1 4 0 10 + 9 3 0 9 4 0 10 + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 9 0 6 9 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR210.3D b/3D GFX/Swapping 3D engine/objects/font/LTR210.3D new file mode 100755 index 0000000..8716a37 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR210.3D @@ -0,0 +1,30 @@ + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 9 0 4 9 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 5 0 7 5 0 10 + 6 9 0 7 9 0 10 + 7 5 0 8 5 0 10 + 7 9 0 8 9 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR211.3D b/3D GFX/Swapping 3D engine/objects/font/LTR211.3D new file mode 100755 index 0000000..f4bc64d --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR211.3D @@ -0,0 +1,30 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 3 5 0 3 6 0 10 + 9 5 0 9 6 0 10 + 3 1 0 4 1 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 6 0 5 6 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 1 0 7 1 0 10 + 6 6 0 7 6 0 10 + 7 1 0 8 1 0 10 + 7 6 0 8 6 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR212.3D b/3D GFX/Swapping 3D engine/objects/font/LTR212.3D new file mode 100755 index 0000000..c93d8ed --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR212.3D @@ -0,0 +1,26 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 9 3 0 9 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 9 5 0 9 6 0 10 + 4 1 0 5 1 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 6 0 6 6 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR213.3D b/3D GFX/Swapping 3D engine/objects/font/LTR213.3D new file mode 100755 index 0000000..11d95b9 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR213.3D @@ -0,0 +1,28 @@ + 4 3 0 4 4 0 10 + 9 3 0 9 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 9 5 0 9 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 4 3 0 5 3 0 10 + 4 9 0 5 9 0 10 + 5 3 0 6 3 0 10 + 5 9 0 6 9 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR214.3D b/3D GFX/Swapping 3D engine/objects/font/LTR214.3D new file mode 100755 index 0000000..3e9507b --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR214.3D @@ -0,0 +1,26 @@ + 3 5 0 3 6 0 10 + 9 5 0 9 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 3 5 0 4 5 0 10 + 3 9 0 4 9 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 5 0 7 5 0 10 + 6 9 0 7 9 0 10 + 7 5 0 8 5 0 10 + 7 9 0 8 9 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR215.3D b/3D GFX/Swapping 3D engine/objects/font/LTR215.3D new file mode 100755 index 0000000..5dd09bc --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR215.3D @@ -0,0 +1,46 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 1 0 4 1 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 1 0 7 1 0 10 + 6 9 0 7 9 0 10 + 7 1 0 8 1 0 10 + 7 9 0 8 9 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR216.3D b/3D GFX/Swapping 3D engine/objects/font/LTR216.3D new file mode 100755 index 0000000..8fd55cf --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR216.3D @@ -0,0 +1,44 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 1 3 0 1 4 0 10 + 9 3 0 9 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 9 0 6 9 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 3 0 9 3 0 10 + 8 4 0 9 4 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR217.3D b/3D GFX/Swapping 3D engine/objects/font/LTR217.3D new file mode 100755 index 0000000..c8c0967 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR217.3D @@ -0,0 +1,20 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 6 5 0 6 6 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 6 0 6 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR218.3D b/3D GFX/Swapping 3D engine/objects/font/LTR218.3D new file mode 100755 index 0000000..32d627e --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR218.3D @@ -0,0 +1,18 @@ + 4 5 0 4 6 0 10 + 9 5 0 9 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 5 5 0 6 5 0 10 + 5 9 0 6 9 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 8 5 0 9 5 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR219.3D b/3D GFX/Swapping 3D engine/objects/font/LTR219.3D new file mode 100755 index 0000000..538af36 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR219.3D @@ -0,0 +1,32 @@ + 1 1 0 1 2 0 10 + 9 1 0 9 2 0 10 + 1 2 0 1 3 0 10 + 9 2 0 9 3 0 10 + 1 3 0 1 4 0 10 + 9 3 0 9 4 0 10 + 1 4 0 1 5 0 10 + 9 4 0 9 5 0 10 + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 1 6 0 1 7 0 10 + 9 6 0 9 7 0 10 + 1 7 0 1 8 0 10 + 9 7 0 9 8 0 10 + 1 8 0 1 9 0 10 + 9 8 0 9 9 0 10 + 1 1 0 2 1 0 10 + 1 9 0 2 9 0 10 + 2 1 0 3 1 0 10 + 2 9 0 3 9 0 10 + 3 1 0 4 1 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 9 0 6 9 0 10 + 6 1 0 7 1 0 10 + 6 9 0 7 9 0 10 + 7 1 0 8 1 0 10 + 7 9 0 8 9 0 10 + 8 1 0 9 1 0 10 + 8 9 0 9 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR220.3D b/3D GFX/Swapping 3D engine/objects/font/LTR220.3D new file mode 100755 index 0000000..8f9d4a2 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR220.3D @@ -0,0 +1,24 @@ + 1 5 0 1 6 0 10 + 9 5 0 9 6 0 10 + 1 6 0 1 7 0 10 + 9 6 0 9 7 0 10 + 1 7 0 1 8 0 10 + 9 7 0 9 8 0 10 + 1 8 0 1 9 0 10 + 9 8 0 9 9 0 10 + 1 5 0 2 5 0 10 + 1 9 0 2 9 0 10 + 2 5 0 3 5 0 10 + 2 9 0 3 9 0 10 + 3 5 0 4 5 0 10 + 3 9 0 4 9 0 10 + 4 5 0 5 5 0 10 + 4 9 0 5 9 0 10 + 5 5 0 6 5 0 10 + 5 9 0 6 9 0 10 + 6 5 0 7 5 0 10 + 6 9 0 7 9 0 10 + 7 5 0 8 5 0 10 + 7 9 0 8 9 0 10 + 8 5 0 9 5 0 10 + 8 9 0 9 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR221.3D b/3D GFX/Swapping 3D engine/objects/font/LTR221.3D new file mode 100755 index 0000000..0a78ddf --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR221.3D @@ -0,0 +1,24 @@ + 1 1 0 1 2 0 10 + 5 1 0 5 2 0 10 + 1 2 0 1 3 0 10 + 5 2 0 5 3 0 10 + 1 3 0 1 4 0 10 + 5 3 0 5 4 0 10 + 1 4 0 1 5 0 10 + 5 4 0 5 5 0 10 + 1 5 0 1 6 0 10 + 5 5 0 5 6 0 10 + 1 6 0 1 7 0 10 + 5 6 0 5 7 0 10 + 1 7 0 1 8 0 10 + 5 7 0 5 8 0 10 + 1 8 0 1 9 0 10 + 5 8 0 5 9 0 10 + 1 1 0 2 1 0 10 + 1 9 0 2 9 0 10 + 2 1 0 3 1 0 10 + 2 9 0 3 9 0 10 + 3 1 0 4 1 0 10 + 3 9 0 4 9 0 10 + 4 1 0 5 1 0 10 + 4 9 0 5 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR222.3D b/3D GFX/Swapping 3D engine/objects/font/LTR222.3D new file mode 100755 index 0000000..391d2c4 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR222.3D @@ -0,0 +1,24 @@ + 5 1 0 5 2 0 10 + 9 1 0 9 2 0 10 + 5 2 0 5 3 0 10 + 9 2 0 9 3 0 10 + 5 3 0 5 4 0 10 + 9 3 0 9 4 0 10 + 5 4 0 5 5 0 10 + 9 4 0 9 5 0 10 + 5 5 0 5 6 0 10 + 9 5 0 9 6 0 10 + 5 6 0 5 7 0 10 + 9 6 0 9 7 0 10 + 5 7 0 5 8 0 10 + 9 7 0 9 8 0 10 + 5 8 0 5 9 0 10 + 9 8 0 9 9 0 10 + 5 1 0 6 1 0 10 + 5 9 0 6 9 0 10 + 6 1 0 7 1 0 10 + 6 9 0 7 9 0 10 + 7 1 0 8 1 0 10 + 7 9 0 8 9 0 10 + 8 1 0 9 1 0 10 + 8 9 0 9 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR223.3D b/3D GFX/Swapping 3D engine/objects/font/LTR223.3D new file mode 100755 index 0000000..870a1e1 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR223.3D @@ -0,0 +1,24 @@ + 1 1 0 1 2 0 10 + 9 1 0 9 2 0 10 + 1 2 0 1 3 0 10 + 9 2 0 9 3 0 10 + 1 3 0 1 4 0 10 + 9 3 0 9 4 0 10 + 1 4 0 1 5 0 10 + 9 4 0 9 5 0 10 + 1 1 0 2 1 0 10 + 1 5 0 2 5 0 10 + 2 1 0 3 1 0 10 + 2 5 0 3 5 0 10 + 3 1 0 4 1 0 10 + 3 5 0 4 5 0 10 + 4 1 0 5 1 0 10 + 4 5 0 5 5 0 10 + 5 1 0 6 1 0 10 + 5 5 0 6 5 0 10 + 6 1 0 7 1 0 10 + 6 5 0 7 5 0 10 + 7 1 0 8 1 0 10 + 7 5 0 8 5 0 10 + 8 1 0 9 1 0 10 + 8 5 0 9 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR224.3D b/3D GFX/Swapping 3D engine/objects/font/LTR224.3D new file mode 100755 index 0000000..4c0ceac --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR224.3D @@ -0,0 +1,40 @@ + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 4 4 0 4 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 4 6 0 4 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 4 0 5 4 0 10 + 4 7 0 5 7 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 6 3 0 7 3 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR225.3D b/3D GFX/Swapping 3D engine/objects/font/LTR225.3D new file mode 100755 index 0000000..9cd067c --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR225.3D @@ -0,0 +1,42 @@ + 2 2 0 2 3 0 10 + 6 2 0 6 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 1 3 0 2 3 0 10 + 1 8 0 2 8 0 10 + 2 2 0 3 2 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 5 2 0 6 2 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 8 0 7 8 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR226.3D b/3D GFX/Swapping 3D engine/objects/font/LTR226.3D new file mode 100755 index 0000000..767049d --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR226.3D @@ -0,0 +1,30 @@ + 1 2 0 1 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 7 3 0 7 4 0 10 + 8 3 0 8 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 1 7 0 1 8 0 10 + 4 7 0 4 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 2 0 3 2 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 8 0 4 8 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR227.3D b/3D GFX/Swapping 3D engine/objects/font/LTR227.3D new file mode 100755 index 0000000..9f6d17d --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR227.3D @@ -0,0 +1,36 @@ + 1 2 0 1 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 4 7 0 4 8 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 2 2 0 3 2 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 8 0 4 8 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 5 2 0 6 2 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR228.3D b/3D GFX/Swapping 3D engine/objects/font/LTR228.3D new file mode 100755 index 0000000..1a346d3 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR228.3D @@ -0,0 +1,50 @@ + 1 1 0 1 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 3 0 2 3 0 10 + 1 6 0 2 6 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 3 0 8 3 0 10 + 7 6 0 8 6 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR229.3D b/3D GFX/Swapping 3D engine/objects/font/LTR229.3D new file mode 100755 index 0000000..22b26c5 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR229.3D @@ -0,0 +1,40 @@ + 2 2 0 2 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 2 7 0 2 8 0 10 + 5 7 0 5 8 0 10 + 1 3 0 2 3 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 8 0 5 8 0 10 + 5 2 0 6 2 0 10 + 5 7 0 6 7 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 6 0 7 6 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR230.3D b/3D GFX/Swapping 3D engine/objects/font/LTR230.3D new file mode 100755 index 0000000..0fd6ec6 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR230.3D @@ -0,0 +1,34 @@ + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 2 0 3 2 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 7 2 0 8 2 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR231.3D b/3D GFX/Swapping 3D engine/objects/font/LTR231.3D new file mode 100755 index 0000000..ae60755 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR231.3D @@ -0,0 +1,32 @@ + 2 2 0 2 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 7 3 0 7 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 2 2 0 3 2 0 10 + 2 4 0 3 4 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 2 0 5 2 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR232.3D b/3D GFX/Swapping 3D engine/objects/font/LTR232.3D new file mode 100755 index 0000000..42c06bd --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR232.3D @@ -0,0 +1,56 @@ + 1 1 0 1 2 0 10 + 8 1 0 8 2 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 1 7 0 1 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 6 0 3 6 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 3 0 5 3 0 10 + 4 6 0 5 6 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR233.3D b/3D GFX/Swapping 3D engine/objects/font/LTR233.3D new file mode 100755 index 0000000..365c15b --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR233.3D @@ -0,0 +1,48 @@ + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 1 3 0 2 3 0 10 + 1 6 0 2 6 0 10 + 2 2 0 3 2 0 10 + 2 7 0 3 7 0 10 + 3 1 0 4 1 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 7 3 0 8 3 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR234.3D b/3D GFX/Swapping 3D engine/objects/font/LTR234.3D new file mode 100755 index 0000000..48bb66a --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR234.3D @@ -0,0 +1,48 @@ + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 4 7 0 4 8 0 10 + 5 7 0 5 8 0 10 + 8 7 0 8 8 0 10 + 1 3 0 2 3 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 2 0 3 2 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 3 0 4 3 0 10 + 3 5 0 4 5 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 5 1 0 6 1 0 10 + 5 3 0 6 3 0 10 + 5 5 0 6 5 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 8 0 7 8 0 10 + 7 3 0 8 3 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR235.3D b/3D GFX/Swapping 3D engine/objects/font/LTR235.3D new file mode 100755 index 0000000..f627767 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR235.3D @@ -0,0 +1,50 @@ + 3 1 0 3 2 0 10 + 8 1 0 8 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 6 7 0 6 8 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 + 6 7 0 7 7 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR236.3D b/3D GFX/Swapping 3D engine/objects/font/LTR236.3D new file mode 100755 index 0000000..aeadc99 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR236.3D @@ -0,0 +1,36 @@ + 2 3 0 2 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 7 4 0 7 5 0 10 + 9 4 0 9 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 7 5 0 7 6 0 10 + 9 5 0 9 6 0 10 + 2 6 0 2 7 0 10 + 8 6 0 8 7 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 2 3 0 3 3 0 10 + 2 7 0 3 7 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 4 3 0 5 3 0 10 + 4 7 0 5 7 0 10 + 5 3 0 6 3 0 10 + 5 7 0 6 7 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 7 3 0 8 3 0 10 + 7 7 0 8 7 0 10 + 8 4 0 9 4 0 10 + 8 6 0 9 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR237.3D b/3D GFX/Swapping 3D engine/objects/font/LTR237.3D new file mode 100755 index 0000000..a6d5d6a --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR237.3D @@ -0,0 +1,44 @@ + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 2 2 0 2 3 0 10 + 7 2 0 7 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 1 3 0 2 3 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 2 0 3 2 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 4 2 0 5 2 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 6 1 0 7 1 0 10 + 6 7 0 7 7 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR238.3D b/3D GFX/Swapping 3D engine/objects/font/LTR238.3D new file mode 100755 index 0000000..0452f14 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR238.3D @@ -0,0 +1,36 @@ + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 1 4 0 1 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 1 3 0 2 3 0 10 + 1 6 0 2 6 0 10 + 2 2 0 3 2 0 10 + 2 7 0 3 7 0 10 + 3 1 0 4 1 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR239.3D b/3D GFX/Swapping 3D engine/objects/font/LTR239.3D new file mode 100755 index 0000000..5c06afb --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR239.3D @@ -0,0 +1,40 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 2 0 2 2 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR240.3D b/3D GFX/Swapping 3D engine/objects/font/LTR240.3D new file mode 100755 index 0000000..bcd22ca --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR240.3D @@ -0,0 +1,48 @@ + 1 2 0 1 3 0 10 + 8 2 0 8 3 0 10 + 1 4 0 1 5 0 10 + 8 4 0 8 5 0 10 + 1 6 0 1 7 0 10 + 8 6 0 8 7 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 2 7 0 3 7 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR241.3D b/3D GFX/Swapping 3D engine/objects/font/LTR241.3D new file mode 100755 index 0000000..81e85e1 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR241.3D @@ -0,0 +1,36 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 2 3 0 2 4 0 10 + 8 3 0 8 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR242.3D b/3D GFX/Swapping 3D engine/objects/font/LTR242.3D new file mode 100755 index 0000000..d7102f0 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR242.3D @@ -0,0 +1,36 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 2 0 6 2 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR243.3D b/3D GFX/Swapping 3D engine/objects/font/LTR243.3D new file mode 100755 index 0000000..abee609 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR243.3D @@ -0,0 +1,36 @@ + 5 1 0 5 2 0 10 + 7 1 0 7 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 2 0 5 2 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR244.3D b/3D GFX/Swapping 3D engine/objects/font/LTR244.3D new file mode 100755 index 0000000..46a732a --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR244.3D @@ -0,0 +1,24 @@ + 5 1 0 5 2 0 10 + 7 1 0 7 2 0 10 + 4 2 0 4 3 0 10 + 8 2 0 8 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 4 8 0 4 9 0 10 + 6 8 0 6 9 0 10 + 4 2 0 5 2 0 10 + 4 9 0 5 9 0 10 + 5 1 0 6 1 0 10 + 5 9 0 6 9 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR245.3D b/3D GFX/Swapping 3D engine/objects/font/LTR245.3D new file mode 100755 index 0000000..c5220b2 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR245.3D @@ -0,0 +1,22 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 2 6 0 2 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 2 6 0 3 6 0 10 + 2 7 0 3 7 0 10 + 3 6 0 4 6 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 7 0 6 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR246.3D b/3D GFX/Swapping 3D engine/objects/font/LTR246.3D new file mode 100755 index 0000000..b892620 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR246.3D @@ -0,0 +1,26 @@ + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 2 5 0 2 6 0 10 + 8 5 0 8 6 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR247.3D b/3D GFX/Swapping 3D engine/objects/font/LTR247.3D new file mode 100755 index 0000000..a5eb13f --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR247.3D @@ -0,0 +1,44 @@ + 2 2 0 2 3 0 10 + 5 2 0 5 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 7 3 0 7 4 0 10 + 2 5 0 2 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 4 6 0 4 7 0 10 + 7 6 0 7 7 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 7 0 3 7 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 6 7 0 7 7 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR248.3D b/3D GFX/Swapping 3D engine/objects/font/LTR248.3D new file mode 100755 index 0000000..81e9e8e --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR248.3D @@ -0,0 +1,32 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 1 2 0 2 2 0 10 + 1 4 0 2 4 0 10 + 2 1 0 3 1 0 10 + 2 5 0 3 5 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 6 1 0 7 1 0 10 + 6 5 0 7 5 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR249.3D b/3D GFX/Swapping 3D engine/objects/font/LTR249.3D new file mode 100755 index 0000000..c44b33a --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR249.3D @@ -0,0 +1,8 @@ + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR250.3D b/3D GFX/Swapping 3D engine/objects/font/LTR250.3D new file mode 100755 index 0000000..78ba839 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR250.3D @@ -0,0 +1,6 @@ + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR251.3D b/3D GFX/Swapping 3D engine/objects/font/LTR251.3D new file mode 100755 index 0000000..60e248d --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR251.3D @@ -0,0 +1,30 @@ + 4 1 0 4 2 0 10 + 9 1 0 9 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 6 5 0 6 6 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 4 1 0 5 1 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 8 1 0 9 1 0 10 + 8 2 0 9 2 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR252.3D b/3D GFX/Swapping 3D engine/objects/font/LTR252.3D new file mode 100755 index 0000000..3b3c226 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR252.3D @@ -0,0 +1,28 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 2 1 0 3 1 0 10 + 2 5 0 3 5 0 10 + 3 2 0 4 2 0 10 + 3 5 0 4 5 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 5 1 0 6 1 0 10 + 5 5 0 6 5 0 10 + 6 2 0 7 2 0 10 + 6 5 0 7 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR253.3D b/3D GFX/Swapping 3D engine/objects/font/LTR253.3D new file mode 100755 index 0000000..ceea4a4 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR253.3D @@ -0,0 +1,28 @@ + 2 1 0 2 2 0 10 + 5 1 0 5 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 1 4 0 1 5 0 10 + 6 4 0 6 5 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 5 0 4 5 0 10 + 4 1 0 5 1 0 10 + 4 5 0 5 5 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR254.3D b/3D GFX/Swapping 3D engine/objects/font/LTR254.3D new file mode 100755 index 0000000..94a0b7d --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR254.3D @@ -0,0 +1,18 @@ + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 2 6 0 2 7 0 10 + 7 6 0 7 7 0 10 + 2 3 0 3 3 0 10 + 2 7 0 3 7 0 10 + 3 3 0 4 3 0 10 + 3 7 0 4 7 0 10 + 4 3 0 5 3 0 10 + 4 7 0 5 7 0 10 + 5 3 0 6 3 0 10 + 5 7 0 6 7 0 10 + 6 3 0 7 3 0 10 + 6 7 0 7 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR255.3D b/3D GFX/Swapping 3D engine/objects/font/LTR255.3D new file mode 100755 index 0000000..e69de29 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR32.3D b/3D GFX/Swapping 3D engine/objects/font/LTR32.3D new file mode 100755 index 0000000..e69de29 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR33.3D b/3D GFX/Swapping 3D engine/objects/font/LTR33.3D new file mode 100755 index 0000000..9981886 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR33.3D @@ -0,0 +1,24 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 3 2 0 3 3 0 10 + 7 2 0 7 3 0 10 + 3 3 0 3 4 0 10 + 7 3 0 7 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 4 1 0 5 1 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR34.3D b/3D GFX/Swapping 3D engine/objects/font/LTR34.3D new file mode 100755 index 0000000..43a9f9e --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR34.3D @@ -0,0 +1,20 @@ + 2 1 0 2 2 0 10 + 4 1 0 4 2 0 10 + 5 1 0 5 2 0 10 + 7 1 0 7 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 2 1 0 3 1 0 10 + 2 4 0 3 4 0 10 + 3 1 0 4 1 0 10 + 3 4 0 4 4 0 10 + 5 1 0 6 1 0 10 + 5 4 0 6 4 0 10 + 6 1 0 7 1 0 10 + 6 4 0 7 4 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR35.3D b/3D GFX/Swapping 3D engine/objects/font/LTR35.3D new file mode 100755 index 0000000..269ce00 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR35.3D @@ -0,0 +1,44 @@ + 2 1 0 2 2 0 10 + 4 1 0 4 2 0 10 + 5 1 0 5 2 0 10 + 7 1 0 7 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 1 3 0 1 4 0 10 + 8 3 0 8 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 4 7 0 4 8 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR36.3D b/3D GFX/Swapping 3D engine/objects/font/LTR36.3D new file mode 100755 index 0000000..9b612b0 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR36.3D @@ -0,0 +1,48 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 2 2 0 2 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 7 6 0 7 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 2 7 0 3 7 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 4 1 0 5 1 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 7 0 7 7 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR37.3D b/3D GFX/Swapping 3D engine/objects/font/LTR37.3D new file mode 100755 index 0000000..56432ad --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR37.3D @@ -0,0 +1,38 @@ + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 6 0 3 6 0 10 + 2 8 0 3 8 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 5 3 0 6 3 0 10 + 5 5 0 6 5 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR38.3D b/3D GFX/Swapping 3D engine/objects/font/LTR38.3D new file mode 100755 index 0000000..9613bc8 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR38.3D @@ -0,0 +1,52 @@ + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 2 4 0 2 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 5 7 0 5 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR39.3D b/3D GFX/Swapping 3D engine/objects/font/LTR39.3D new file mode 100755 index 0000000..0ea2822 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR39.3D @@ -0,0 +1,12 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 4 1 0 5 1 0 10 + 4 4 0 5 4 0 10 + 5 1 0 6 1 0 10 + 5 3 0 6 3 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR40.3D b/3D GFX/Swapping 3D engine/objects/font/LTR40.3D new file mode 100755 index 0000000..255496e --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR40.3D @@ -0,0 +1,26 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 2 3 0 3 3 0 10 + 2 6 0 3 6 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 4 1 0 5 1 0 10 + 4 3 0 5 3 0 10 + 4 6 0 5 6 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR41.3D b/3D GFX/Swapping 3D engine/objects/font/LTR41.3D new file mode 100755 index 0000000..8096075 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR41.3D @@ -0,0 +1,26 @@ + 2 1 0 2 2 0 10 + 4 1 0 4 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 2 7 0 2 8 0 10 + 4 7 0 4 8 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 3 0 4 3 0 10 + 3 6 0 4 6 0 10 + 3 8 0 4 8 0 10 + 4 2 0 5 2 0 10 + 4 7 0 5 7 0 10 + 5 3 0 6 3 0 10 + 5 6 0 6 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR42.3D b/3D GFX/Swapping 3D engine/objects/font/LTR42.3D new file mode 100755 index 0000000..77a6463 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR42.3D @@ -0,0 +1,36 @@ + 1 2 0 1 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 8 6 0 8 7 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 2 0 3 2 0 10 + 2 7 0 3 7 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 4 3 0 5 3 0 10 + 4 6 0 5 6 0 10 + 5 2 0 6 2 0 10 + 5 7 0 6 7 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR43.3D b/3D GFX/Swapping 3D engine/objects/font/LTR43.3D new file mode 100755 index 0000000..cf7cff9 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR43.3D @@ -0,0 +1,22 @@ + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 2 4 0 2 5 0 10 + 8 4 0 8 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 4 2 0 5 2 0 10 + 4 7 0 5 7 0 10 + 5 2 0 6 2 0 10 + 5 7 0 6 7 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR44.3D b/3D GFX/Swapping 3D engine/objects/font/LTR44.3D new file mode 100755 index 0000000..b17183a --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR44.3D @@ -0,0 +1,12 @@ + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 5 7 0 5 8 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 5 0 5 5 0 10 + 4 8 0 5 8 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR45.3D b/3D GFX/Swapping 3D engine/objects/font/LTR45.3D new file mode 100755 index 0000000..a8d42ba --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR45.3D @@ -0,0 +1,16 @@ + 1 4 0 1 5 0 10 + 8 4 0 8 5 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR46.3D b/3D GFX/Swapping 3D engine/objects/font/LTR46.3D new file mode 100755 index 0000000..98ff4ca --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR46.3D @@ -0,0 +1,10 @@ + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 3 6 0 4 6 0 10 + 3 8 0 4 8 0 10 + 4 6 0 5 6 0 10 + 4 8 0 5 8 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR47.3D b/3D GFX/Swapping 3D engine/objects/font/LTR47.3D new file mode 100755 index 0000000..2a000b3 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR47.3D @@ -0,0 +1,28 @@ + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 3 4 0 3 5 0 10 + 5 4 0 5 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 1 7 0 1 8 0 10 + 2 7 0 2 8 0 10 + 1 6 0 2 6 0 10 + 1 8 0 2 8 0 10 + 2 5 0 3 5 0 10 + 2 7 0 3 7 0 10 + 3 4 0 4 4 0 10 + 3 6 0 4 6 0 10 + 4 3 0 5 3 0 10 + 4 5 0 5 5 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR48.3D b/3D GFX/Swapping 3D engine/objects/font/LTR48.3D new file mode 100755 index 0000000..fe7bcf2 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR48.3D @@ -0,0 +1,48 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 4 4 0 4 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 5 0 4 5 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR49.3D b/3D GFX/Swapping 3D engine/objects/font/LTR49.3D new file mode 100755 index 0000000..6c57234 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR49.3D @@ -0,0 +1,30 @@ + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 2 2 0 2 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 2 2 0 3 2 0 10 + 2 3 0 3 3 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR50.3D b/3D GFX/Swapping 3D engine/objects/font/LTR50.3D new file mode 100755 index 0000000..1af7b90 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR50.3D @@ -0,0 +1,50 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 8 7 0 8 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 2 6 0 3 6 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 5 0 4 5 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 4 0 7 4 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 6 0 8 6 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR51.3D b/3D GFX/Swapping 3D engine/objects/font/LTR51.3D new file mode 100755 index 0000000..06fc18f --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR51.3D @@ -0,0 +1,50 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 3 4 0 3 5 0 10 + 7 4 0 7 5 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 2 6 0 3 6 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR52.3D b/3D GFX/Swapping 3D engine/objects/font/LTR52.3D new file mode 100755 index 0000000..78092ac --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR52.3D @@ -0,0 +1,32 @@ + 5 1 0 5 2 0 10 + 7 1 0 7 2 0 10 + 4 2 0 4 3 0 10 + 7 2 0 7 3 0 10 + 3 3 0 3 4 0 10 + 7 3 0 7 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 1 5 0 2 5 0 10 + 1 6 0 2 6 0 10 + 2 4 0 3 4 0 10 + 2 6 0 3 6 0 10 + 3 3 0 4 3 0 10 + 3 6 0 4 6 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR53.3D b/3D GFX/Swapping 3D engine/objects/font/LTR53.3D new file mode 100755 index 0000000..51e3c92 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR53.3D @@ -0,0 +1,50 @@ + 1 1 0 1 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 1 3 0 1 4 0 10 + 7 3 0 7 4 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 1 0 2 1 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 4 0 3 4 0 10 + 2 6 0 3 6 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR54.3D b/3D GFX/Swapping 3D engine/objects/font/LTR54.3D new file mode 100755 index 0000000..5dbd567 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR54.3D @@ -0,0 +1,50 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 1 4 0 1 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR55.3D b/3D GFX/Swapping 3D engine/objects/font/LTR55.3D new file mode 100755 index 0000000..74f4a9a --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR55.3D @@ -0,0 +1,34 @@ + 1 1 0 1 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 1 1 0 2 1 0 10 + 1 3 0 2 3 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 5 0 5 5 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 5 0 7 5 0 10 + 7 1 0 8 1 0 10 + 7 4 0 8 4 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR56.3D b/3D GFX/Swapping 3D engine/objects/font/LTR56.3D new file mode 100755 index 0000000..c9fa0a2 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR56.3D @@ -0,0 +1,52 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR57.3D b/3D GFX/Swapping 3D engine/objects/font/LTR57.3D new file mode 100755 index 0000000..c790ac8 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR57.3D @@ -0,0 +1,50 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 2 4 0 2 5 0 10 + 8 4 0 8 5 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR58.3D b/3D GFX/Swapping 3D engine/objects/font/LTR58.3D new file mode 100755 index 0000000..2678315 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR58.3D @@ -0,0 +1,20 @@ + 4 2 0 4 3 0 10 + 7 2 0 7 3 0 10 + 4 3 0 4 4 0 10 + 7 3 0 7 4 0 10 + 4 6 0 4 7 0 10 + 7 6 0 7 7 0 10 + 4 7 0 4 8 0 10 + 7 7 0 7 8 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 8 0 5 8 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR59.3D b/3D GFX/Swapping 3D engine/objects/font/LTR59.3D new file mode 100755 index 0000000..a23d9dd --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR59.3D @@ -0,0 +1,20 @@ + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 3 8 0 3 9 0 10 + 5 8 0 5 9 0 10 + 3 8 0 4 8 0 10 + 3 9 0 4 9 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 9 0 5 9 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR60.3D b/3D GFX/Swapping 3D engine/objects/font/LTR60.3D new file mode 100755 index 0000000..93c051d --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR60.3D @@ -0,0 +1,30 @@ + 5 1 0 5 2 0 10 + 7 1 0 7 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 5 7 0 5 8 0 10 + 7 7 0 7 8 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 3 3 0 4 3 0 10 + 3 6 0 4 6 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 5 1 0 6 1 0 10 + 5 3 0 6 3 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR61.3D b/3D GFX/Swapping 3D engine/objects/font/LTR61.3D new file mode 100755 index 0000000..7334a08 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR61.3D @@ -0,0 +1,32 @@ + 1 3 0 1 4 0 10 + 8 3 0 8 4 0 10 + 1 6 0 1 7 0 10 + 8 6 0 8 7 0 10 + 1 3 0 2 3 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 6 0 3 6 0 10 + 2 7 0 3 7 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 7 3 0 8 3 0 10 + 7 4 0 8 4 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR62.3D b/3D GFX/Swapping 3D engine/objects/font/LTR62.3D new file mode 100755 index 0000000..821766c --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR62.3D @@ -0,0 +1,30 @@ + 2 1 0 2 2 0 10 + 4 1 0 4 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 2 7 0 2 8 0 10 + 4 7 0 4 8 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 3 0 4 3 0 10 + 3 6 0 4 6 0 10 + 3 8 0 4 8 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 5 3 0 6 3 0 10 + 5 6 0 6 6 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR63.3D b/3D GFX/Swapping 3D engine/objects/font/LTR63.3D new file mode 100755 index 0000000..4b11d9c --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR63.3D @@ -0,0 +1,36 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 7 0 4 8 0 10 + 6 7 0 6 8 0 10 + 1 2 0 2 2 0 10 + 1 3 0 2 3 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 5 0 7 5 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR64.3D b/3D GFX/Swapping 3D engine/objects/font/LTR64.3D new file mode 100755 index 0000000..797aa6c --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR64.3D @@ -0,0 +1,50 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 4 4 0 4 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 6 0 7 6 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR65.3D b/3D GFX/Swapping 3D engine/objects/font/LTR65.3D new file mode 100755 index 0000000..faaddfa --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR65.3D @@ -0,0 +1,44 @@ + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 3 0 2 3 0 10 + 1 8 0 2 8 0 10 + 2 2 0 3 2 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 3 0 4 3 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 3 0 6 3 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 6 2 0 7 2 0 10 + 6 8 0 7 8 0 10 + 7 3 0 8 3 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR66.3D b/3D GFX/Swapping 3D engine/objects/font/LTR66.3D new file mode 100755 index 0000000..4b6c653 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR66.3D @@ -0,0 +1,48 @@ + 1 1 0 1 2 0 10 + 7 1 0 7 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 7 7 0 7 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR67.3D b/3D GFX/Swapping 3D engine/objects/font/LTR67.3D new file mode 100755 index 0000000..2f94d93 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR67.3D @@ -0,0 +1,42 @@ + 3 1 0 3 2 0 10 + 7 1 0 7 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 3 7 0 3 8 0 10 + 7 7 0 7 8 0 10 + 1 3 0 2 3 0 10 + 1 6 0 2 6 0 10 + 2 2 0 3 2 0 10 + 2 7 0 3 7 0 10 + 3 1 0 4 1 0 10 + 3 3 0 4 3 0 10 + 3 6 0 4 6 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR68.3D b/3D GFX/Swapping 3D engine/objects/font/LTR68.3D new file mode 100755 index 0000000..880065c --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR68.3D @@ -0,0 +1,44 @@ + 1 1 0 1 2 0 10 + 6 1 0 6 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 6 7 0 6 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 3 0 6 3 0 10 + 5 6 0 6 6 0 10 + 5 8 0 6 8 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 7 3 0 8 3 0 10 + 7 6 0 8 6 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR69.3D b/3D GFX/Swapping 3D engine/objects/font/LTR69.3D new file mode 100755 index 0000000..37fddb8 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR69.3D @@ -0,0 +1,48 @@ + 1 1 0 1 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 7 2 0 7 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 1 4 0 1 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 7 6 0 7 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 3 0 8 3 0 10 + 7 6 0 8 6 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR70.3D b/3D GFX/Swapping 3D engine/objects/font/LTR70.3D new file mode 100755 index 0000000..6b7c9cf --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR70.3D @@ -0,0 +1,40 @@ + 1 1 0 1 2 0 10 + 8 1 0 8 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 7 2 0 7 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 1 7 0 1 8 0 10 + 5 7 0 5 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 4 0 7 4 0 10 + 6 5 0 7 5 0 10 + 7 1 0 8 1 0 10 + 7 3 0 8 3 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR71.3D b/3D GFX/Swapping 3D engine/objects/font/LTR71.3D new file mode 100755 index 0000000..eca32d5 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR71.3D @@ -0,0 +1,48 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 5 0 6 5 0 10 + 5 6 0 6 6 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 5 0 7 5 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR72.3D b/3D GFX/Swapping 3D engine/objects/font/LTR72.3D new file mode 100755 index 0000000..83489a5 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR72.3D @@ -0,0 +1,40 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR73.3D b/3D GFX/Swapping 3D engine/objects/font/LTR73.3D new file mode 100755 index 0000000..1e5d7c0 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR73.3D @@ -0,0 +1,26 @@ + 3 1 0 3 2 0 10 + 7 1 0 7 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 7 7 0 7 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR74.3D b/3D GFX/Swapping 3D engine/objects/font/LTR74.3D new file mode 100755 index 0000000..776b3f4 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR74.3D @@ -0,0 +1,32 @@ + 3 1 0 3 2 0 10 + 7 1 0 7 2 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 2 7 0 2 8 0 10 + 5 7 0 5 8 0 10 + 1 5 0 2 5 0 10 + 1 7 0 2 7 0 10 + 2 5 0 3 5 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 7 0 6 7 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR75.3D b/3D GFX/Swapping 3D engine/objects/font/LTR75.3D new file mode 100755 index 0000000..db2fdc8 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR75.3D @@ -0,0 +1,46 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 1 4 0 1 5 0 10 + 5 4 0 5 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 4 3 0 5 3 0 10 + 4 6 0 5 6 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR76.3D b/3D GFX/Swapping 3D engine/objects/font/LTR76.3D new file mode 100755 index 0000000..0176492 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR76.3D @@ -0,0 +1,34 @@ + 1 1 0 1 2 0 10 + 5 1 0 5 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 7 6 0 7 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 6 0 8 6 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR77.3D b/3D GFX/Swapping 3D engine/objects/font/LTR77.3D new file mode 100755 index 0000000..7832c68 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR77.3D @@ -0,0 +1,44 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 4 4 0 4 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 4 3 0 5 3 0 10 + 4 6 0 5 6 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR78.3D b/3D GFX/Swapping 3D engine/objects/font/LTR78.3D new file mode 100755 index 0000000..f1281ae --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR78.3D @@ -0,0 +1,42 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 5 0 4 5 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR79.3D b/3D GFX/Swapping 3D engine/objects/font/LTR79.3D new file mode 100755 index 0000000..6e293f9 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR79.3D @@ -0,0 +1,44 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR80.3D b/3D GFX/Swapping 3D engine/objects/font/LTR80.3D new file mode 100755 index 0000000..d307dc8 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR80.3D @@ -0,0 +1,40 @@ + 1 1 0 1 2 0 10 + 7 1 0 7 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 1 7 0 1 8 0 10 + 5 7 0 5 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 6 1 0 7 1 0 10 + 6 5 0 7 5 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR81.3D b/3D GFX/Swapping 3D engine/objects/font/LTR81.3D new file mode 100755 index 0000000..424817f --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR81.3D @@ -0,0 +1,50 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 6 8 0 6 9 0 10 + 8 8 0 8 9 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 6 0 5 6 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 9 0 7 9 0 10 + 7 2 0 8 2 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 + 7 9 0 8 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR82.3D b/3D GFX/Swapping 3D engine/objects/font/LTR82.3D new file mode 100755 index 0000000..2c79434 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR82.3D @@ -0,0 +1,48 @@ + 1 1 0 1 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 7 4 0 7 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 6 1 0 7 1 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 4 0 8 4 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR83.3D b/3D GFX/Swapping 3D engine/objects/font/LTR83.3D new file mode 100755 index 0000000..4f6b2b1 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR83.3D @@ -0,0 +1,52 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 2 4 0 2 5 0 10 + 7 4 0 7 5 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 2 0 2 2 0 10 + 1 4 0 2 4 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 5 0 3 5 0 10 + 2 6 0 3 6 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 2 0 8 2 0 10 + 7 3 0 8 3 0 10 + 7 5 0 8 5 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR84.3D b/3D GFX/Swapping 3D engine/objects/font/LTR84.3D new file mode 100755 index 0000000..cb09b71 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR84.3D @@ -0,0 +1,34 @@ + 2 1 0 2 2 0 10 + 8 1 0 8 2 0 10 + 2 2 0 2 3 0 10 + 3 2 0 3 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 7 2 0 7 3 0 10 + 8 2 0 8 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 7 7 0 7 8 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 3 0 8 3 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR85.3D b/3D GFX/Swapping 3D engine/objects/font/LTR85.3D new file mode 100755 index 0000000..220ef59 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR85.3D @@ -0,0 +1,40 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 1 0 2 1 0 10 + 1 7 0 2 7 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR86.3D b/3D GFX/Swapping 3D engine/objects/font/LTR86.3D new file mode 100755 index 0000000..e47f39c --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR86.3D @@ -0,0 +1,38 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 4 7 0 4 8 0 10 + 5 7 0 5 8 0 10 + 1 1 0 2 1 0 10 + 1 5 0 2 5 0 10 + 2 1 0 3 1 0 10 + 2 6 0 3 6 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 4 6 0 5 6 0 10 + 4 8 0 5 8 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 6 1 0 7 1 0 10 + 6 6 0 7 6 0 10 + 7 1 0 8 1 0 10 + 7 5 0 8 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR87.3D b/3D GFX/Swapping 3D engine/objects/font/LTR87.3D new file mode 100755 index 0000000..8e76d1d --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR87.3D @@ -0,0 +1,44 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 1 3 0 1 4 0 10 + 3 3 0 3 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 4 4 0 4 5 0 10 + 5 4 0 5 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 8 5 0 8 6 0 10 + 1 6 0 1 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 4 3 0 5 3 0 10 + 4 6 0 5 6 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR88.3D b/3D GFX/Swapping 3D engine/objects/font/LTR88.3D new file mode 100755 index 0000000..e0aa360 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR88.3D @@ -0,0 +1,44 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 3 3 0 3 4 0 10 + 6 3 0 6 4 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 3 5 0 3 6 0 10 + 6 5 0 6 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 1 7 0 1 8 0 10 + 3 7 0 3 8 0 10 + 6 7 0 6 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 2 6 0 3 6 0 10 + 2 8 0 3 8 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 4 3 0 5 3 0 10 + 4 6 0 5 6 0 10 + 5 2 0 6 2 0 10 + 5 7 0 6 7 0 10 + 6 1 0 7 1 0 10 + 6 3 0 7 3 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 2 0 8 2 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR89.3D b/3D GFX/Swapping 3D engine/objects/font/LTR89.3D new file mode 100755 index 0000000..b037de4 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR89.3D @@ -0,0 +1,36 @@ + 2 1 0 2 2 0 10 + 4 1 0 4 2 0 10 + 6 1 0 6 2 0 10 + 8 1 0 8 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 8 3 0 8 4 0 10 + 3 4 0 3 5 0 10 + 7 4 0 7 5 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 3 7 0 3 8 0 10 + 7 7 0 7 8 0 10 + 2 1 0 3 1 0 10 + 2 4 0 3 4 0 10 + 3 1 0 4 1 0 10 + 3 5 0 4 5 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 4 0 5 4 0 10 + 4 8 0 5 8 0 10 + 5 4 0 6 4 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 5 0 7 5 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 4 0 8 4 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR90.3D b/3D GFX/Swapping 3D engine/objects/font/LTR90.3D new file mode 100755 index 0000000..c8e42ce --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR90.3D @@ -0,0 +1,50 @@ + 1 1 0 1 2 0 10 + 8 1 0 8 2 0 10 + 1 2 0 1 3 0 10 + 2 2 0 2 3 0 10 + 6 2 0 6 3 0 10 + 8 2 0 8 3 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 3 5 0 3 6 0 10 + 5 5 0 5 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 7 6 0 7 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 3 0 2 3 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 6 0 3 6 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 5 0 4 5 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 4 0 5 4 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 3 0 6 3 0 10 + 5 5 0 6 5 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 4 0 7 4 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 + 7 1 0 8 1 0 10 + 7 3 0 8 3 0 10 + 7 6 0 8 6 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR91.3D b/3D GFX/Swapping 3D engine/objects/font/LTR91.3D new file mode 100755 index 0000000..91b7752 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR91.3D @@ -0,0 +1,30 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 2 0 6 2 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 2 0 7 2 0 10 + 6 7 0 7 7 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR92.3D b/3D GFX/Swapping 3D engine/objects/font/LTR92.3D new file mode 100755 index 0000000..a5fbdba --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR92.3D @@ -0,0 +1,28 @@ + 1 1 0 1 2 0 10 + 3 1 0 3 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 3 3 0 3 4 0 10 + 5 3 0 5 4 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 7 7 0 7 8 0 10 + 8 7 0 8 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 2 1 0 3 1 0 10 + 2 3 0 3 3 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 4 3 0 5 3 0 10 + 4 5 0 5 5 0 10 + 5 4 0 6 4 0 10 + 5 6 0 6 6 0 10 + 6 5 0 7 5 0 10 + 6 7 0 7 7 0 10 + 7 6 0 8 6 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR93.3D b/3D GFX/Swapping 3D engine/objects/font/LTR93.3D new file mode 100755 index 0000000..4c6475c --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR93.3D @@ -0,0 +1,30 @@ + 2 1 0 2 2 0 10 + 7 1 0 7 2 0 10 + 5 2 0 5 3 0 10 + 7 2 0 7 3 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 5 5 0 5 6 0 10 + 7 5 0 7 6 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 2 1 0 3 1 0 10 + 2 2 0 3 2 0 10 + 2 7 0 3 7 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 2 0 4 2 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 1 0 5 1 0 10 + 4 2 0 5 2 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 1 0 6 1 0 10 + 5 8 0 6 8 0 10 + 6 1 0 7 1 0 10 + 6 8 0 7 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR94.3D b/3D GFX/Swapping 3D engine/objects/font/LTR94.3D new file mode 100755 index 0000000..15f43e7 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR94.3D @@ -0,0 +1,26 @@ + 4 1 0 4 2 0 10 + 5 1 0 5 2 0 10 + 3 2 0 3 3 0 10 + 6 2 0 6 3 0 10 + 2 3 0 2 4 0 10 + 4 3 0 4 4 0 10 + 5 3 0 5 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 4 0 2 4 0 10 + 1 5 0 2 5 0 10 + 2 3 0 3 3 0 10 + 2 5 0 3 5 0 10 + 3 2 0 4 2 0 10 + 3 4 0 4 4 0 10 + 4 1 0 5 1 0 10 + 4 3 0 5 3 0 10 + 5 2 0 6 2 0 10 + 5 4 0 6 4 0 10 + 6 3 0 7 3 0 10 + 6 5 0 7 5 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR95.3D b/3D GFX/Swapping 3D engine/objects/font/LTR95.3D new file mode 100755 index 0000000..720440f --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR95.3D @@ -0,0 +1,18 @@ + 1 8 0 1 9 0 10 + 9 8 0 9 9 0 10 + 1 8 0 2 8 0 10 + 1 9 0 2 9 0 10 + 2 8 0 3 8 0 10 + 2 9 0 3 9 0 10 + 3 8 0 4 8 0 10 + 3 9 0 4 9 0 10 + 4 8 0 5 8 0 10 + 4 9 0 5 9 0 10 + 5 8 0 6 8 0 10 + 5 9 0 6 9 0 10 + 6 8 0 7 8 0 10 + 6 9 0 7 9 0 10 + 7 8 0 8 8 0 10 + 7 9 0 8 9 0 10 + 8 8 0 9 8 0 10 + 8 9 0 9 9 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR96.3D b/3D GFX/Swapping 3D engine/objects/font/LTR96.3D new file mode 100755 index 0000000..e6dfc49 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR96.3D @@ -0,0 +1,12 @@ + 3 1 0 3 2 0 10 + 5 1 0 5 2 0 10 + 3 2 0 3 3 0 10 + 5 2 0 5 3 0 10 + 4 3 0 4 4 0 10 + 6 3 0 6 4 0 10 + 3 1 0 4 1 0 10 + 3 3 0 4 3 0 10 + 4 1 0 5 1 0 10 + 4 4 0 5 4 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR97.3D b/3D GFX/Swapping 3D engine/objects/font/LTR97.3D new file mode 100755 index 0000000..5016e75 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR97.3D @@ -0,0 +1,36 @@ + 2 3 0 2 4 0 10 + 6 3 0 6 4 0 10 + 5 4 0 5 5 0 10 + 7 4 0 7 5 0 10 + 2 5 0 2 6 0 10 + 7 5 0 7 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 5 6 0 5 7 0 10 + 7 6 0 7 7 0 10 + 2 7 0 2 8 0 10 + 8 7 0 8 8 0 10 + 1 6 0 2 6 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 4 0 3 4 0 10 + 2 5 0 3 5 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 5 0 4 5 0 10 + 3 6 0 4 6 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 5 0 5 5 0 10 + 4 6 0 5 6 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 8 0 6 8 0 10 + 6 4 0 7 4 0 10 + 6 8 0 7 8 0 10 + 7 7 0 8 7 0 10 + 7 8 0 8 8 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR98.3D b/3D GFX/Swapping 3D engine/objects/font/LTR98.3D new file mode 100755 index 0000000..f2324d2 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR98.3D @@ -0,0 +1,40 @@ + 1 1 0 1 2 0 10 + 4 1 0 4 2 0 10 + 2 2 0 2 3 0 10 + 4 2 0 4 3 0 10 + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 2 4 0 2 5 0 10 + 4 4 0 4 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 2 5 0 2 6 0 10 + 4 5 0 4 6 0 10 + 6 5 0 6 6 0 10 + 8 5 0 8 6 0 10 + 2 6 0 2 7 0 10 + 4 6 0 4 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 1 7 0 1 8 0 10 + 7 7 0 7 8 0 10 + 1 1 0 2 1 0 10 + 1 2 0 2 2 0 10 + 1 7 0 2 7 0 10 + 1 8 0 2 8 0 10 + 2 1 0 3 1 0 10 + 2 8 0 3 8 0 10 + 3 1 0 4 1 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 8 0 7 8 0 10 + 7 4 0 8 4 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/LTR99.3D b/3D GFX/Swapping 3D engine/objects/font/LTR99.3D new file mode 100755 index 0000000..68cfd33 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/LTR99.3D @@ -0,0 +1,38 @@ + 2 3 0 2 4 0 10 + 7 3 0 7 4 0 10 + 1 4 0 1 5 0 10 + 3 4 0 3 5 0 10 + 6 4 0 6 5 0 10 + 8 4 0 8 5 0 10 + 1 5 0 1 6 0 10 + 3 5 0 3 6 0 10 + 1 6 0 1 7 0 10 + 3 6 0 3 7 0 10 + 6 6 0 6 7 0 10 + 8 6 0 8 7 0 10 + 2 7 0 2 8 0 10 + 7 7 0 7 8 0 10 + 1 4 0 2 4 0 10 + 1 7 0 2 7 0 10 + 2 3 0 3 3 0 10 + 2 8 0 3 8 0 10 + 3 3 0 4 3 0 10 + 3 4 0 4 4 0 10 + 3 7 0 4 7 0 10 + 3 8 0 4 8 0 10 + 4 3 0 5 3 0 10 + 4 4 0 5 4 0 10 + 4 7 0 5 7 0 10 + 4 8 0 5 8 0 10 + 5 3 0 6 3 0 10 + 5 4 0 6 4 0 10 + 5 7 0 6 7 0 10 + 5 8 0 6 8 0 10 + 6 3 0 7 3 0 10 + 6 5 0 7 5 0 10 + 6 6 0 7 6 0 10 + 6 8 0 7 8 0 10 + 7 4 0 8 4 0 10 + 7 5 0 8 5 0 10 + 7 6 0 8 6 0 10 + 7 7 0 8 7 0 10 diff --git a/3D GFX/Swapping 3D engine/objects/font/mk3dfont.bas b/3D GFX/Swapping 3D engine/objects/font/mk3dfont.bas new file mode 100755 index 0000000..fa50e58 --- /dev/null +++ b/3D GFX/Swapping 3D engine/objects/font/mk3dfont.bas @@ -0,0 +1,44 @@ +' 3D font table generator +' made by Svjatoslav Agejenko +' last edit 2004.01 +' H-Page: svjatoslav.eu +' E-Mail: svjatoslav@svjatoslav.eu + +DECLARE SUB ln (x1!, y1!, x2!, y2!) +SCREEN 13 + +FOR a = 32 TO 255 + LOCATE 2, 2 + PRINT CHR$(a) + n$ = STR$(a) + IF LEFT$(n$, 1) = " " THEN n$ = RIGHT$(n$, LEN(n$) - 1) + + n$ = "ltr" + n$ + ".3d" + + OPEN n$ FOR OUTPUT AS #1 + FOR y = 0 TO 15 + FOR x = 0 TO 15 + c1 = POINT(x, y) + c2 = POINT(x + 1, y) + IF c2 <> c1 THEN ln x + 1, y, x + 1, y + 1 + NEXT x + NEXT y + + FOR x = 0 TO 15 + FOR y = 0 TO 15 + c1 = POINT(x, y) + c2 = POINT(x, y + 1) + IF c2 <> c1 THEN ln x, y + 1, x + 1, y + 1 + NEXT y + NEXT x + + CLOSE #1 +NEXT a +SCREEN 0 +PRINT "done" +SYSTEM + +SUB ln (x1, y1, x2, y2) + PRINT #1, x1 - 7; y1 - 7; 0; x2 - 7; y2 - 7; 0; 10 +END SUB + diff --git a/3D GFX/Swapping 3D engine/qbext.com b/3D GFX/Swapping 3D engine/qbext.com new file mode 100755 index 0000000..ae54fc4 Binary files /dev/null and b/3D GFX/Swapping 3D engine/qbext.com differ diff --git a/3D GFX/Swapping 3D engine/run.bat b/3D GFX/Swapping 3D engine/run.bat new file mode 100755 index 0000000..2558764 --- /dev/null +++ b/3D GFX/Swapping 3D engine/run.bat @@ -0,0 +1,2 @@ +qbext +qb /run engine.bas \ No newline at end of file diff --git a/3D GFX/Swapping 3D engine/screenshot, 2.png b/3D GFX/Swapping 3D engine/screenshot, 2.png new file mode 100644 index 0000000..3eca5d1 Binary files /dev/null and b/3D GFX/Swapping 3D engine/screenshot, 2.png differ diff --git a/3D GFX/Swapping 3D engine/screenshot.png b/3D GFX/Swapping 3D engine/screenshot.png new file mode 100755 index 0000000..d482abb Binary files /dev/null and b/3D GFX/Swapping 3D engine/screenshot.png differ diff --git a/3D GFX/qbext.com b/3D GFX/qbext.com new file mode 100755 index 0000000..ae54fc4 Binary files /dev/null and b/3D GFX/qbext.com differ diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/COPYING @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/Games/Worm/1.lvl b/Games/Worm/1.lvl new file mode 100644 index 0000000..6997eeb --- /dev/null +++ b/Games/Worm/1.lvl @@ -0,0 +1,35 @@ +/################################### +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm# +/################################### diff --git a/Games/Worm/10.lvl b/Games/Worm/10.lvl new file mode 100644 index 0000000..24198ec --- /dev/null +++ b/Games/Worm/10.lvl @@ -0,0 +1,35 @@ +/###################### ########## +/###################### ########## +/#m m ## +/#m m ## +/#m m ## +/#m mmmmmmmmmmmmm m ## +/#m m m ## +/#m m m ## +/#m m m ## +/#mmmmmmmmmm m m ## +/#m m m ## +/#m m m ## +/#m m m ## +/#m mmmmmmmmmmmmm m ## +/#m m ## +/#m m ## +/#m m ## +/#m m m m# +/#mmmmmmmmmmmmmmmmm m ## +/ m m +/ m m +/ m m +/#m m mmmmmmmmmmmmmmmmm# +/#m m m m# +/#m m m m# +/#m m m m# +/ m +/ m +/ m +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmm m# +/ m +/ m +/ m +/#mmmmmmmmmmmmmmmmmmmmm mmmmmmmmm# +/###################### ########## diff --git a/Games/Worm/11.lvl b/Games/Worm/11.lvl new file mode 100644 index 0000000..aa94d33 --- /dev/null +++ b/Games/Worm/11.lvl @@ -0,0 +1,35 @@ +/################################### +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm# +/#m m# +/#m m# +/#m m m m m m# +/#m mm m m mm m# +/#m mmm m m mmm m# +/#m m m m m m m m# +/#m m m m m m m m# +/#m m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m m m# +/#m m mm m mm m m# +/#m m mmm mmm m m# +/#m m m m m m m m# +/#m m m m m m m m# +/#m m m m m m m m# +/#m m m m m m m m# +/#m m m m m m m m# +/#m m m m m m m# +/#m m# +/#m m# +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm# +/################################### diff --git a/Games/Worm/2.lvl b/Games/Worm/2.lvl new file mode 100644 index 0000000..474800b --- /dev/null +++ b/Games/Worm/2.lvl @@ -0,0 +1,35 @@ +/################################### +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm# +/#m mm +/#m m# +/#m m# +/#m m# +/#m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm# +/################################### diff --git a/Games/Worm/3.lvl b/Games/Worm/3.lvl new file mode 100644 index 0000000..bfbdba5 --- /dev/null +++ b/Games/Worm/3.lvl @@ -0,0 +1,35 @@ +/########### ### ########### +/#mmmmmmmmmm mmm mmmmmmmmmm# +/#mmmmmmmm mmmmmmmm# +/#mmmmmm mmmmmm# +/#mmmmm mmmmm# +/#mmmm mmm mmmm# +/#mmm mmmmm mmm# +/mmm mmmmm mm# +/#mm mmm mm# +/#m m m# +/#m m m# +/ m +/ m +/ m +/ mmm +/ mm mmm mm +/#m mmmm mmmmmmm mmmm m# +/#m mmmmmmmmmmmmmmmmmmmmmmmmm m# +/#m mmmm mmmmmmm mmmm m# +/ mm mmm mm +/ mmm +/ m +/ m +/ m +/#m m m# +/#m m m# +/#mm mmm mm# +/#mm mmmmm mm# +/#mmm mmmmm mmm# +/#mmmm mmm mmmm# +/#mmmmm mmmmm# +/#mmmmmm mmmmmm# +/#mmmmmmmm mmmmmmmm# +/#mmmmmmmmmm mmm mmmmmmmmmm# +/########### ### ########### diff --git a/Games/Worm/4.lvl b/Games/Worm/4.lvl new file mode 100644 index 0000000..7b64d2b --- /dev/null +++ b/Games/Worm/4.lvl @@ -0,0 +1,35 @@ +/ +/ +/ +/ +/ +/ mm mm +/ m m +/ +/ m m +/ mm mm +/ +/ +/ +/ +/ +/ mmmmmmmmmmmmmmmmm +/ m +/ m +/ m m +/ m m +/ m m +/ mmmmmmmmmmmmmm +/ m m +/ m m +/ m m +/ m +/ m m +/ mmmmmmmmmmmmm m +/ m +/ +/ m +/ m +/ m +/ +/ diff --git a/Games/Worm/5.lvl b/Games/Worm/5.lvl new file mode 100644 index 0000000..73d9bdb --- /dev/null +++ b/Games/Worm/5.lvl @@ -0,0 +1,35 @@ +/################ ################ +/#mmmmmmmmmmmmmmm mmmmmmmmmmmmmmm# +/#m m# +/#m m# +/#m m# +/#m ##### ##### ###### m# +/#m # # m# +/#m # # m# +/#m # # m# +/#m # # m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m # ##### # m# +/ # ##### # +/ # ##### # +/ # ##### # +/#m # ##### # mm +/#m m# +/#m m# +/#m m# +/#m m# +/#m m# +/#m # # m# +/#m # # m# +/#m # # m# +/#m # # m# +/#m ##### ##### ##### m# +/#m mm +/#m m# +/#m m# +/#mmmmmmmmmmmmmmm mmmmmmmmmmmmmmm# +/################ ################ diff --git a/Games/Worm/6.lvl b/Games/Worm/6.lvl new file mode 100644 index 0000000..5bd15b8 --- /dev/null +++ b/Games/Worm/6.lvl @@ -0,0 +1,35 @@ +/###### ################### ###### +/#mmmmm mmmmmmmmmmmmmmmmmmm #mmmm# +/#m # m# +/#m # m# +/#m # m# +/#m ######################### m# +/#m m# +/#m m# +/#m m# +/###### mm +/ # # +/ # # +/#m # # m# +/#m # # m# +/#m # # # m# +/#m # # # m# +/#m # # # m# +/#m # ####### # m# +/#m # # # m# +/#m # m # m# +/#m # m # m# +/#m # # m# +/#m # # m# +/ # # +/ # # +/mm ###### +/#m m# +/#m m# +/#m m# +/#m ######################### m# +/#m # m# +/#m # m# +/#m # m# +/mmmmm# mmmmmmmmmmmmmmmmmmm mmmmm# +/###### ################### ###### diff --git a/Games/Worm/7.lvl b/Games/Worm/7.lvl new file mode 100644 index 0000000..2980fb8 --- /dev/null +++ b/Games/Worm/7.lvl @@ -0,0 +1,35 @@ +/ ############################# +/ mmmmmmmmmmmmmmmmmmmmmmmmmmmmm +/ m +/#m m m# +/#m m m# +/#m ######################### m# +/#m m# +/#m m# +/#m m# +/#m # m# +/#m # # m# +/#m # # m# +/#m # mmmmm mmmmm # m# +/#m # m m # m# +/#m # m m # m# +/#m # m m # m# +/#m # m m # m# +/#mmmm# m #mmmm# +/#m # m m # m# +/#m # m m # m# +/#m # m m # m# +/#m # m m # m# +/#m # mmmmm mmmmm # m# +/#m # # m# +/#m # # m# +/#m # # m# +/#m m# +/#m m# +/#m m# +/#m ######################### m# +/#m m m# +/#m m m# +/ m +/ mmmmmmmmmmmmmmmmmmmmmmmmmmmmm +/ ############################# diff --git a/Games/Worm/8.lvl b/Games/Worm/8.lvl new file mode 100644 index 0000000..d4bdc60 --- /dev/null +++ b/Games/Worm/8.lvl @@ -0,0 +1,35 @@ +/################################### +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm# +/#m m# +/#m mmmmm mmmmm m# +/#m mm mm m# +/#m m m m# +/#m m m m# +/#m m m m# +/#m m m m# +/ +/ +/#m m# +/#m m# +/#m m mmmm m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m mmmmmmmmm m m# +/#m m m m m m# +/#m m m m m m# +/#m m m m m m# +/#m m mmmm m m# +/#m m# +/#m m# +/ +/ +/#m m m m# +/#m m m m# +/#m m m m# +/#m m m m# +/#m mm mm m# +/#m mmmmm mmmmm m# +/#m m# +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm# +/################################### diff --git a/Games/Worm/9.lvl b/Games/Worm/9.lvl new file mode 100644 index 0000000..8ebef51 --- /dev/null +++ b/Games/Worm/9.lvl @@ -0,0 +1,35 @@ +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm# +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm# +/ +/ +/ m +/ mmm +/ mmmmm +/ m +/ m +/ mmmmmmmmmm +/ +/ +/ +/ +/ +/ +/ mmmmm mmmmm mmmmm mmmmm +/ mmmmm mmmmm mmmmm mmmmm +/ +/ +/ +/ +/ +/ +/ +/ +/ +/ +/ +/ +/ +/ +/ +/#mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm# +/################################### diff --git a/Games/Worm/screencast.webm b/Games/Worm/screencast.webm new file mode 100644 index 0000000..9fa029c Binary files /dev/null and b/Games/Worm/screencast.webm differ diff --git a/Games/Worm/worm.bas b/Games/Worm/worm.bas new file mode 100755 index 0000000..b040633 --- /dev/null +++ b/Games/Worm/worm.bas @@ -0,0 +1,879 @@ +' Game of worms. +' +' Game supports up to 5 players. Any amount of those players can be AI controlled. +' +' Goal for each player is to eat as many fruits as possible while avoiding collisions +' with walls and other worms. +' +' Game has multiple levels. After worms have eaten certain amount of fruits, game +' advances to the next level. +' +' Each worm has limited amount of lives. When worm runs into the wall or +' another worm, it loses one life. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2002, Initial version +' 2024-2005, Improved program readability + +DECLARE FUNCTION cnum$ (a%) +DECLARE SUB putworm (a%) +DECLARE SUB level (a%) +DECLARE SUB showb () +DECLARE SUB sc2 (x%, y%) +DECLARE SUB ai (a%) +DECLARE SUB autop (a%) +DECLARE SUB prc (a%) +DECLARE SUB dead (a%) +DECLARE SUB add (a%) +DECLARE SUB tkt () +DECLARE SUB subt (b%) +DECLARE SUB show () +DECLARE SUB sc (x%, y%) +DEFINT A-Z + +' Shared arrays for the game grid and worms +DIM SHARED buf(0 TO 36, 0 TO 36) +DIM SHARED buf2(0 TO 36, 0 TO 36) +DIM SHARED ussx(1 TO 2000, 1 TO 5) +DIM SHARED ussy(1 TO 2000, 1 TO 5) +DIM SHARED ussp(1 TO 5) +DIM SHARED ussl(1 TO 5) +DIM SHARED usss(1 TO 5) +DIM SHARED ussk(1 TO 2000, 1 TO 5) +DIM SHARED usskp(1 TO 5) + +' Variables for worm positions and game state +DIM SHARED ux(1 TO 5), uy(1 TO 5), uxp(1 TO 5), uyp(1 TO 5) +DIM SHARED mtm +DIM SHARED playerCount +DIM SHARED lives(1 TO 5) +DIM SHARED isAI(1 TO 5) +DIM SHARED ail +DIM SHARED lvl +DIM SHARED elum +DIM SHARED spd + +playerCount = 1 +ail = 10 +lvl = 1 + +' Array defines if player is human (0) or computer (1). +isAI(1) = 0 +isAI(2) = 0 +isAI(3) = 0 +isAI(4) = 0 +isAI(5) = 0 + +CLS + +INPUT "How many players (1 - 5):", playerCount +INPUT "How many of them are computers:", a +FOR b = playerCount TO playerCount - a + 1 STEP -1 + isAI(b) = 1 +NEXT b + +INPUT "How many lives:", elum +INPUT "Speed: (1-slow, 3-ok, 10-very fast)", spd + +start + +level lvl +1 +tkt +delay .5 / spd +' spd +IF mtm >= 15 THEN + mtm = 1 + lvl = lvl + 1 + level lvl +END IF +GOTO 1 + +SUB ai (a%) + ' This subroutine handles the AI logic for computer-controlled worms. + FOR y = 0 TO 36 + FOR x = 0 TO 36 + buf2(x, y) = 32000 + IF buf(x, y) = 2 THEN buf2(x, y) = 0 + IF buf(x, y) > 9 OR buf(x, y) = 1 THEN buf2(x, y) = -1 + NEXT x + NEXT y + + ' Set the target position to the center of the grid. + IF buf2(16, 16) = 32000 THEN buf2(16, 16) = 15000 + +6 + b = 0 + FOR y = 1 TO 35 + FOR x = 1 TO 34 + IF (buf2(x + 1, y) > buf2(x, y) + 1) AND (buf2(x, y) >= 0) THEN + buf2(x + 1, y) = buf2(x, y) + 1 + b = 1 + END IF + NEXT x + + ' Check if moving left is the shortest path. + FOR x = 35 TO 2 STEP -1 + IF (buf2(x - 1, y) > buf2(x, y) + 1) AND (buf2(x, y) >= 0) THEN + buf2(x - 1, y) = buf2(x, y) + 1 + b = 1 + END IF + NEXT x + + IF (buf2(1, y) > buf2(35, y) + 1) AND (buf2(35, y) >= 0) THEN + buf2(1, y) = buf2(35, y) + 1 + b = 1 + END IF + + IF (buf2(35, y) > buf2(1, y) + 1) AND (buf2(1, y) >= 0) THEN + buf2(35, y) = buf2(1, y) + 1 + b = 1 + END IF + NEXT y + + FOR x = 1 TO 35 + FOR y = 1 TO 34 + IF (buf2(x, y + 1) > buf2(x, y) + 1) AND (buf2(x, y) >= 0) THEN + buf2(x, y + 1) = buf2(x, y) + 1 + b = 1 + END IF + NEXT y + + ' Check if moving up is the shortest path. + FOR y = 35 TO 2 STEP -1 + IF (buf2(x, y - 1) > buf2(x, y) + 1) AND (buf2(x, y) >= 0) THEN + buf2(x, y - 1) = buf2(x, y) + 1 + b = 1 + END IF + NEXT y + + IF (buf2(x, 1) > buf2(x, 35) + 1) AND (buf2(x, 35) >= 0) THEN + buf2(x, 1) = buf2(x, 35) + 1 + b = 1 + END IF + + IF (buf2(x, 35) > buf2(x, 1) + 1) AND (buf2(x, 1) >= 0) THEN + buf2(x, 35) = buf2(x, 1) + 1 + b = 1 + END IF + NEXT x + + ' If no shorter path is found, exit the loop. + IF b = 1 THEN GOTO 6 + + tx = ux(a) + ty = uy(a) + + d = 0 +7 + b = 32001 + tmpxp = 0 + tmpyp = 0 + + ' Check if moving right is the shortest path. + IF (buf2(tx - 1, ty) < b) AND (buf2(tx - 1, ty) >= 0) THEN + b = buf2(tx - 1, ty) + tmpxp = -1 + tmpyp = 0 + c = 1 + END IF + + ' Check if moving down is the shortest path. + IF (buf2(tx, ty - 1) < b) AND (buf2(tx, ty - 1) >= 0) THEN + b = buf2(tx, ty - 1) + tmpxp = 0 + tmpyp = -1 + c = 2 + END IF + + ' Check if moving left is the shortest path. + IF (buf2(tx + 1, ty) < b) AND (buf2(tx + 1, ty) >= 0) THEN + b = buf2(tx + 1, ty) + tmpxp = 1 + tmpyp = 0 + c = 3 + END IF + + ' Check if moving up is the shortest path. + IF (buf2(tx, ty + 1) < b) AND (buf2(tx, ty + 1) >= 0) THEN + b = buf2(tx, ty + 1) + tmpxp = 0 + tmpyp = 1 + c = 4 + END IF + + ' If no shorter path is found, set the direction to random. + IF b = 32001 THEN + tmpxp = -1 + tmpyp = 0 + c = 1 + b = -1 + END IF + + buf2(tx, ty) = -1 + d = d + 1 + ussk(d, a) = c + tx = tx + tmpxp + ty = ty + tmpyp + + ' Wrap around the edges of the grid. + IF tx = 1 THEN tx = 34 + IF ty = 1 THEN ty = 34 + IF tx = 35 THEN tx = 2 + IF ty = 35 THEN ty = 2 + + e = buf2(tx, ty) + buf2(tx, ty) = -1 + + sc2 tx, ty + + ' If the worm hits a wall or another worm, stop moving. + IF d > ail THEN GOTO 8 + + ' If the worm finds food, continue moving. + IF (e > 0) AND (b > -1) THEN GOTO 7 + +8 + d = d + 1 + ussk(d, a) = 5 + usskp(a) = 1 + + showb +END SUB + +SUB autop (a%) + ' This subroutine handles the movement of computer-controlled worms. + c = 0 + +5 + ' If the worm is not at the end of its path, continue moving. + IF usskp(a) > 0 THEN + b = ussk(usskp(a), a) + + IF b = 1 THEN + uxp(a) = -1 + uyp(a) = 0 + ELSEIF b = 2 THEN + uxp(a) = 0 + uyp(a) = -1 + ELSEIF b = 3 THEN + uxp(a) = 1 + uyp(a) = 0 + ELSEIF b = 4 THEN + uxp(a) = 0 + uyp(a) = 1 + ELSEIF b = 5 THEN + ai a + GOTO 5 + END IF + + usskp(a) = usskp(a) + 1 + END IF + + ' Calculate the new position of the worm. + nx = ux(a) + uxp(a) + ny = uy(a) + uyp(a) + + ' Check if the worm hits a wall or another worm. + b = buf(INT(nx), INT(ny)) + + ' If the worm hits a wall or another worm, recalculate the AI. + IF (b = 1 OR b > 9) AND (c = 0) THEN + ai a + c = 1 + GOTO 5 + END IF +END SUB + +SUB clearTail (playerNumber) + ' This subroutine takes care of clearing out worm tail. + ' As worm head advances forward in each frame, this procedure + ' is responsible for clearing out squares where worm tail moved out + ' of. Such squares are marked as empty (no longer occupied by worm) + ' and also correspondingly are erased from the screen. + a = ussp(playerNumber) - ussl(playerNumber) + + IF a < 1 THEN + a = a + 2000 + END IF + + IF ussx(a, playerNumber) > 0 THEN + buf(ussx(a, playerNumber), ussy(a, playerNumber)) = 0 + + drawGridCell ussx(a, playerNumber), ussy(a, playerNumber) + + ussx(a, playerNumber) = 0 + END IF +END SUB + +FUNCTION cnum$ (a%) + ' This function converts an integer to a string. + b$ = STR$(a%) + + ' Remove leading spaces from the string. + IF LEFT$(b$, 1) = " " THEN + b$ = RIGHT$(b$, LEN(b$) - 1) + END IF + + cnum$ = b$ +END FUNCTION + +SUB dead (a%) + ' This subroutine handles the death of a worm. + lives(a) = lives(a) - 1 + putworm a +END SUB + +SUB delay (delayInSeconds AS SINGLE) + ' Since QBasic does not have precise timer suitable for delaying animations, + ' workaround here is to use SOUND function. Inaudible sound with frequency + ' of 0 Hz is produced. Second argument for SOUND function is sound duration + ' that is approximately 1/18'th of the second. + SOUND 0, delayInSeconds * 18 +END SUB + +SUB drawGridCell (x%, y%) +' This subroutine updates one cell on the screen as denoted by its +' X and Y coordinates. +' +' Cell content is red from global 'buf' array and corresponding +' sprite is drawn on the screen. +' +' This procedure is handy because it allows redrawing only parts of the +' screen that were changed and thereby we avoid redrawing entire screen +' for every frame. + + x1 = x% * 5 + + y1 = y% * 5 + + LINE (x1, y1)-(x1 + 3, y1 + 3), 0, BF + + SELECT CASE buf(x%, y%) + CASE 0 + ' Draw an empty space on the grid. + LINE (x1, y1)-(x1 + 3, y1 + 3), 1, BF + + CASE 1 + ' Draw a wall on the grid. + LINE (x1, y1)-(x1 + 3, y1 + 3), 7, BF + + LINE (x1, y1)-(x1 + 3, y1 + 3), 8, B + + CASE 2 + ' Draw food on the grid. + LINE (x1, y1)-(x1 + 3, y1 + 3), 14, BF + + CASE 10 + ' Draw the head of a worm. + LINE (x1, y1)-(x1 + 3, y1 + 3), 10, BF + + PSET (x1, y1), 0 + + PSET (x1 + 3, y1), 0 + + PSET (x1, y1 + 3), 0 + + PSET (x1 + 3, y1 + 3), 0 + + CASE 11 + ' Draw the body of a worm. + LINE (x1, y1)-(x1 + 3, y1 + 3), 12, BF + + PSET (x1, y1), 0 + + PSET (x1 + 3, y1), 0 + + PSET (x1, y1 + 3), 0 + + PSET (x1 + 3, y1 + 3), 0 + + CASE 12 + ' Draw the body of a worm. + LINE (x1, y1)-(x1 + 3, y1 + 3), 13, BF + + PSET (x1, y1), 0 + + PSET (x1 + 3, y1), 0 + + PSET (x1, y1 + 3), 0 + + PSET (x1 + 3, y1 + 3), 0 + + CASE 13 + ' Draw the body of a worm. + LINE (x1, y1)-(x1 + 3, y1 + 3), 15, BF + + PSET (x1, y1), 0 + + PSET (x1 + 3, y1), 0 + + PSET (x1, y1 + 3), 0 + + PSET (x1 + 3, y1 + 3), 0 + + CASE 14 + ' Draw the body of a worm. + LINE (x1, y1)-(x1 + 3, y1 + 3), 9, BF + + PSET (x1, y1), 0 + + PSET (x1 + 3, y1), 0 + + PSET (x1, y1 + 3), 0 + + PSET (x1 + 3, y1 + 3), 0 + END SELECT +END SUB + +SUB init + ' Initialize the game by setting up the first level. + level 1 +END SUB + +SUB level (a%) + ' This subroutine sets up a new level of the game. + LOCATE 5, 5 + PRINT "G E T R E A D Y" + + LOCATE 7, 5 + PRINT "L E V E L :"; a% + + ' Display a countdown before starting the level. + delay 2 + + CLS + + ' Clear the game grid. + FOR y = 0 TO 36 + FOR x = 0 TO 36 + buf(x, y) = 0 + NEXT x + NEXT y + + ' Set up the walls of the grid. + FOR x = 0 TO 36 + buf(x, 0) = 1 + buf(x, 36) = 1 + buf(0, x) = 1 + buf(36, x) = 1 + NEXT x + + ' Load the level from a file. + b$ = cnum(a%) + ".lvl" + + OPEN b$ FOR INPUT AS #1 + +10 + ' Read the level data line by line. + IF EOF(1) <> 0 THEN GOTO 11 + + LINE INPUT #1, c$ + + ' If the line starts with a slash, it contains grid data. + IF LEFT$(c$, 1) = "/" THEN + d = d + 1 + + IF d > 35 THEN + GOTO 12 + END IF + + g = LEN(c$) + IF g > 36 THEN + g = 36 + END IF + + ' Parse the grid data and set up the game grid. + FOR e = 2 TO g + f$ = RIGHT$(LEFT$(c$, e), 1) + + IF f$ = "#" OR f$ = "m" THEN + buf(e - 1, d) = 1 + ELSE + buf(e - 1, d) = 0 + END IF + NEXT e + END IF + +12 + GOTO 10 + +11 + CLOSE #1 + + ' Place food randomly on the grid. + stuff + + ' Initialize the worms for each player. + show + + FOR b = 1 TO playerCount + ussl(b) = 0 + putworm b + NEXT b + + stat +END SUB + +SUB prc (playerNumber) +' This subroutine handles the main game loop for each player. + + clearTail playerNumber + + ussp(playerNumber) = ussp(playerNumber) + 1 + + ' If the current player has no lives left, no further processing is needed + IF lives(playerNumber) = 0 THEN + GOTO 4 + END IF + + ' If the worm is controlled by AI, recalculate its path. + IF isAI(playerNumber) = 1 THEN + autop playerNumber + END IF + + ' Move the worm based on user input or AI direction. + ux(playerNumber) = ux(playerNumber) + uxp(playerNumber) + uy(playerNumber) = uy(playerNumber) + uyp(playerNumber) + + ' Wrap around the edges of the grid. + IF ux(playerNumber) = 35 THEN + ux(playerNumber) = 2 + END IF + + IF uy(playerNumber) = 35 THEN + uy(playerNumber) = 2 + END IF + + IF ux(playerNumber) = 1 THEN + ux(playerNumber) = 34 + END IF + + IF uy(playerNumber) = 1 THEN + uy(playerNumber) = 34 + END IF + + x = ux(playerNumber) + y = uy(playerNumber) + +3 + IF buf(x, y) = 2 THEN + buf(x, y) = 0 + + drawGridCell x, y + + stuff + + ussl(playerNumber) = ussl(playerNumber) + mtm + + usss(playerNumber) = usss(playerNumber) + mtm + + FOR b = 1 TO playerCount + IF (lives(b) > 0) AND (isAI(b) = 1) THEN + ai b + END IF + NEXT b + + stat + + GOTO 3 + END IF + + IF buf(x, y) > 0 THEN + dead playerNumber + + GOTO 4 + END IF + + IF playerNumber = 1 THEN + buf(x, y) = 10 + ELSEIF playerNumber = 2 THEN + buf(x, y) = 11 + ELSEIF playerNumber = 3 THEN + buf(x, y) = 12 + ELSEIF playerNumber = 4 THEN + buf(x, y) = 13 + ELSEIF playerNumber = 5 THEN + buf(x, y) = 14 + END IF + + drawGridCell x, y + + IF ussp(playerNumber) > 2000 THEN + ussp(playerNumber) = ussp(playerNumber) - 2000 + END IF + + ussx(ussp(playerNumber), playerNumber) = x + + ussy(ussp(playerNumber), playerNumber) = y + +4 +END SUB + +SUB putworm (a%) + ' This subroutine initializes a new worm for a player. + b = ussl(a%) + + ' Move the worm back to its starting position. + FOR c = b TO 1 STEP -1 + ussl(a%) = c + + clearTail a% + NEXT c + +9 + uy(a%) = INT(RND * 30 + 2) + + ux(a%) = INT(RND * 10 + 5) + + ' Ensure that the worm starts in an empty space. + FOR b = ux(a%) TO ux(a%) + 10 + IF buf(b, uy(a%)) <> 0 THEN + GOTO 9 + END IF + NEXT b + + ' Set the initial direction of the worm. + uxp(a%) = 1 + + uyp(a%) = 0 + + ussl(a%) = 3 + + stat +END SUB + +SUB sc2 (x%, y%) + ' This subroutine draws a worm on the game grid for AI pathfinding. + ' LOCATE 1, 1 + ' PRINT x%, y% + + ' x1 = x% * 5 + 2 + + ' y1 = y% * 5 + 2 + + ' PSET (x1, y1), 15 + + ' a$ = INPUT$(1) +END SUB + +SUB show + ' This subroutine draws the entire game grid. + FOR y = 1 TO 35 + FOR x = 1 TO 35 + drawGridCell x, y + NEXT x + NEXT y +END SUB + +SUB showb +GOTO 15 +FOR x = 1 TO 35 +FOR y = 1 TO 35 + +LINE (x * 2 + 200, y * 2 + 100)-(x * 2 + 201, y * 2 + 101), buf2(x, y) MOD 255, BF +NEXT y +NEXT x +15 +'a$ = INPUT$(1) +END SUB + +SUB start + ' Initialize the game screen and settings. + SCREEN 13 + + RANDOMIZE TIMER + + uy(1) = 5 + + uy(2) = 10 + + uy(3) = 15 + + uy(4) = 20 + + uy(5) = 25 + + FOR a = 1 TO playerCount + ux(a) = 15 + + uxp(a) = 1 + + uyp(a) = 0 + + ussp(a) = 0 + + ussl(a) = 3 + + lives(a) = elum + + usss(a) = 0 + + usskp(a) = 1 + + ussk(1, a) = 5 + NEXT a + + mtm = 0 +END SUB + +SUB stat + ' This subroutine displays the current game statistics. + LOCATE 1, 25 + + PRINT mtm + + FOR a = 1 TO 5 + COLOR 15 + + LOCATE 2 + a, 24 + + PRINT RIGHT$(STR$(a), 1) + + COLOR 10 + + LOCATE 2 + a, 26 + + IF isAI(a) = 1 THEN + PRINT "*" + ELSE + PRINT "-" + END IF + + COLOR 12 + + LOCATE 2 + a, 27 + + b$ = STR$(usss(a)) + + PRINT RIGHT$(b$, LEN(b$) - 1) + + COLOR 13 + + LOCATE 2 + a, 30 + + b$ = STR$(lives(a)) + + PRINT RIGHT$(b$, LEN(b$) - 1) + NEXT a + + COLOR 10 + + LOCATE 8, 26 + + PRINT "AI" + + COLOR 12 + + LOCATE 2, 27 + + PRINT "Score" + + COLOR 13 + + LOCATE 8, 30 + + PRINT "Lives" + + LOCATE 1, 30 + + PRINT "Level:"; lvl +END SUB + +SUB stuff + ' This subroutine places food randomly on the game grid. +2 + x = INT(RND * 33 + 2) + + y = INT(RND * 33 + 2) + + IF buf(x, y) = 0 THEN + buf(x, y) = 2 + + drawGridCell x, y + ELSE + GOTO 2 + END IF + + mtm = mtm + 1 + + stat +END SUB + +SUB tkt + ' This subroutine handles user input and AI recalculation. + a$ = INKEY$ + + IF a$ = CHR$(27) THEN + SYSTEM + END IF + + IF (a$ = CHR$(0) + "M") AND (uxp(1) <> -1) THEN + uxp(1) = 1 + + uyp(1) = 0 + END IF + + IF (a$ = CHR$(0) + "K") AND (uxp(1) <> 1) THEN + uxp(1) = -1 + + uyp(1) = 0 + END IF + + IF (a$ = CHR$(0) + "P") AND (uyp(1) <> -1) THEN + uxp(1) = 0 + + uyp(1) = 1 + END IF + + IF (a$ = CHR$(0) + "H") AND (uyp(1) <> 1) THEN + uxp(1) = 0 + + uyp(1) = -1 + END IF + + IF (a$ = "d") AND (uxp(2) <> -1) THEN + uxp(2) = 1 + + uyp(2) = 0 + END IF + + IF (a$ = "a") AND (uxp(2) <> 1) THEN + uxp(2) = -1 + + uyp(2) = 0 + END IF + + IF (a$ = "s") AND (uyp(2) <> -1) THEN + uxp(2) = 0 + + uyp(2) = 1 + END IF + + IF (a$ = "w") AND (uyp(2) <> 1) THEN + uxp(2) = 0 + + uyp(2) = -1 + END IF + + b = VAL(a$) + + IF b > 0 THEN + IF isAI(b) = 1 THEN + isAI(b) = 0 + ELSE + isAI(b) = 1 + END IF + + stat + END IF + + FOR a = 1 TO playerCount + prc a + NEXT a +END SUB diff --git a/Games/checkers.bas b/Games/checkers.bas new file mode 100755 index 0000000..ce99d90 --- /dev/null +++ b/Games/checkers.bas @@ -0,0 +1,534 @@ +' Game of checkers. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 1998, Initial version +' 2025, Improved program readability +' +' Usage: +' keys: w a z s - move around +' ENTER key - pick piece on the desk and place it to new location + +DECLARE SUB CheckPossibleMoves() +DECLARE SUB HandleMovement() +DECLARE SUB GameLoop() +DECLARE SUB HandleInput() +DECLARE SUB UpdateDisplay() +DEFINT A-Z + +DIM SHARED boardState(-100 TO 300) AS INTEGER +' 0 - black piece +' 1 - white piece +' 3 - Empty square that piece is allowed to move to +' 4 - Empty square that is not reachable according to the game rules +' +' Cell address calculation (row 1--10, col 1--10): +' cell address = ((row - 1) * 20) + col + + +DIM SHARED moveMade AS INTEGER +DIM SHARED hasMove AS INTEGER +DIM SHARED cursorImage(1000) +DIM SHARED cursorX, cursorY +SCREEN 2 + + +CLS +' Draw cursor image and store it into array for quick drawing on the screen +LINE (1, 1)-(10, 1) +LINE (1, 1)-(1, 5) +LINE (10, 1)-(6, 2) +LINE (6, 2)-(10, 4) +LINE (10, 4)-(8, 5) +LINE (8, 5)-(4, 3) +LINE (4, 3)-(1, 5) +PAINT (2, 2), 1 +GET (1, 1)-(10, 5), cursorImage + +CLS +' Draw the checkerboard grid +FOR col = 0 TO 10 + LINE ((col * 40) + 20, 10)-((col * 40) + 20, 189), 1 +NEXT col + +FOR row = 0 TO 20 + LINE (20, (row * 18) + 9)-(420, (row * 18) + 9), 1 +NEXT row + +' Initialize the board state to empty squares +FOR cell = 1 TO 200 + boardState(cell) = 4 +NEXT cell + +' Draw the initial checkerboard pattern. +' (alternating squares to create the checkerboard) + +FOR row = 2 TO 10 STEP 2 + FOR col = 1 TO 10 STEP 2 + PAINT ((col * 40) + 5, (row * 18) + 5) + NEXT col +NEXT row + +FOR row = 1 TO 10 STEP 2 + FOR col = 2 TO 10 STEP 2 + PAINT ((col * 40) + 5, (row * 18) + 5) + NEXT col +NEXT row + +' Place the white pieces on the board +FOR row = 2 TO 4 STEP 2 + FOR col = 1 TO 10 STEP 2 + boardState(((row - 1) * 20) + col) = 1 + NEXT col +NEXT row + +FOR row = 1 TO 4 STEP 2 + FOR col = 2 TO 10 STEP 2 + boardState(((row - 1) * 20) + col) = 1 + NEXT col +NEXT row + +' Place the black pieces on the board +FOR row = 8 TO 10 STEP 2 + FOR col = 1 TO 10 STEP 2 + boardState(((row - 1) * 20) + col) = 0 + NEXT col +NEXT row + +FOR row = 7 TO 10 STEP 2 + FOR col = 2 TO 10 STEP 2 + boardState(((row - 1) * 20) + col) = 0 + NEXT col +NEXT row + +FOR col = 2 TO 10 STEP 2 + boardState(80 + col) = 3 +NEXT col + +FOR col = 1 TO 10 STEP 2 + boardState(100 + col) = 3 +NEXT col + +UpdateDisplay +moveMade = 1 +GameLoop + +SUB UpdateDisplay + ' Draw the pieces on the board + FOR row = 1 TO 10 + FOR col = 1 TO 10 + pieceType = boardState(((row - 1) * 20) + col) + SELECT CASE pieceType + CASE 1 + CIRCLE (col * 40, row * 18), 17, 1 + PAINT (col * 40, row * 18), 1 + CIRCLE (col * 40, row * 18), 17, 0 + CIRCLE (col * 40, row * 18), 16, 0 + LINE ((col * 40) - 16, row * 18)-((col * 40) + 16, row * 18), 0 + CASE 0 + CIRCLE (col * 40, row * 18), 17, 0 + PAINT (col * 40, row * 18), 0 + CIRCLE (col * 40, row * 18), 17, 1 + CIRCLE (col * 40, row * 18), 15, 1 + CIRCLE (col * 40, row * 18), 3, 1 + CIRCLE (col * 40, row * 18), 7, 1 + LINE ((col * 40) - 16, row * 18)-((col * 40) + 16, row * 18), 0 + CASE 3 + PAINT (col * 40, row * 18), 1 + END SELECT + NEXT col + NEXT row +END SUB + +SUB CheckPossibleMoves + ' Checks if there are any possible moves on the board + hasMove = 0 + FOR cell = 1 TO 200 + ' Check for possible jumps in all directions + IF boardState(cell) = 0 AND boardState(cell - 21) = 1 AND boardState(cell - 42) = 3 THEN hasMove = 1 + IF boardState(cell) = 0 AND boardState(cell - 19) = 1 AND boardState(cell - 38) = 3 THEN hasMove = 1 + IF boardState(cell) = 0 AND boardState(cell + 21) = 1 AND boardState(cell + 42) = 3 THEN hasMove = 1 + IF boardState(cell) = 0 AND boardState(cell + 19) = 1 AND boardState(cell + 38) = 3 THEN hasMove = 1 + NEXT cell +END SUB + +SUB GameLoop + 4 + HandleInput + HandleMovement + CheckPossibleMoves + IF hasMove = 1 THEN SOUND 1234, 2 + GOTO 4 +END SUB + +SUB HandleMovement +3 +' Check for possible jumps where a AI can eat 2 pieces at once +FOR cell = 1 TO 200 + IF boardState(cell) = 1 AND boardState(cell + 21) = 0 AND boardState(cell + 42) = 3 AND boardState(cell + 61) = 0 AND boardState(cell + 80) = 3 THEN + boardState(cell) = 3: boardState(cell + 21) = 3: boardState(cell + 42) = 1 + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF + IF boardState(cell) = 1 AND boardState(cell + 21) = 0 AND boardState(cell + 42) = 3 AND boardState(cell + 23) = 0 AND boardState(cell + 4) = 3 THEN + boardState(cell) = 3: boardState(cell + 21) = 3 : boardState(cell + 42) = 1 + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF + IF boardState(cell) = 1 AND boardState(cell + 19) = 0 AND boardState(cell + 38) = 3 AND boardState(cell + 59) = 0 AND boardState(cell + 80) = 3 THEN + boardState(cell) = 3: boardState(cell + 19) = 3 : boardState(cell + 38) = 1 + + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF + IF boardState(cell) = 1 AND boardState(cell + 19) = 0 AND boardState(cell + 38) = 3 AND boardState(cell + 17) = 0 AND boardState(cell - 4) = 3 THEN + boardState(cell) = 3: boardState(cell + 19) = 3 : boardState(cell + 38) = 1 + + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF + IF boardState(cell) = 1 AND boardState(cell + 21) = 0 AND boardState(cell + 42) = 3 AND boardState(cell + 63) = 0 AND boardState(cell + 84) = 3 THEN + boardState(cell) = 3: boardState(cell + 21) = 3 : boardState(cell + 42) = 1 + + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF + IF boardState(cell) = 1 AND boardState(cell + 19) = 0 AND boardState(cell + 38) = 3 AND boardState(cell + 57) = 0 AND boardState(cell + 76) = 3 THEN + boardState(cell) = 3: boardState(cell + 19) = 3 : boardState(cell + 38) = 1 + + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF + + IF boardState(cell) = 1 AND boardState(cell - 21) = 0 AND boardState(cell - 42) = 3 AND boardState(cell - 61) = 0 AND boardState(cell - 80) = 3 THEN + boardState(cell) = 3: boardState(cell - 21) = 3 : boardState(cell - 42) = 1 + + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF + IF boardState(cell) = 1 AND boardState(cell - 21) = 0 AND boardState(cell - 42) = 3 AND boardState(cell - 23) = 0 AND boardState(cell - 4) = 3 THEN + boardState(cell) = 3: boardState(cell - 21) = 3 : boardState(cell - 42) = 1 + + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF + IF boardState(cell) = 1 AND boardState(cell - 19) = 0 AND boardState(cell - 38) = 3 AND boardState(cell - 59) = 0 AND boardState(cell - 80) = 3 THEN + boardState(cell) = 3: boardState(cell - 19) = 3 : boardState(cell - 38) = 1 + + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF + IF boardState(cell) = 1 AND boardState(cell - 19) = 0 AND boardState(cell - 38) = 3 AND boardState(cell - 17) = 0 AND boardState(cell + 4) = 3 THEN + boardState(cell) = 3: boardState(cell - 19) = 3 : boardState(cell - 38) = 1 + + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF + IF boardState(cell) = 1 AND boardState(cell - 21) = 0 AND boardState(cell - 42) = 3 AND boardState(cell - 63) = 0 AND boardState(cell - 84) = 3 THEN + boardState(cell) = 3: boardState(cell - 21) = 3 : boardState(cell - 42) = 1 + + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF + IF boardState(cell) = 1 AND boardState(cell - 19) = 0 AND boardState(cell - 38) = 3 AND boardState(cell - 57) = 0 AND boardState(cell - 76) = 3 THEN + boardState(cell) = 3: boardState(cell - 19) = 3 : boardState(cell - 38) = 1 + + moveMade = 1 + UpdateDisplay + GOTO 3 + END IF +NEXT cell + +' Check for possible single moves (single eating) +FOR cell = 1 TO 200 + IF boardState(cell) = 1 AND boardState(cell + 21) = 0 AND boardState(cell + 42) = 3 THEN + boardState(cell) = 3: boardState(cell + 21) = 3 : boardState(cell + 42) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell + 19) = 0 AND boardState(cell + 38) = 3 THEN + boardState(cell) = 3: boardState(cell + 19) = 3 : boardState(cell + 38) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell - 21) = 0 AND boardState(cell - 42) = 3 THEN + boardState(cell) = 3: boardState(cell - 21) = 3 : boardState(cell - 42) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell - 19) = 0 AND boardState(cell - 38) = 3 THEN + boardState(cell) = 3: boardState(cell - 19) = 3 : boardState(cell - 38) = 1 + + GOTO 2 + END IF +NEXT cell + +' Check for possible defensive moves (to protect own pieces) +FOR cell = 1 TO 200 + IF boardState(cell) = 1 AND boardState(cell + 19) = 3 AND boardState(cell + 21) = 3 AND boardState(cell + 40) = 1 AND boardState(cell + 38) = 3 AND boardState(cell + 61) = 0 THEN + boardState(cell) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell + 19) = 3 AND boardState(cell + 21) = 0 AND boardState(cell + 40) = 1 AND boardState(cell + 38) = 3 AND boardState(cell + 61) = 0 THEN + boardState(cell) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell + 19) = 3 AND boardState(cell + 21) = 3 AND boardState(cell + 40) = 1 AND boardState(cell + 38) = 1 AND boardState(cell + 61) = 0 THEN + boardState(cell) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell + 19) = 3 AND boardState(cell + 21) = 0 AND boardState(cell + 40) = 1 AND boardState(cell + 38) = 1 AND boardState(cell + 61) = 0 THEN + boardState(cell) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF + + IF boardState(cell - 2) = 1 AND boardState(cell + 19) = 3 AND boardState(cell) = 3 AND boardState(cell + 40) = 1 AND boardState(cell + 38) = 3 AND boardState(cell + 61) = 0 THEN + boardState(cell - 2) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF + IF boardState(cell - 2) = 1 AND boardState(cell + 19) = 3 AND boardState(cell) = 1 AND boardState(cell + 40) = 1 AND boardState(cell + 38) = 3 AND boardState(cell + 61) = 0 THEN + boardState(cell - 2) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF + IF boardState(cell - 2) = 1 AND boardState(cell + 19) = 3 AND boardState(cell) = 3 AND boardState(cell + 40) = 1 AND boardState(cell + 38) = 1 AND boardState(cell + 61) = 0 THEN + boardState(cell - 2) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF + IF boardState(cell - 2) = 1 AND boardState(cell + 19) = 3 AND boardState(cell) = 1 AND boardState(cell + 40) = 1 AND boardState(cell + 38) = 1 AND boardState(cell + 61) = 0 THEN + boardState(cell - 2) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF +NEXT cell + +' Check for possible moves to the board edges (to protect own pieces) +FOR cell = 1 TO 200 + IF boardState(cell) = 1 AND boardState(cell + 2) = 4 AND boardState(cell + 21) = 3 THEN + boardState(cell) = 3: boardState(cell + 21) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell - 2) = 4 AND boardState(cell + 19) = 3 THEN + boardState(cell) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF +NEXT cell + +' Check for possible moves to the corner (safe moves) +FOR cell = 1 TO 200 + IF boardState(cell) = 1 AND boardState(cell + 19) = 3 AND boardState(cell + 38) = 3 AND boardState(cell + 40) = 3 THEN + boardState(cell) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell + 21) = 3 AND boardState(cell + 42) = 3 AND boardState(cell + 40) = 3 THEN + boardState(cell) = 3: boardState(cell + 21) = 1 + + GOTO 2 + END IF + + IF boardState(cell) = 1 AND boardState(cell + 19) = 3 AND boardState(cell + 38) = 1 AND boardState(cell + 40) = 3 THEN + boardState(cell) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell + 21) = 3 AND boardState(cell + 42) = 1 AND boardState(cell + 40) = 3 THEN + boardState(cell) = 3: boardState(cell + 21) = 1 + + GOTO 2 + END IF + + IF boardState(cell) = 1 AND boardState(cell + 19) = 3 AND boardState(cell + 38) = 3 AND boardState(cell + 40) = 1 THEN + boardState(cell) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell + 21) = 3 AND boardState(cell + 42) = 3 AND boardState(cell + 40) = 1 THEN + boardState(cell) = 3: boardState(cell + 21) = 1 + + GOTO 2 + END IF + + IF boardState(cell) = 1 AND boardState(cell + 19) = 3 AND boardState(cell + 38) = 1 AND boardState(cell + 40) = 1 THEN + boardState(cell) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell + 21) = 3 AND boardState(cell + 42) = 1 AND boardState(cell + 40) = 1 THEN + boardState(cell) = 3: boardState(cell + 21) = 1 + + GOTO 2 + END IF +NEXT cell + +' Check for any remaining moves that can be made +FOR cell = 1 TO 200 + IF boardState(cell) = 1 AND boardState(cell + 21) = 3 THEN + boardState(cell) = 3: boardState(cell + 21) = 1 + + GOTO 2 + END IF + IF boardState(cell) = 1 AND boardState(cell + 19) = 3 THEN + boardState(cell) = 3: boardState(cell + 19) = 1 + + GOTO 2 + END IF +NEXT cell +LOCATE 4, 5 +PRINT " Y O U W O N !" +END +GOTO 3 +2 +UpdateDisplay +9 +END SUB + +SUB HandleInput + DIM tempImage(1000) + + inputPhase = 1 + + 5 + cursorX = ax1 + cursorY = ax2 + + 7 + IF inputPhase = 1 THEN + LOCATE 1, 60 + PRINT "From where ?" + END IF + IF inputPhase = 2 THEN + LOCATE 1, 60 + PRINT "To where ? " + END IF + + + selectedCell = (((cursorY \ 18) - 1) * 20) + (cursorX \ 40) + 'LOCATE 2, 60 + 'PRINT selectedCell + + GET (cursorX, cursorY)-(cursorX + 10, cursorY + 10), tempImage + PUT (cursorX, cursorY), cursorImage, PSET + + key$ = INPUT$(1) + PUT (cursorX, cursorY), tempImage, PSET + + IF inputPhase = 2 AND key$ = CHR$(13) THEN + destinationCell = selectedCell + cursorX = ax1 + cursorY = ax2 + GOTO 8 + END IF + IF inputPhase = 1 AND key$ = CHR$(13) THEN + sourceCell = selectedCell + inputPhase = 2 + END IF + + IF key$ = "q" THEN + END + END IF + IF key$ = "s" THEN + cursorX = cursorX + 40 + END IF + IF key$ = "a" THEN + cursorX = cursorX - 40 + END IF + IF key$ = "w" THEN + cursorY = cursorY - 18 + END IF + IF key$ = "z" THEN + cursorY = cursorY + 18 + END IF + + IF cursorX < 1 THEN + cursorX = 1 + END IF + + IF cursorY < 1 THEN + cursorY = 1 + END IF + + GOTO 7 + + 8 + moveMade = 1 + + 'LOCATE 3, 60 + 'PRINT sourceCell; "-"; destinationCell + + 10 + + ' This section controls the movement of pieces on the board + IF sourceCell = destinationCell + 19 AND boardState(sourceCell) = 0 AND boardState(destinationCell) = 3 THEN + BEEP + SWAP boardState(sourceCell), boardState(destinationCell) + END IF + IF sourceCell = destinationCell + 21 AND boardState(sourceCell) = 0 AND boardState(destinationCell) = 3 THEN + BEEP + SWAP boardState(sourceCell), boardState(destinationCell) + END IF + + captureMade = 0 + + IF sourceCell = destinationCell + 42 AND boardState(sourceCell) = 0 AND boardState(destinationCell) = 3 AND boardState(destinationCell + 21) = 1 THEN + BEEP + SWAP boardState(sourceCell), boardState(destinationCell) + boardState(destinationCell + 21) = 3 + captureMade = 1 + END IF + IF sourceCell = destinationCell + 38 AND boardState(sourceCell) = 0 AND boardState(destinationCell) = 3 AND boardState(destinationCell + 19) = 1 THEN + BEEP + SWAP boardState(sourceCell), boardState(destinationCell) + boardState(destinationCell + 19) = 3 + captureMade = 1 + END IF + IF sourceCell = destinationCell - 42 AND boardState(sourceCell) = 0 AND boardState(destinationCell) = 3 AND boardState(destinationCell - 21) = 1 THEN + BEEP + SWAP boardState(sourceCell), boardState(destinationCell) + boardState(destinationCell - 21) = 3 + captureMade = 1 + END IF + IF sourceCell = destinationCell - 38 AND boardState(sourceCell) = 0 AND boardState(destinationCell) = 3 AND boardState(destinationCell - 19) = 1 THEN + BEEP + SWAP boardState(sourceCell), boardState(destinationCell) + boardState(destinationCell - 19) = 3 + captureMade = 1 + END IF + + UpdateDisplay + + IF captureMade = 1 THEN + CheckPossibleMoves + IF hasMove = 1 THEN + SOUND 1234, 1 + inputPhase = 2 + sourceCell = destinationCell + GOTO 5 + END IF + END IF + + 6 +END SUB diff --git a/Games/checkers2.bas b/Games/checkers2.bas new file mode 100755 index 0000000..ca58775 --- /dev/null +++ b/Games/checkers2.bas @@ -0,0 +1,501 @@ +' Game of checkers. Supports basic moves. Incomplete. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2001, Initial version +' 2024, Improved program readability + +DECLARE SUB compki (m%, h%, x1%, y1%) +DECLARE SUB compgo2 (h%) +DECLARE SUB compgo (h%) +DECLARE SUB humngo (h%) +DefInt A-Z + +DECLARE SUB thinkc () +DECLARE SUB thinkh () +DECLARE SUB cmd (a$) +DECLARE SUB freet () +DECLARE SUB prn (x%, y%, c%, a$) +DECLARE SUB msg (a$, c) +DECLARE SUB getfnt () +DECLARE SUB playg () +DECLARE SUB geth () +DECLARE SUB start () +DECLARE SUB mklau () +DECLARE SUB showr (x, y) +DECLARE SUB show () +Dim Shared font(0 To 7, 0 To 7, 0 To 255) +Dim Shared siz, fi, ri, rs +Dim Shared stri$ +Dim Shared humx1, humy1, humx2, humy2 +Dim Shared sug, smax +Dim Shared npos As Long +Dim Shared cx1, cy1, cx2, cy2 + +siz = 6 ' Board size +fi = 0 +ri = 2 +smax = 3 ' thinking depth + +Dim Shared lau(-1 To siz + 2, -1 To siz + 2) + +start +mklau +show +playg + +Sub cmd (a$) + mitus = 0 + Dim sona$(1 To 10) + For b = 1 To 10 + sona$(b) = "" + Next b + + d = 1 + e = 1 + For b = 1 To Len(a$) + c$ = Right$(Left$(a$, b), 1) + If c$ = " " Then + If e = 0 Then d = d + 1: e = 1 + GoTo 4 + End If + e = 0 + sona$(d) = sona$(d) + c$ + 4 + Next b + If e = 1 Then d = d - 1 + mitus = d + + Select Case sona$(1) + Case "m" + If humx1 > 0 Then msg "Move replaced.", 14 + + humx1 = Asc(Left$(sona$(2), 1)) - 64 + If humx1 > 32 Then humx1 = humx1 - 32 + humy1 = Val(Right$(sona$(2), Len(sona$(2)) - 1)) + humx2 = Asc(Left$(sona$(3), 1)) - 64 + If humx2 > 32 Then humx2 = humx2 - 32 + humy2 = Val(Right$(sona$(3), Len(sona$(2)) - 1)) + + Case "h" + msg "h - display help screen", 14 + msg "q - to quit", 14 + msg "m - make move", 14 + msg "n - no. positions processed", 14 + + Case "q" + System + + Case "n" + b$ = "positions processed:" + Str$(npos) + msg b$, 14 + + End Select + +End Sub + +Sub compgo (h) + If sug > smax Then h = 0: GoTo 6 + sug = sug + 1 + npos = npos + 1 + freet + If sug = 1 Then h1 = -2000 Else h1 = -1000 + + 'cx1 = x: cy1 = y: cx2 = x - 1: cy2 = y + 1 + b = 0 + c = 0 + m = 0 + For y = 1 To siz ' check for eating + For x = 1 To siz + If lau(x, y) = 1 Then + 8 + If (lau(x - 1, y + 1) = 2) And (lau(x - 2, y + 2) = 0) Then + Swap lau(x, y), lau(x - 2, y + 2) + lau(x - 1, y + 1) = 0 + compki m1, h2, x - 2, y + 2 + lau(x - 1, y + 1) = 2 + Swap lau(x, y), lau(x - 2, y + 2) + m1 = m1 + 1 + If m1 > m Then m = m1: h1 = -1000 + If m1 = m Then + If h2 + 1 > h1 Then + h1 = h2 + 1 + If npos = 1 Then cx1 = x: cy1 = y: cx2 = x - 2: cy2 = y + 2 + End If + End If + b = 1 + End If + + If (lau(x + 1, y + 1) = 2) And (lau(x + 2, y + 2) = 0) Then + Swap lau(x, y), lau(x + 2, y + 2) + lau(x + 1, y + 1) = 0 + compki m1, h2, x + 2, y + 2 + lau(x + 1, y + 1) = 2 + Swap lau(x, y), lau(x + 2, y + 2) + m1 = m1 + 1 + If m1 > m Then m = m1: h1 = -1000 + If m1 = m Then + If h2 + 1 > h1 Then + h1 = h2 + 1 + If npos = 1 Then cx1 = x: cy1 = y: cx2 = x + 2: cy2 = y + 2 + End If + End If + b = 1 + End If + + If (lau(x - 1, y - 1) = 2) And (lau(x - 2, y - 2) = 0) Then + Swap lau(x, y), lau(x - 2, y - 2) + lau(x - 1, y - 1) = 0 + compki m1, h2, x - 2, y - 2 + lau(x - 1, y - 1) = 2 + Swap lau(x, y), lau(x - 2, y - 2) + m1 = m1 + 1 + If m1 > m Then m = m1: h1 = -1000 + If m1 = m Then + If h2 + 1 > h1 Then + h1 = h2 + 1 + If npos = 1 Then cx1 = x: cy1 = y: cx2 = x - 2: cy2 = y - 2 + End If + End If + b = 1 + End If + + If (lau(x + 1, y - 1) = 2) And (lau(x + 2, y - 2) = 0) Then + Swap lau(x, y), lau(x + 2, y - 2) + lau(x + 1, y - 1) = 0 + compki m1, h2, x + 2, y - 2 + lau(x + 1, y - 1) = 2 + Swap lau(x, y), lau(x + 2, y - 2) + m1 = m1 + 1 + If m1 > m Then m = m1: h1 = -1000 + If m1 = m Then + If h2 + 1 > h1 Then + h1 = h2 + 1 + If npos = 1 Then cx1 = x: cy1 = y: cx2 = x + 2: cy2 = y - 2 + End If + End If + b = 1 + End If + + If c = 1 Then GoTo 9 + End If + Next x + Next y + + 9 + If (b = 1) And (npos = 1) Then + cx3 = (cx1 + cx2) / 2 + cy3 = (cy1 + cy2) / 2 + lau(cx3, cy3) = 0 + showr cx3, cy3 + + Swap lau(cx1, cy1), lau(cx2, cy2) + showr cx1, cy1 + showr cx2, cy2 + msg "NJAM!", 10 + x = cx2 + y = cy2 + c = 1 + b = 0 + GoTo 8 + End If + If c = 1 Then + cx1 = 1: cy1 = 1: cx2 = 1: cy2 = 1 + GoTo 10 + End If + + If sug = 1 Then + msg "Cannot eat.", 4 + msg Str$(h1), 4 + End If + + For y = 1 To siz ' unuseful move + For x = 1 To siz + If lau(x, y) = 1 Then + If lau(x - 1, y + 1) = 0 Then + Swap lau(x, y), lau(x - 1, y + 1) + humngo h2 + Swap lau(x, y), lau(x - 1, y + 1) + If h2 > h1 Then + h1 = h2 + If sug = 1 Then cx1 = x: cy1 = y: cx2 = x - 1: cy2 = y + 1 + End If + End If + + If lau(x + 1, y + 1) = 0 Then + Swap lau(x, y), lau(x + 1, y + 1) + humngo h2 + Swap lau(x, y), lau(x + 1, y + 1) + If h2 > h1 Then + h1 = h2 + If sug = 1 Then cx1 = x: cy1 = y: cx2 = x + 1: cy2 = y + 1 + End If + End If + + End If + Next x + Next y + h = h1 + 10 + sug = sug - 1 + 6 +End Sub + +Sub compki (m, h, x1, y1) + h1 = 0 + + For y = 1 To siz + For x = 1 To siz + Next x + Next y + h = h1 + +End Sub + +Sub freet + a$ = InKey$ + If a$ = "" Then + Else + If a$ = Chr$(8) Then + If Len(stri$) > 0 Then + stri$ = Left$(stri$, Len(stri$) - 1): GoTo 3 + End If + End If + If a$ = Chr$(13) Then + If Len(stri$) > 0 Then + msg stri$, 7 + cmd stri$ + stri$ = "" + End If + GoTo 3 + End If + stri$ = stri$ + a$ + 3 + Line (400, 468)-(639, 479), 1, BF + prn 405, 469, 14, stri$ + End If +End Sub + +Sub getfnt + Screen 13 + For a = 0 To 255 + If (a > 5) And (a < 17) Then GoTo 2 + Locate 1, 1 + Print Chr$(a) + 2 + For y = 0 To 7 + For x = 0 To 7 + font(x, y, a) = Point(x, y) + Next x + Next y + Next a + +End Sub + +Sub humngo (h) + npos = npos + 1 + h1 = 1000 + + For y = siz To 1 Step -1 + For x = siz To 1 Step -1 + If lau(x, y) = 2 Then + If lau(x - 1, y - 1) = 0 Then + Swap lau(x, y), lau(x - 1, y - 1) + compgo h2 + Swap lau(x, y), lau(x - 1, y - 1) + If h2 < h1 Then h1 = h2 + End If + + If lau(x + 1, y - 1) = 0 Then + Swap lau(x, y), lau(x + 1, y - 1) + compgo h2 + Swap lau(x, y), lau(x + 1, y - 1) + If h2 < h1 Then h1 = h2 + End If + + If (lau(x - 1, y - 1) = 1) And (lau(x - 2, y - 2) = 0) Then + Swap lau(x, y), lau(x - 2, y - 2) + lau(x - 1, y - 1) = 0 + humngo h2 + lau(x - 1, y - 1) = 1 + Swap lau(x, y), lau(x - 2, y - 2) + If h2 - 1 < h1 Then h1 = h2 - 1 + End If + + If (lau(x + 1, y - 1) = 1) And (lau(x + 2, y - 2) = 0) Then + Swap lau(x, y), lau(x + 2, y - 2) + lau(x + 1, y - 1) = 0 + humngo h2 + lau(x + 1, y - 1) = 1 + Swap lau(x, y), lau(x + 2, y - 2) + If h2 - 1 < h1 Then h1 = h2 - 1 + End If + + End If + Next x + Next y + h = h1 +End Sub + +Sub mklau + For y = -1 To siz + 2 + For x = -1 To siz + 2 + lau(x, y) = -1 + Next x + Next y + + For y = 1 To siz + For x = 1 To siz + lau(x, y) = 0 + Next x + Next y + + For y = 1 To ri + For x = 1 To siz + If (x + y + fi) / 2 = Int((x + y + fi) / 2) Then + lau(x, y) = 1 + End If + Next x + Next y + + For y = siz - ri + 1 To siz + For x = 1 To siz + If (x + y + fi) / 2 = Int((x + y + fi) / 2) Then + lau(x, y) = 2 + End If + Next x + Next y + +End Sub + +Sub msg (a$, c) + Dim buf(1 To 10000) + For x = 400 To 630 Step 40 + Get (x, 8)-(x + 39, 467), buf(1) + Put (x, 0), buf(1), PSet + Next x + Line (400, 460)-(639, 467), 0, BF + prn 405, 460, c, a$ +End Sub + +Sub playg + 'GOTO 7 + 1 + thinkc + show + 7 + thinkh + show + GoTo 1 + +End Sub + +Sub prn (x, y, c, a$) + x1 = x + y1 = y + For a = 1 To Len(a$) + b = Asc(Right$(Left$(a$, a), 1)) + For y2 = 0 To 7 + For x2 = 0 To 7 + If font(x2, y2, b) > 0 Then PSet (x2 + x1, y2 + y1), c + Next x2 + Next y2 + x1 = x1 + 8 + Next a +End Sub + +Sub show + For y = 1 To siz + For x = 1 To siz + showr x, y + Next x + Next y + + sp = rs / 2 + For x = 1 To siz + prn ((x - 1) * rs + 12 + sp), 2, 10, Chr$(64 + x) + prn ((x - 1) * rs + 12 + sp), siz * rs + 11, 10, Chr$(64 + x) + Next x + + For y = 1 To siz + a$ = Str$(y) + a$ = Right$(a$, Len(a$) - 1) + prn 15 - (Len(a$) * 8), (y - 1) * rs + sp + 7, 10, a$ + prn (siz * rs + 16), (y - 1) * rs + sp + 7, 10, a$ + Next y + +End Sub + +Sub showr (x, y) + If (x + y + fi) / 2 = Int((x + y + fi) / 2) Then c = 8 Else c = 7 + x1 = (x - 1) * rs + 15 + y1 = (y - 1) * rs + 10 + Line (x1, y1)-(x1 + rs - 1, y1 + rs - 1), c, BF + + If lau(x, y) > 0 Then + sp = rs / 2 + If lau(x, y) = 1 Then c1 = 15 Else c1 = 14 + Circle (x1 + sp, y1 + sp), sp - 1, c1 + Paint (x1 + sp, y1 + sp), c1 + End If +End Sub + +Sub start + getfnt + Screen 12 + Line (399, 0)-(399, 479), 13 + msg "Type 'h' for help.", 14 + + rs = Int(370 / siz) + +End Sub + +Sub thinkc + msg "Computer turn.", 14 + sug = 0 + npos = 0 + cx1 = -1 + + compgo h + cmd "n" + If cx1 = -1 Then msg "You won!", 10: msg "--------", 10: System + + If h <= -2 Then msg "Oh no...", 10 + If h = -1 Then msg "Oops!", 10 + If h = 1 Then msg "Yess! I will eat soon!", 10 + If h >= 2 Then msg "HA HA HA YOU ARE IN TROUBLE!", 10 + + If Abs(cx1 - cx2) = 2 Then + cx3 = (cx1 + cx2) / 2 + cy3 = (cy1 + cy2) / 2 + lau(cx3, cy3) = 0 + showr cx3, cy3 + End If + + Swap lau(cx1, cy1), lau(cx2, cy2) + showr cx1, cy1 + showr cx2, cy2 + +End Sub + +Sub thinkh + msg "Your turn.", 14 + 5 + freet + If humx1 = 0 Then GoTo 5 + Swap lau(humx2, humy2), lau(humx1, humy1) + showr humx1, humy1 + showr humx2, humy2 + If Abs(humx1 - humx2) = 2 Then + cx3 = (humx1 + humx2) / 2 + cy3 = (humy1 + humy2) / 2 + lau(cx3, cy3) = 0 + showr cx3, cy3 + End If + + humx1 = 0 +End Sub diff --git a/Games/checkers2.png b/Games/checkers2.png new file mode 100644 index 0000000..9b4dbf4 Binary files /dev/null and b/Games/checkers2.png differ diff --git a/Math/3dlife.dat b/Math/3dlife.dat new file mode 100644 index 0000000..17b0e10 --- /dev/null +++ b/Math/3dlife.dat @@ -0,0 +1,13 @@ +.....#.#..... +...##...##... +..#.......#.. +.#..##.##..#. +.#.#.....#.#. +#..#.###.#..# +.....#.#..... +#..#.###.#..# +.#.#.....#.#. +.#..##.##..#. +..#.......#.. +...##...##... +.....#.#..... diff --git a/Math/Game of life in 3D.bas b/Math/Game of life in 3D.bas new file mode 100755 index 0000000..70652ec --- /dev/null +++ b/Math/Game of life in 3D.bas @@ -0,0 +1,363 @@ +' Program renders rotating 3D animation from cubes. +' Cubes appear and disappear according to Conway's Game of Life rules. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' ~2000, Initial version +' 2024 - 2025, Improved program readability + +DECLARE SUB PlaceCube (xCoordinate!, yCoordinate!, zCoordinate!) +DECLARE SUB DrawScene () +DECLARE SUB Generate3DScene () +DECLARE SUB UpdateCollisionData () +DECLARE SUB InitializeGame () + +DIM SHARED totalPoints, totalLines, currentPointCount, currentLineCount +DIM SHARED pointXCoordinates(1 TO 3000), pointYCoordinates(1 TO 3000), pointZCoordinates(1 TO 3000) +DIM SHARED renderedPointXCoordinates(1 TO 7000), renderedPointYCoordinates(1 TO 7000) +DIM SHARED previousRenderedPointXCoordinates(0 TO 9000), previousRenderedPointYCoordinates(0 TO 9000) +DIM SHARED previousPointCount, previousLineCount +DIM SHARED lineVertex1Indices(1 TO 3800), lineVertex2Indices(1 TO 3800), lineColorValues(1 TO 3800) +DIM SHARED previousLineVertex1Indices(1 TO 3800), previousLineVertex2Indices(1 TO 3800) +DIM SHARED cameraPositionX, cameraPositionY, cameraPositionZ +DIM SHARED previousCameraPositionX, previousCameraPositionY, previousCameraPositionZ +DIM SHARED rotationAngle1, rotationAngle2 +DIM SHARED rotationAngle1String, rotationAngle2String +DIM SHARED currentFrameCount +DIM SHARED currentGameOfLifeGrid(1 TO 50, 1 TO 50) +DIM SHARED nextGameOfLifeGrid(1 TO 50, 1 TO 50) + +' Main program +InitializeGame +rotationAngle1 = 1.5 + +10 +currentFrameCount = currentFrameCount + 1 +Generate3DScene +DrawScene + +cameraPositionX = SIN(currentFrameCount / 20) * 12 +cameraPositionY = SIN(currentFrameCount / 50) * 10 + 15 +cameraPositionZ = COS(currentFrameCount / 20) * 12 +rotationAngle1 = rotationAngle1 - .05 +rotationAngle2 = 2.2 + SIN(currentFrameCount / 50) / 2 + +inputKey$ = INKEY$ +IF inputKey$ <> "" THEN SYSTEM +GOTO 10 + +SUB Generate3DScene + ' This subroutine generates 3D scene of cubes based on the current state of the Game of Life grid. + ' It iterates over the grid and places cubes where the grid cells are alive. + ' It also updates the grid based on Conway's Game of Life rules every 10 frames. + + currentPointCount = totalPoints + currentLineCount = totalLines + + FOR y = 1 TO 50 + FOR x = 1 TO 50 + IF currentGameOfLifeGrid(x, y) = 1 THEN + value = ABS(x - 26) + ABS(y - 26) + currentFrameCount + PlaceCube x - 25, SIN(value / 5) * 5, y - 25 + END IF + NEXT x + NEXT y + + IF currentFrameCount \ 10 = currentFrameCount / 10 THEN ' activate every 10-th frame to update grid + FOR y = 2 TO 49 + FOR x = 2 TO 49 + neighborCount = currentGameOfLifeGrid(x - 1, y - 1) + neighborCount = neighborCount + currentGameOfLifeGrid(x, y - 1) + neighborCount = neighborCount + currentGameOfLifeGrid(x + 1, y - 1) + neighborCount = neighborCount + currentGameOfLifeGrid(x - 1, y) + neighborCount = neighborCount + currentGameOfLifeGrid(x + 1, y) + neighborCount = neighborCount + currentGameOfLifeGrid(x - 1, y + 1) + neighborCount = neighborCount + currentGameOfLifeGrid(x, y + 1) + neighborCount = neighborCount + currentGameOfLifeGrid(x + 1, y + 1) + + IF currentGameOfLifeGrid(x, y) = 1 THEN + IF (neighborCount > 3) OR (neighborCount < 2) THEN + nextGameOfLifeGrid(x, y) = 0 + ELSE + nextGameOfLifeGrid(x, y) = 1 + END IF + ELSE + IF neighborCount = 3 THEN + nextGameOfLifeGrid(x, y) = 1 + ELSE + nextGameOfLifeGrid(x, y) = 0 + END IF + END IF + NEXT x + NEXT y + + FOR y = 1 TO 50 + FOR x = 1 TO 50 + currentGameOfLifeGrid(x, y) = nextGameOfLifeGrid(x, y) + NEXT x + NEXT y + END IF +END SUB + +SUB InitializeEnvironment + ' This subroutine initializes the environment by creating a grid of points and lines. + ' It sets up the initial state of the points and lines arrays. + + FOR z = -5 TO 5 + FOR x = -5 TO 5 + currentPointCount = currentPointCount + 1 + pointXCoordinates(currentPointCount) = x + pointYCoordinates(currentPointCount) = 0 + pointZCoordinates(currentPointCount) = z + + IF x > -5 THEN + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + lineVertex2Indices(currentLineCount) = currentPointCount - 1 + lineColorValues(currentLineCount) = 1 + END IF + + IF z > -5 THEN + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + lineVertex2Indices(currentLineCount) = currentPointCount - 10 + lineColorValues(currentLineCount) = 1 + END IF + NEXT x + NEXT z + + totalPoints = currentPointCount + totalLines = currentLineCount +END SUB + +SUB PlaceCube (xCoordinate, yCoordinate, zCoordinate) + ' This subroutine places a cube at the specified coordinates (xCoordinate, yCoordinate, zCoordinate). + ' It defines the vertices and edges of the cube and stores them in the respective arrays. + + colorValue = 3 + + ' Define the edges of the cube + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 1 + lineVertex2Indices(currentLineCount) = currentPointCount + 2 + lineColorValues(currentLineCount) = colorValue + + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 2 + lineVertex2Indices(currentLineCount) = currentPointCount + 3 + lineColorValues(currentLineCount) = colorValue + + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 3 + lineVertex2Indices(currentLineCount) = currentPointCount + 4 + lineColorValues(currentLineCount) = colorValue + + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 4 + lineVertex2Indices(currentLineCount) = currentPointCount + 1 + lineColorValues(currentLineCount) = colorValue + + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 5 + lineVertex2Indices(currentLineCount) = currentPointCount + 6 + lineColorValues(currentLineCount) = colorValue + + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 6 + lineVertex2Indices(currentLineCount) = currentPointCount + 7 + lineColorValues(currentLineCount) = colorValue + + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 7 + lineVertex2Indices(currentLineCount) = currentPointCount + 8 + lineColorValues(currentLineCount) = colorValue + + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 8 + lineVertex2Indices(currentLineCount) = currentPointCount + 5 + lineColorValues(currentLineCount) = colorValue + + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 1 + lineVertex2Indices(currentLineCount) = currentPointCount + 5 + lineColorValues(currentLineCount) = colorValue + + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 2 + lineVertex2Indices(currentLineCount) = currentPointCount + 6 + lineColorValues(currentLineCount) = colorValue + + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 3 + lineVertex2Indices(currentLineCount) = currentPointCount + 7 + lineColorValues(currentLineCount) = colorValue + + currentLineCount = currentLineCount + 1 + lineVertex1Indices(currentLineCount) = currentPointCount + 4 + lineVertex2Indices(currentLineCount) = currentPointCount + 8 + lineColorValues(currentLineCount) = colorValue + + ' Define the vertices of the cube + currentPointCount = currentPointCount + 1 + pointXCoordinates(currentPointCount) = xCoordinate - .5 + pointYCoordinates(currentPointCount) = yCoordinate + pointZCoordinates(currentPointCount) = zCoordinate - .5 + + currentPointCount = currentPointCount + 1 + pointXCoordinates(currentPointCount) = xCoordinate + .5 + pointYCoordinates(currentPointCount) = yCoordinate + pointZCoordinates(currentPointCount) = zCoordinate - .5 + + currentPointCount = currentPointCount + 1 + pointXCoordinates(currentPointCount) = xCoordinate + .5 + pointYCoordinates(currentPointCount) = yCoordinate + pointZCoordinates(currentPointCount) = zCoordinate + .5 + + currentPointCount = currentPointCount + 1 + pointXCoordinates(currentPointCount) = xCoordinate - .5 + pointYCoordinates(currentPointCount) = yCoordinate + pointZCoordinates(currentPointCount) = zCoordinate + .5 + + currentPointCount = currentPointCount + 1 + pointXCoordinates(currentPointCount) = xCoordinate - .5 + pointYCoordinates(currentPointCount) = yCoordinate + 1 + pointZCoordinates(currentPointCount) = zCoordinate - .5 + + currentPointCount = currentPointCount + 1 + pointXCoordinates(currentPointCount) = xCoordinate + .5 + pointYCoordinates(currentPointCount) = yCoordinate + 1 + pointZCoordinates(currentPointCount) = zCoordinate - .5 + + currentPointCount = currentPointCount + 1 + pointXCoordinates(currentPointCount) = xCoordinate + .5 + pointYCoordinates(currentPointCount) = yCoordinate + 1 + pointZCoordinates(currentPointCount) = zCoordinate + .5 + + currentPointCount = currentPointCount + 1 + pointXCoordinates(currentPointCount) = xCoordinate - .5 + pointYCoordinates(currentPointCount) = yCoordinate + 1 + pointZCoordinates(currentPointCount) = zCoordinate + .5 +END SUB + +SUB DrawScene + ' This subroutine renders the scene by transforming the 3D coordinates of the points to 2D screen coordinates + ' and drawing the lines between the points. It uses trigonometric functions to rotate and project the 3D points onto the 2D screen. + + sineAngle1 = SIN(rotationAngle1) + cosineAngle1 = COS(rotationAngle1) + sineAngle2 = SIN(rotationAngle2) + cosineAngle2 = COS(rotationAngle2) + + FOR index = 1 TO currentPointCount + x = pointXCoordinates(index) + cameraPositionX + y = pointYCoordinates(index) - cameraPositionY + z = pointZCoordinates(index) + cameraPositionZ + + transformedX = x * sineAngle1 - z * cosineAngle1 + transformedZ = x * cosineAngle1 + z * sineAngle1 + transformedY = y * sineAngle2 - transformedZ * cosineAngle2 + transformedZ2 = y * cosineAngle2 + transformedZ * sineAngle2 + + IF transformedZ2 < .5 THEN + renderedPointXCoordinates(index) = -1 + ELSE + renderedPointXCoordinates(index) = 320 + (transformedX / transformedZ2 * 400) + renderedPointYCoordinates(index) = 240 - (transformedY / transformedZ2 * 400) + END IF + NEXT index + + FOR index = 1 TO currentLineCount + vertex1 = previousLineVertex1Indices(index) + vertex2 = previousLineVertex2Indices(index) + + IF previousRenderedPointXCoordinates(vertex1) = -1 OR previousRenderedPointXCoordinates(vertex2) = -1 THEN + ELSE + LINE (previousRenderedPointXCoordinates(vertex1), previousRenderedPointYCoordinates(vertex1))-(previousRenderedPointXCoordinates(vertex2), previousRenderedPointYCoordinates(vertex2)), 0 + END IF + + vertex1 = lineVertex1Indices(index) + vertex2 = lineVertex2Indices(index) + + IF renderedPointXCoordinates(vertex1) = -1 OR renderedPointXCoordinates(vertex2) = -1 THEN + ELSE + LINE (renderedPointXCoordinates(vertex1), renderedPointYCoordinates(vertex1))-(renderedPointXCoordinates(vertex2), renderedPointYCoordinates(vertex2)), lineColorValues(index) + END IF + NEXT index + + IF currentLineCount < previousLineCount THEN + FOR index = currentLineCount + 1 TO previousLineCount + vertex1 = previousLineVertex1Indices(index) + vertex2 = previousLineVertex2Indices(index) + + IF previousRenderedPointXCoordinates(vertex1) = -1 OR previousRenderedPointXCoordinates(vertex2) = -1 THEN + ELSE + LINE (previousRenderedPointXCoordinates(vertex1), previousRenderedPointYCoordinates(vertex1))-(previousRenderedPointXCoordinates(vertex2), previousRenderedPointYCoordinates(vertex2)), 0 + END IF + NEXT index + END IF + + FOR index = 1 TO currentPointCount + previousRenderedPointXCoordinates(index) = renderedPointXCoordinates(index) + previousRenderedPointYCoordinates(index) = renderedPointYCoordinates(index) + NEXT index + + previousPointCount = currentPointCount + + FOR index = 1 TO currentLineCount + previousLineVertex1Indices(index) = lineVertex1Indices(index) + previousLineVertex2Indices(index) = lineVertex2Indices(index) + NEXT index + + previousLineCount = currentLineCount +END SUB + +SUB InitializeGame + ' This subroutine initializes the game by setting up the screen, initializing the points and lines arrays, + ' and loading the initial state of the Game of Life grid from a file. + + SCREEN 12 + totalPoints = 0 + totalLines = 0 + currentPointCount = totalPoints + currentLineCount = totalLines + gridSize = 50 + + cameraPositionX = 4 + cameraPositionY = 15 + cameraPositionZ = 17 + rotationAngle1 = ATN(1) / 2 - .29 + rotationAngle2 = rotationAngle1 + 1 + + FOR index = 1 TO 1000 + lineColorValues(index) = 4 + NEXT index + + FOR index = 1 TO 1000 + previousLineVertex1Indices(index) = 1 + previousLineVertex2Indices(index) = 1 + NEXT index + + OPEN "3dlife.dat" FOR INPUT AS #1 + y = 20 + +20 + IF EOF(1) <> 0 THEN GOTO 30 + x = 20 + LINE INPUT #1, inputLine$ + + FOR characterIndex = 1 TO LEN(inputLine$) + currentChar$ = RIGHT$(LEFT$(inputLine$, characterIndex), 1) + IF currentChar$ = "#" THEN currentGameOfLifeGrid(x, y) = 1 + x = x + 1 + NEXT characterIndex + + y = y + 1 + GOTO 20 + +30 + CLOSE #1 +END SUB diff --git a/Math/Game of life in 3D.webm b/Math/Game of life in 3D.webm new file mode 100644 index 0000000..2b7e1ed Binary files /dev/null and b/Math/Game of life in 3D.webm differ diff --git a/Math/Game of life/1 b/Math/Game of life/1 new file mode 100644 index 0000000..b411c92 --- /dev/null +++ b/Math/Game of life/1 @@ -0,0 +1,50 @@ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +........####...................................... +.......#....#..................................... +........####...................................... +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +................................#######........... +...............................#.......#.......... +................................#######........... +.................................................. +.................................................. +.................................................. +.................................................. +........#####..................................... +.......#.....#.................................... +........#####..................................... +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +................................######............ +...............................#......#........... +................................######............ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. diff --git a/Math/Game of life/10 b/Math/Game of life/10 new file mode 100644 index 0000000..08af0fb --- /dev/null +++ b/Math/Game of life/10 @@ -0,0 +1,50 @@ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +........................###....................... +.....................#.......#.................... +....................#.........#................... +........................###....................... +.......................#...#...................... +...................#..#.....#..#.................. +...................#..#.....#..#.................. +...................#..#.....#..#.................. +.......................#...#...................... +........................###....................... +....................#.........#................... +.....................#.......#.................... +........................###....................... +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. diff --git a/Math/Game of life/11 b/Math/Game of life/11 new file mode 100644 index 0000000..5b8cf86 --- /dev/null +++ b/Math/Game of life/11 @@ -0,0 +1,50 @@ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +........................###....................... +.....................#...#...#.................... +....................##...#...##................... +......................#.###.#..................... +.......................#...#...................... +...................#..#.....#..#.................. +...................####.....####.................. +...................#..#.....#..#.................. +.......................#...#...................... +......................#.###.#..................... +....................##...#...##................... +.....................#...#...#.................... +........................###....................... +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. diff --git a/Math/Game of life/2 b/Math/Game of life/2 new file mode 100644 index 0000000..b5ebe02 --- /dev/null +++ b/Math/Game of life/2 @@ -0,0 +1,50 @@ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +...............##................................. +...............#.................................. +.................#................................ +.............#####................................ +.............#.................................... +...........##...##................................ +.......##.#....##.#.##............................ +........#.#....##.#.#............................. +.......#..##....#.#..#............................ +........##..#.#....##............................. +..........#.#######............................... +..........#.......#............................... +...........#######................................ +.................................................. +.............###.................................. +............#..#.................................. +............##..................##................ +...............................#..#.##............ +...............................#.##.#.#........... +..............................##..#.#.#........... +.............................#..#.#...#.##........ +.............................##.#.#...#..#........ +................................#.#.#..##......... +................................#.#.##.#.......... +.................................##.#..#.......... +.....................................##........... +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. diff --git a/Math/Game of life/3 b/Math/Game of life/3 new file mode 100644 index 0000000..f904a0b --- /dev/null +++ b/Math/Game of life/3 @@ -0,0 +1,50 @@ +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.. +.................................................. +.................................................. +.................................................. +.................................................. +.##.##.##.##.##.##.##.##.##.##.##.##.............. +.##.##.##.##.##.##.##.##.##.##.##.##.............. +...........................................###.... +.##.##.##.##.##.##.##.##.##.##.##.##.......#...... +.##.##.##.##.##.##.##.##.##.##.##.##........#..... +.................................................. +.................................................. diff --git a/Math/Game of life/4 b/Math/Game of life/4 new file mode 100644 index 0000000..da991a7 --- /dev/null +++ b/Math/Game of life/4 @@ -0,0 +1,50 @@ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +........................#......................... +.......................###........................ +.......................#.#........................ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. diff --git a/Math/Game of life/5 b/Math/Game of life/5 new file mode 100644 index 0000000..064f56e --- /dev/null +++ b/Math/Game of life/5 @@ -0,0 +1,50 @@ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +..............................#................... +.............................###.................. +...............................#.................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. diff --git a/Math/Game of life/6 b/Math/Game of life/6 new file mode 100644 index 0000000..fc66375 --- /dev/null +++ b/Math/Game of life/6 @@ -0,0 +1,50 @@ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +......###.....#...#...#...#...#...#...#...#....... +......#.#.....#...#...#...#...#...#...#...#....... +......###.....#...#...#...#...#...#...#...#....... +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.............#..#..#..#..#..#..#..#..#............ +.............#..#..#..#..#..#..#..#..#............ +.............#..#..#..#..#..#..#..#..#............ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. diff --git a/Math/Game of life/7 b/Math/Game of life/7 new file mode 100644 index 0000000..e008167 --- /dev/null +++ b/Math/Game of life/7 @@ -0,0 +1,50 @@ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.......###........................................ +.........#........................................ +........#......................................... +.................................................. +........................................###....... +........................................#......... +.........................................#........ +.................................................. +.................................................. +.................................................. diff --git a/Math/Game of life/8 b/Math/Game of life/8 new file mode 100644 index 0000000..bb71aee --- /dev/null +++ b/Math/Game of life/8 @@ -0,0 +1,50 @@ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +..................#.#.#.#.#.#..................... +.................#.#.#.#.#.#.#.................... +..................#.#.#.#.#.#..................... +.................#.#.#.#.#.#.#.................... +..................#.#.#.#.#.#..................... +.................#.#.#.#.#.#.#.................... +..................#.#.#.#.#.#..................... +.................#.#.#.#.#.#.#.................... +..................#.#.#.#.#.#..................... +.................#.#.#.#.#.#.#.................... +..................#.#.#.#.#.#..................... +.................#.#.#.#.#.#.#.................... +..................#.#.#.#.#.#..................... +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. diff --git a/Math/Game of life/9 b/Math/Game of life/9 new file mode 100644 index 0000000..ded468e --- /dev/null +++ b/Math/Game of life/9 @@ -0,0 +1,50 @@ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +....................................##............ +..................................##..#........... +............#####.................#..##........... +..........#.......#................##............. +.........#.........#.............................. +.............###.................................. +........#...#...#...#............................. +........#..#.....#..#............................. +........#..#.....#..#............................. +........#..#.....#..#............................. +........#...#...#...#............................. +.............###.................................. +.........#.........#.............................. +..........#.......#............................... +............#####................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +...................................#####.......... +.................................##.....##........ +................................#.........#....... +................................#...###...#....... +...............................#...#...#...#...... +...............................#..#.....#..#...... +...............................#..#.....#..#...... +........#......................#..#.....#..#...... +........##.##..................#...#...#...#...... +............#...................#...###...#....... +................................#.........#....... +.................................##.....##........ +...................................#####.......... +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. diff --git a/Math/Game of life/Game of life.bas b/Math/Game of life/Game of life.bas new file mode 100755 index 0000000..ae7adf4 --- /dev/null +++ b/Math/Game of life/Game of life.bas @@ -0,0 +1,454 @@ +' Conway's Game of Life. +' It has world editor, and can save/load worlds. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2001, Initial version +' 2024 - 2025, Improved program readability + +' Usage: +' +' Observation Mode +' ---------------- +' +' Purpose: Observation mode is the primary mode of the program where +' you can observe the simulation of Conway's Game of Life. In this +' mode, the grid evolves according to the rules of the Game of Life, +' and you can control the simulation's progression, speed, and other +' aspects. + +' Available Keys: +' +' x: Run the simulation for 10,000 cycles. This allows you to +' observe the long-term behavior of the grid without manually +' advancing each step. +' +' s: Run the simulation for a specified number of cycles. You will +' be prompted to enter the number of cycles you want to advance. +' +' n: Run the simulation for 1 cycle. This allows you to step +' through the simulation one generation at a time. +' +' z: Stop running the simulation. This halts the automatic +' advancement of cycles, allowing you to observe the current state +' of the grid. +' +' c: Clear all cells in the grid. This resets the grid to a blank +' state, with all cells set to dead. +' +' w: Write the current state of the grid to a file. You will be +' prompted to enter a filename. The grid state will be saved in a +' format that can be loaded later. +' +' l: Load a grid state from a file. You will be prompted to enter +' the filename of the saved grid state. The grid will be loaded +' and displayed. +' +' e: Switch to edit mode. This allows you to manually edit the +' grid, toggle cells on/off, and perform other editing functions. +' +' q: Quit the program. This exits the simulation and returns you +' to the operating system. +' +' +' Edit Mode +' --------- +' +' Purpose: Edit mode allows you to manually edit the grid. You can +' toggle individual cells on or off, move around the grid, and perform +' other editing functions. This mode is useful for setting up initial +' conditions, creating specific patterns, or making adjustments to the +' grid. +' +'Available Keys: +' +' Cursor Keys (Arrow Keys): Move the cursor around the grid. The +' cursor highlights the current cell, allowing you to toggle it on +' or off. +' +' 4, 8, 6, 2: Move the cursor around the grid in large jumps. These +' keys allow you to quickly navigate to different areas of the +' grid. +' +' s: Switch to select mode. This allows you to select a region of +' the grid for copying or cutting. +' +' v: Paste the contents of the copy buffer to the current cursor +' position. This is useful for duplicating patterns or restoring +' cut regions. +' +' SPACE: Toggle the current cell on or off. If the cell is alive, +' it will be set to dead, and vice versa. +' +' ESC: Return to observing mode. This exits edit mode and returns +' you to the primary observation mode, where you can observe the +' simulation. +' +' +' Select Mode +' ----------- +' +' Purpose: Select mode is a sub-mode of edit mode that allows you to +' select a region of the grid. You can copy or cut the selected +' region, which can then be pasted elsewhere in the grid. +' +' Available Keys: +' +' Cursor Keys (Arrow Keys): Adjust the selection rectangle. You +' can resize the selection by moving the cursor. +' +' 4, 8, 6, 2: Adjust the selection rectangle in large jumps. These +' keys allow you to quickly resize the selection. +' +' c: Copy the selected region to the copy buffer. The selected +' region remains intact on the grid. +' +' x: Cut the selected region to the copy buffer. The selected +' region is cleared from the grid and copied to the buffer. +' +' ESC: Return to edit mode. This exits select mode and returns you +' to edit mode, where you can continue editing the grid. +' + +DECLARE SUB LoadGridFromFile () +DECLARE SUB SaveGridToFile () +DECLARE SUB DisplayCopyBuffer () +DEFINT A-Z +DECLARE SUB EnterSelectMode (gridX, gridY) +DECLARE SUB ClearGridBuffers () +DECLARE SUB EnterEditMode () +DECLARE SUB DisplayGridState () +DECLARE SUB ClearScreenLine () +DECLARE SUB ProcessLifeGeneration () +DECLARE SUB InitializeSimulation () + +DIM SHARED gridBufferA(1 TO 50, 1 TO 50) +DIM SHARED gridBufferB(1 TO 50, 1 TO 50) +DIM SHARED currentBuffer +DIM SHARED generationCount +DIM SHARED autoAdvanceCount +DIM SHARED copyBuffer(0 TO 50, 0 TO 50) +DIM SHARED copyBufferWidth, copyBufferHeight + +InitializeSimulation + +1 +ProcessLifeGeneration +generationCount = generationCount + 1 + +2 +LOCATE 1, 27 +PRINT "frame:" + STR$(generationCount) + " " +LOCATE 2, 27 +PRINT "skip:" + STR$(autoAdvanceCount) + " " +userInput$ = INKEY$ + +IF userInput$ = "s" THEN + LOCATE 5, 27 + INPUT "skip ", autoAdvanceCount + ClearScreenLine +END IF + +IF userInput$ = "q" THEN + SYSTEM +END IF + +IF userInput$ = "n" THEN GOTO 1 +IF userInput$ = "c" THEN ClearGridBuffers +IF userInput$ = "e" THEN EnterEditMode +IF userInput$ = "z" THEN autoAdvanceCount = 0 +IF userInput$ = "x" THEN autoAdvanceCount = 10000 +IF userInput$ = "w" THEN SaveGridToFile +IF userInput$ = "l" THEN LoadGridFromFile + +IF autoAdvanceCount > 0 THEN + autoAdvanceCount = autoAdvanceCount - 1 + GOTO 1 +END IF + +GOTO 2 + +SUB ClearGridBuffers +' Clears the grid buffers and resets the simulation counters. +FOR gridY = 1 TO 50 + FOR gridX = 1 TO 50 + gridBufferA(gridX, gridY) = 0 + gridBufferB(gridX, gridY) = 0 + NEXT gridX +NEXT gridY +currentBuffer = 0 +generationCount = 0 +autoAdvanceCount = 0 +DisplayGridState +END SUB + +SUB ClearScreenLine +' Clears a specific line on the screen. +LOCATE 5, 27 +PRINT " " +END SUB + +SUB DisplayGridState +' Displays the current state of the grid. +FOR gridY = 1 TO 50 + FOR gridX = 1 TO 50 + IF currentBuffer = 0 THEN cellState = gridBufferA(gridX, gridY) ELSE cellState = gridBufferB(gridX, gridY) + IF cellState = 0 THEN cellState = 1 ELSE cellState = 10 + LINE (gridX * 4, gridY * 4)-(gridX * 4 + 2, gridY * 4 + 2), cellState, BF + NEXT gridX +NEXT gridY +END SUB + +SUB EnterEditMode +' Allows the user to edit the grid manually. +cursorX = 25 +cursorY = 25 + +3 +IF cursorX < 1 THEN cursorX = 1 +IF cursorY < 1 THEN cursorY = 1 +IF cursorX > 50 THEN cursorX = 50 +IF cursorY > 49 THEN cursorY = 49 + +IF currentBuffer = 0 THEN cellState = gridBufferA(cursorX, cursorY) ELSE cellState = gridBufferB(cursorX, cursorY) +IF cellState = 0 THEN cellState = 1 ELSE cellState = 10 +LINE (cursorX * 4, cursorY * 4)-(cursorX * 4 + 2, cursorY * 4 + 2), cellState, BF +LINE (cursorX * 4 - 1, cursorY * 4 - 1)-(cursorX * 4 + 3, cursorY * 4 + 3), 14, B + +4 +userInput$ = INKEY$ +IF userInput$ = "" THEN GOTO 4 +LINE (cursorX * 4 - 1, cursorY * 4 - 1)-(cursorX * 4 + 3, cursorY * 4 + 3), 0, B + +' Handle cursor movement +IF userInput$ = CHR$(0) + "M" THEN cursorX = cursorX + 1 ' Right arrow +IF userInput$ = CHR$(0) + "K" THEN cursorX = cursorX - 1 ' Left arrow +IF userInput$ = CHR$(0) + "P" THEN cursorY = cursorY + 1 ' Down arrow +IF userInput$ = CHR$(0) + "H" THEN cursorY = cursorY - 1 ' Up arrow + +' Handle large jumps +IF userInput$ = "6" THEN cursorX = cursorX + 8 +IF userInput$ = "4" THEN cursorX = cursorX - 8 +IF userInput$ = "2" THEN cursorY = cursorY + 8 +IF userInput$ = "8" THEN cursorY = cursorY - 8 + +IF userInput$ = CHR$(27) THEN GOTO 5 ' ESC key to exit edit mode +IF userInput$ = "s" THEN EnterSelectMode cursorX, cursorY + +' Paste from copy buffer +IF userInput$ = "v" THEN + FOR pasteY = 0 TO copyBufferHeight + FOR pasteX = 0 TO copyBufferWidth + cellState = copyBuffer(pasteX, pasteY) + gridX = pasteX + cursorX + gridY = pasteY + cursorY + IF (gridX < 50) AND (gridY < 50) THEN + IF currentBuffer = 0 THEN gridBufferA(gridX, gridY) = cellState ELSE gridBufferB(gridX, gridY) = cellState + END IF + NEXT pasteX + NEXT pasteY + DisplayGridState +END IF + +' Toggle cell on/off +IF userInput$ = " " THEN + IF currentBuffer = 0 THEN cellState = gridBufferA(cursorX, cursorY) ELSE cellState = gridBufferB(cursorX, cursorY) + IF cellState = 1 THEN cellState = 0 ELSE cellState = 1 + IF currentBuffer = 0 THEN gridBufferA(cursorX, cursorY) = cellState ELSE gridBufferB(cursorX, cursorY) = cellState +END IF + +GOTO 3 + +5 +END SUB + +SUB InitializeSimulation +' Initializes the screen and buffers. +SCREEN 13 +RANDOMIZE TIMER +copyBufferWidth = 0 +copyBufferHeight = 0 +ClearGridBuffers +END SUB + +SUB LoadGridFromFile +' Loads a grid state from a file. +ClearGridBuffers +LOCATE 5, 27 +INPUT "file ", fileName$ +ClearScreenLine +gridY = 1 +OPEN fileName$ FOR INPUT AS #1 + +9 +IF EOF(1) <> 0 THEN GOTO 10 +LINE INPUT #1, fileLine$ +FOR gridX = 1 TO LEN(fileLine$) + fileChar$ = RIGHT$(LEFT$(fileLine$, gridX), 1) + IF fileChar$ = "#" THEN cellState = 1 ELSE cellState = 0 + IF currentBuffer = 0 THEN gridBufferA(gridX, gridY) = cellState ELSE gridBufferB(gridX, gridY) = cellState +NEXT gridX +gridY = gridY + 1 +GOTO 9 + +10 +CLOSE #1 +DisplayGridState +END SUB + +SUB ProcessLifeGeneration +' Processes one generation of Conway's Game of Life. +IF currentBuffer = 0 THEN + FOR gridY = 2 TO 48 + FOR gridX = 2 TO 49 + IF gridBufferA(gridX - 1, gridY - 1) = 1 THEN neighborCount = 1 ELSE neighborCount = 0 + IF gridBufferA(gridX, gridY - 1) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferA(gridX + 1, gridY - 1) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferA(gridX - 1, gridY) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferA(gridX + 1, gridY) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferA(gridX - 1, gridY + 1) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferA(gridX, gridY + 1) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferA(gridX + 1, gridY + 1) = 1 THEN neighborCount = neighborCount + 1 + + ' Apply Game of Life rules + IF gridBufferA(gridX, gridY) = 1 THEN + IF neighborCount = 2 OR neighborCount = 3 THEN gridBufferB(gridX, gridY) = 1 ELSE gridBufferB(gridX, gridY) = 0 + ELSE + IF neighborCount = 3 THEN gridBufferB(gridX, gridY) = 1 ELSE gridBufferB(gridX, gridY) = 0 + END IF + NEXT gridX + NEXT gridY + currentBuffer = 1 + DisplayGridState +ELSE ' Process second half of the grid + FOR gridY = 2 TO 48 + FOR gridX = 2 TO 49 + IF gridBufferB(gridX - 1, gridY - 1) = 1 THEN neighborCount = 1 ELSE neighborCount = 0 + IF gridBufferB(gridX, gridY - 1) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferB(gridX + 1, gridY - 1) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferB(gridX - 1, gridY) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferB(gridX + 1, gridY) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferB(gridX - 1, gridY + 1) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferB(gridX, gridY + 1) = 1 THEN neighborCount = neighborCount + 1 + IF gridBufferB(gridX + 1, gridY + 1) = 1 THEN neighborCount = neighborCount + 1 + + ' Apply Game of Life rules + IF gridBufferB(gridX, gridY) = 1 THEN + IF neighborCount = 2 OR neighborCount = 3 THEN gridBufferA(gridX, gridY) = 1 ELSE gridBufferA(gridX, gridY) = 0 + ELSE + IF neighborCount = 3 THEN gridBufferA(gridX, gridY) = 1 ELSE gridBufferA(gridX, gridY) = 0 + END IF + NEXT gridX + NEXT gridY + currentBuffer = 0 + DisplayGridState +END IF +END SUB + +SUB EnterSelectMode (gridX, gridY) +' Allows the user to select a region of the grid. +cursorX = gridX * 4 - 1 ' Calculate initial x position for selection rectangle +cursorY = gridY * 4 - 1 ' Calculate initial y position for selection rectangle +selectionEndX = gridX + 2 ' Initialize end x position for selection rectangle +selectionEndY = gridY + 2 ' Initialize end y position for selection rectangle + +6 +selectionRightEdge = selectionEndX * 4 + 3 ' Calculate right edge of selection rectangle +selectionBottomEdge = selectionEndY * 4 + 3 ' Calculate bottom edge of selection rectangle + +' Draw selection rectangle +LINE (cursorX, cursorY)-(selectionRightEdge, selectionBottomEdge), 14, B + +8 +userInput$ = INKEY$ +IF userInput$ = "" THEN GOTO 8 + +' Erase selection rectangle +LINE (cursorX, cursorY)-(selectionRightEdge, selectionBottomEdge), 0, B + +' Handle cursor movement +IF userInput$ = CHR$(0) + "M" THEN selectionEndX = selectionEndX + 1 ' Right arrow +IF userInput$ = CHR$(0) + "K" THEN selectionEndX = selectionEndX - 1 ' Left arrow +IF userInput$ = CHR$(0) + "P" THEN selectionEndY = selectionEndY + 1 ' Down arrow +IF userInput$ = CHR$(0) + "H" THEN selectionEndY = selectionEndY - 1 ' Up arrow + +' Handle large jumps +IF userInput$ = "6" THEN selectionEndX = selectionEndX + 8 +IF userInput$ = "4" THEN selectionEndX = selectionEndX - 8 +IF userInput$ = "2" THEN selectionEndY = selectionEndY + 8 +IF userInput$ = "8" THEN selectionEndY = selectionEndY - 8 + +IF userInput$ = CHR$(27) THEN GOTO 7 ' ESC key to exit select mode + +IF userInput$ = "c" THEN + copyBufferWidth = selectionEndX - gridX ' Calculate size of selection rectangle + copyBufferHeight = selectionEndY - gridY + FOR sourceY = gridY TO selectionEndY + FOR sourceX = gridX TO selectionEndX + IF currentBuffer = 0 THEN cellState = gridBufferA(sourceX, sourceY) ELSE cellState = gridBufferB(sourceX, sourceY) + copyBuffer(sourceX - gridX, sourceY - gridY) = cellState ' Copy selection to buffer + NEXT sourceX + NEXT sourceY + DisplayCopyBuffer ' Display copied selection +END IF + +IF userInput$ = "x" THEN + copyBufferWidth = selectionEndX - gridX ' Calculate size of selection rectangle + copyBufferHeight = selectionEndY - gridY + FOR sourceY = gridY TO selectionEndY + FOR sourceX = gridX TO selectionEndX + IF currentBuffer = 0 THEN cellState = gridBufferA(sourceX, sourceY): gridBufferA(sourceX, sourceY) = 0 ELSE cellState = gridBufferB(sourceX, sourceY): gridBufferB(sourceX, sourceY) = 0 ' Clear selection + copyBuffer(sourceX - gridX, sourceY - gridY) = cellState ' Copy cleared selection to buffer + NEXT sourceX + NEXT sourceY + DisplayCopyBuffer ' Display cut selection + DisplayGridState ' Update grid +END IF + +GOTO 6 + +7 +END SUB + +SUB DisplayCopyBuffer +' Displays the contents of the copy buffer. +cursorX = copyBufferWidth ' Calculate width of copied selection +IF cursorX > 15 THEN cursorX = 15 +cursorY = copyBufferHeight ' Calculate height of copied selection +IF cursorY > 15 THEN cursorY = 15 + +' Draw copy buffer rectangle +LINE (204, 99)-(319, 199), 0, BF +LINE (204, 99)-(208 + 4 * cursorX, 103 + 4 * cursorY), 14, B + +FOR bufferY = 0 TO cursorY ' Iterate over copied selection + FOR bufferX = 0 TO cursorX + cellState = copyBuffer(bufferX, bufferY) ' Get color of cell in copy buffer + IF cellState = 0 THEN cellState = 1 ELSE cellState = 10 ' Convert to display color + LINE (bufferX * 4 + 205, bufferY * 4 + 100)-(bufferX * 4 + 2 + 205, bufferY * 4 + 2 + 100), cellState, BF ' Draw cell in copy buffer + NEXT bufferX +NEXT bufferY +END SUB + +SUB SaveGridToFile +' Saves the current grid state to a file. +LOCATE 5, 27 +INPUT "file ", fileName$ +ClearScreenLine +OPEN fileName$ FOR OUTPUT AS #1 + +FOR gridY = 1 TO 50 + fileLine$ = "" ' Initialize line string + FOR gridX = 1 TO 50 + IF currentBuffer = 0 THEN cellState = gridBufferA(gridX, gridY) ELSE cellState = gridBufferB(gridX, gridY) + IF cellState = 0 THEN fileLine$ = fileLine$ + "." ELSE fileLine$ = fileLine$ + "#" ' Convert to file format + NEXT gridX + PRINT #1, fileLine$ ' Write line to file +NEXT gridY + +CLOSE #1 +END SUB diff --git a/Math/Game of life/e b/Math/Game of life/e new file mode 100644 index 0000000..1ca8715 --- /dev/null +++ b/Math/Game of life/e @@ -0,0 +1,50 @@ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................####.............####............ +.....................#...........#................ +...................####.........#................. +.......................#...#...#.................. +........................#.#.#.#................... +.................#########...#########............ +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. +.................................................. diff --git a/Math/Game of life/index.html b/Math/Game of life/index.html new file mode 100644 index 0000000..ce986cd --- /dev/null +++ b/Math/Game of life/index.html @@ -0,0 +1,12 @@ + +life + + + +

life

+
Conway's game of life. Simple editor with copy and paste +functionality and simulator. + +
+ + \ No newline at end of file diff --git a/Math/Game of life/screenshot.png b/Math/Game of life/screenshot.png new file mode 100644 index 0000000..f1ca1c7 Binary files /dev/null and b/Math/Game of life/screenshot.png differ diff --git a/Math/Lottery/Lottery analysis.bas b/Math/Lottery/Lottery analysis.bas new file mode 100755 index 0000000..59870ad --- /dev/null +++ b/Math/Lottery/Lottery analysis.bas @@ -0,0 +1,303 @@ +DECLARE SUB loadData () +DECLARE SUB predictNextDraw () +DECLARE SUB parseDrawNumbers (drawString$) +DECLARE SUB displayDotGraph () +DECLARE SUB waitForUserInput () +DECLARE SUB displayLineGraph () +DECLARE SUB displayCombinatoricsGraph () +DECLARE SUB displayMenu () +DECLARE SUB startProgram () +' Program to analyze lottery winning numbers. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' +' +' This program is designed to analyze lottery winning numbers. It +' provides various graphical representations and statistical insights +' based on historical lottery data. The program offers a simple +' menu-driven interface to visualize and analyze the data. +' +' Features: +' +' Data Loading: The program loads historical lottery data from a +' text file named "loto.txt". Each line in the file represents a +' single draw, with numbers separated by spaces. +' +' Graphical Representations: +' +' Dot Graph: Displays the lottery numbers as dots on a graph, +' with vertical lines representing each draw. +' +' Line Graph: Shows a dynamic line graph connecting +' consecutive lottery numbers, providing a visual +' representation of number trends over time. +' +' Combinatorics Graph: Graph is fitted to every possible +' resolution. If there are patterns in data, they would likely +' be visible it some resolutions. +' +' Statistical Analysis: Analyzes the last 10 draws to predict the +' most frequent numbers and identifies numbers that have appeared +' least recently. +' +' +' Input File Format: The input file loto.txt should be formatted as +' follows: +' +' Each line represents a single lottery draw. +' +' The first number on each line is the draw sequence number. +' +' The subsequent numbers are the lottery numbers drawn, separated +' by spaces. 6 numbers per draw. +' +' Example: +' +' 1 7 15 16 23 34 38 +' 2 2 15 17 25 37 40 +' 3 9 16 18 23 25 45 +' ... +' 500 4 15 16 24 30 46 +' +' +' +' Changelog: +' 2001, Initial version +' 2024 - 2025, Improved program readability + + +DEFINT A-Y + +DIM SHARED totalDraws, drawNumbers$(1 TO 50) +DIM SHARED lotteryNumbers(1 TO 500, 1 TO 7) +DIM SHARED currentDraw + +startProgram +loadData + +displayMenu + +SUB displayCombinatoricsGraph + CLS + PAINT (1, 1), 3 + DIM buffer(1 TO 48) + DIM buffer2(1 TO 20000) + + totalNumbers = 0 + + ' Prepare data for drawing + FOR drawIndex = 1 TO currentDraw + FOR number = 1 TO 48 + buffer(number) = 0 + NEXT number + + FOR numberPosition = 2 TO 7 + buffer(lotteryNumbers(drawIndex, numberPosition)) = 10 + NEXT numberPosition + + FOR number = 1 TO 48 + totalNumbers = totalNumbers + 1 + buffer2(totalNumbers) = buffer(number) + NEXT number + NEXT drawIndex + + ' Draw the graph + FOR yAxisValue = 2 TO 400 + xAxisValue = 0 + FOR xPosition = 1 TO 639 + FOR yPosition = 1 TO yAxisValue + xAxisValue = xAxisValue + 1 + IF xAxisValue > totalNumbers THEN GOTO skipDrawing + PSET (xPosition, yPosition), buffer2(xAxisValue) + NEXT yPosition + NEXT xPosition +skipDrawing: + + LINE (xPosition + 1, 1)-(xPosition + 1, yAxisValue), 14 + LINE (xPosition + 1, yPosition)-(xPosition + 4, yPosition), 12 + + IF INKEY$ <> "" THEN GOTO 1 + NEXT yAxisValue + +waitForUserInput +1 +END SUB + +SUB displayDotGraph + CLS + LINE (0, 0)-(600, 0), 1 + LINE (0, 49)-(600, 49), 1 + LINE (0, 50)-(600, 50), 1 + LINE (0, 48 * 6 + 51)-(600, 48 * 6 + 51), 1 + + ' Draw vertical lines for each draw and plot numbers + FOR drawIndex = 1 TO currentDraw + totalNumbers = 0 + FOR numberPosition = 2 TO 7 + totalNumbers = totalNumbers + lotteryNumbers(drawIndex, numberPosition) + PSET (drawIndex, lotteryNumbers(drawIndex, numberPosition)), 15 + NEXT numberPosition + LINE (drawIndex, totalNumbers + 50)-(drawIndex, 24 * 6 + 50), 10 + NEXT drawIndex + + waitForUserInput +END SUB + +SUB displayLineGraph + CLS + DIM buffer(1 TO 20000) + + ' Draw lines connecting consecutive lottery numbers + FOR x = 1 TO currentDraw - 1 + FOR numberPosition = 2 TO 7 + LINE (600, lotteryNumbers(x, numberPosition))-(610, lotteryNumbers(x + 1, numberPosition)), 3 + NEXT numberPosition + LINE (600, 1)-(600, 48), 1 + SOUND 0, 2 + + ' Scroll the screen to the left + GET (10, 1)-(610, 50), buffer(1) + PUT (1, 1), buffer(1), PSET + LINE (601, 1)-(610, 50), 0, BF + + IF INKEY$ <> "" GOTO 5 + NEXT x + + waitForUserInput +5 +END SUB + +SUB displayMenu +menuLoop: + CLS + +7 + LOCATE 1, 1 + + PRINT " Lottery statistics analysis" + + PRINT "1 - Dot graph" + PRINT "2 - Line graph" + PRINT "3 - Combinatorics" + PRINT "4 - Statistics" + PRINT "5 - Exit program" + + userInput$ = INPUT$(1) + + IF userInput$ = "1" THEN displayDotGraph + IF userInput$ = "2" THEN displayLineGraph + IF userInput$ = "3" THEN displayCombinatoricsGraph + IF userInput$ = "4" THEN predictNextDraw: GOTO 7 + IF userInput$ = "5" THEN SYSTEM + + GOTO menuLoop + +END SUB + +SUB loadData + PRINT "One moment..." + + currentDraw = 0 + OPEN "loto.txt" FOR INPUT AS #1 + +loadNextLine: + IF EOF(1) <> 0 THEN GOTO endOfFile + + LINE INPUT #1, drawString$ + parseDrawNumbers drawString$ + + currentDraw = currentDraw + 1 + + ' Parse and store lottery numbers + FOR numberPosition = 1 TO 7 + lotteryNumbers(currentDraw, numberPosition) = VAL(drawNumbers$(numberPosition)) + NEXT numberPosition + + GOTO loadNextLine + +endOfFile: + CLOSE #1 + + CLS +END SUB + +SUB parseDrawNumbers (drawString$) + totalDraws = 0 + + numberIndex = 1 + FOR charPosition = 1 TO LEN(drawString$) + currentChar$ = RIGHT$(LEFT$(drawString$, charPosition), 1) + IF currentChar$ = " " THEN + numberIndex = 1 + ELSE + IF numberIndex = 1 THEN + totalDraws = totalDraws + 1 + drawNumbers$(totalDraws) = "" + numberIndex = 0 + END IF + drawNumbers$(totalDraws) = drawNumbers$(totalDraws) + currentChar$ + END IF + NEXT charPosition + +END SUB + +SUB predictNextDraw + DIM buffer(1 TO 48) + PRINT "During the last 10 draws:" + + ' Count occurrences of each number in the last 10 draws + FOR drawIndex = currentDraw - 10 TO currentDraw + FOR numberPosition = 2 TO 7 + buffer(lotteryNumbers(drawIndex, numberPosition)) = buffer(lotteryNumbers(drawIndex, numberPosition)) + 1 + NEXT numberPosition + NEXT drawIndex + + ' Print the most frequent numbers + FOR position = 1 TO 6 + maxCount = 0 + FOR number = 1 TO 48 + IF buffer(number) > maxCount THEN + maxCount = buffer(number) + mostFrequentNumber = number + END IF + NEXT number + PRINT mostFrequentNumber; " appeared: "; maxCount; " times" + buffer(mostFrequentNumber) = 0 + NEXT position + + PRINT "--------------------------------------" + + ' Find when each number last appeared + FOR drawIndex = 1 TO currentDraw + FOR numberPosition = 2 TO 7 + buffer(lotteryNumbers(drawIndex, numberPosition)) = drawIndex + NEXT numberPosition + NEXT drawIndex + + FOR position = 1 TO 6 + minAppearances = 30000 + FOR number = 1 TO 48 + IF buffer(number) < minAppearances THEN + minAppearances = buffer(number) + leastRecentNumber = number + END IF + NEXT number + PRINT leastRecentNumber; " appeared last time: "; currentDraw - minAppearances; " draws ago" + buffer(leastRecentNumber) = 30000 + NEXT position + +END SUB + +SUB startProgram + SCREEN 12 + +END SUB + +SUB waitForUserInput + userInput$ = INPUT$(1) + +END SUB diff --git a/Math/Lottery/loto.txt b/Math/Lottery/loto.txt new file mode 100644 index 0000000..f7238f1 --- /dev/null +++ b/Math/Lottery/loto.txt @@ -0,0 +1,281 @@ +1 2 10 13 25 32 48 +2 1 3 15 27 33 40 +3 9 16 18 23 25 45 +4 2 3 15 21 27 45 +5 3 5 8 13 29 39 +6 5 11 20 22 27 41 +7 6 9 12 13 39 45 +8 3 18 21 28 37 38 +9 5 13 16 36 37 39 +10 4 15 16 24 30 46 +11 1 7 10 25 32 38 +12 2 15 17 25 37 40 +13 9 16 18 23 25 45 +14 2 3 15 21 27 45 +15 3 5 8 13 29 39 +16 5 11 20 22 27 41 +17 6 9 12 13 39 45 +18 3 18 21 28 37 38 +19 5 13 16 36 37 39 +20 4 15 16 24 30 46 +21 1 7 10 25 32 38 +22 2 15 17 25 37 40 +23 9 16 18 23 25 45 +24 2 3 15 21 27 45 +25 3 5 8 13 29 39 +26 5 11 20 22 27 41 +27 6 9 12 13 39 45 +28 3 18 21 28 37 38 +29 5 13 16 36 37 39 +30 4 15 16 24 30 46 +31 1 7 10 25 32 38 +32 2 15 17 25 37 40 +33 9 16 18 23 25 45 +34 2 3 15 21 27 45 +35 3 5 8 13 29 39 +36 5 11 20 22 27 41 +37 6 9 12 13 39 45 +38 3 18 21 28 37 38 +39 5 13 16 36 37 39 +40 4 15 16 24 30 46 +41 1 7 10 25 32 38 +42 2 15 17 25 37 40 +43 9 16 18 23 25 45 +44 2 3 15 21 27 45 +45 3 5 8 13 29 39 +46 5 11 20 22 27 41 +47 6 9 12 13 39 45 +48 3 18 21 28 37 38 +49 5 13 16 36 37 39 +50 4 15 16 24 30 46 +51 1 7 10 25 32 38 +52 2 15 17 25 37 40 +53 9 16 18 23 25 45 +54 2 3 15 21 27 45 +55 3 5 8 13 29 39 +56 5 11 20 22 27 41 +57 6 9 12 13 39 45 +58 3 18 21 28 37 38 +59 5 13 16 36 37 39 +60 4 15 16 24 30 46 +61 1 7 10 25 32 38 +62 2 15 17 25 37 40 +63 9 16 18 23 25 45 +64 2 3 15 21 27 45 +65 3 5 8 13 29 39 +66 5 11 20 22 27 41 +67 6 9 12 13 39 45 +68 3 18 21 28 37 38 +69 5 13 16 36 37 39 +70 4 15 16 24 30 46 +71 1 7 10 25 32 38 +72 2 15 17 25 37 40 +73 9 16 18 23 25 45 +74 2 3 15 21 27 45 +75 3 5 8 13 29 39 +76 5 11 20 22 27 41 +77 6 9 12 13 39 45 +78 3 18 21 28 37 38 +79 5 13 16 36 37 39 +80 4 15 16 24 30 46 +81 1 7 10 25 32 38 +82 2 15 17 25 37 40 +83 9 16 18 23 25 45 +84 2 3 15 21 27 45 +85 3 5 8 13 29 39 +86 5 11 20 22 27 41 +87 6 9 12 13 39 45 +88 3 18 21 28 37 38 +89 5 13 16 36 37 39 +90 4 15 16 24 30 46 +91 1 7 10 25 32 38 +92 2 15 17 25 37 40 +93 9 16 18 23 25 45 +94 2 3 15 21 27 45 +95 3 5 8 13 29 39 +96 5 11 20 22 27 41 +97 6 9 12 13 39 45 +98 3 18 21 28 37 38 +99 5 13 16 36 37 39 +100 4 15 16 24 30 46 +101 1 7 10 25 32 38 +102 2 15 17 25 37 40 +103 9 16 18 23 25 45 +104 2 3 15 21 27 45 +105 3 5 8 13 29 39 +106 5 11 20 22 27 41 +107 6 9 12 13 39 45 +108 3 18 21 28 37 38 +109 5 13 16 36 37 39 +110 4 15 16 24 30 46 +111 1 7 10 25 32 38 +112 2 15 17 25 37 40 +113 9 16 18 23 25 45 +114 2 3 15 21 27 45 +115 3 5 8 13 29 39 +116 5 11 20 22 27 41 +117 6 9 12 13 39 45 +118 3 18 21 28 37 38 +119 5 13 16 36 37 39 +120 4 15 16 24 30 46 +121 1 7 10 25 32 38 +122 2 15 17 25 37 40 +123 9 16 18 23 25 45 +124 2 3 15 21 27 45 +125 3 5 8 13 29 39 +126 5 11 20 22 27 41 +127 6 9 12 13 39 45 +128 3 18 21 28 37 38 +129 5 13 16 36 37 39 +130 4 15 16 24 30 46 +131 1 7 10 25 32 38 +132 2 15 17 25 37 40 +133 9 16 18 23 25 45 +134 2 3 15 21 27 45 +135 3 5 8 13 29 39 +136 5 11 20 22 27 41 +137 6 9 12 13 39 45 +138 3 18 21 28 37 38 +139 5 13 16 36 37 39 +140 4 15 16 24 30 46 +141 1 7 10 25 32 38 +142 2 15 17 25 37 40 +143 9 16 18 23 25 45 +144 2 3 15 21 27 45 +145 3 5 8 13 29 39 +146 5 11 20 22 27 41 +147 6 9 12 13 39 45 +148 3 18 21 28 37 38 +149 5 13 16 36 37 39 +150 4 15 16 24 30 46 +151 1 7 10 25 32 38 +152 2 15 17 25 37 40 +153 9 16 18 23 25 45 +154 2 3 15 21 27 45 +155 3 5 8 13 29 39 +156 5 11 20 22 27 41 +157 6 9 12 13 39 45 +158 3 18 21 28 37 38 +159 5 13 16 36 37 39 +160 4 15 16 24 30 46 +161 1 7 10 25 32 38 +162 2 15 17 25 37 40 +163 9 16 18 23 25 45 +164 2 3 15 21 27 45 +165 3 5 8 13 29 39 +166 5 11 20 22 27 41 +167 6 9 12 13 39 45 +168 3 18 21 28 37 38 +169 5 13 16 36 37 39 +170 4 15 16 24 30 46 +171 1 7 10 25 32 38 +172 2 15 17 25 37 40 +173 9 16 18 23 25 45 +174 2 3 15 21 27 45 +175 3 5 8 13 29 39 +176 5 11 20 22 27 41 +177 6 9 12 13 39 45 +178 3 18 21 28 37 38 +179 5 13 16 36 37 39 +180 4 15 16 24 30 46 +181 1 7 10 25 32 38 +182 2 15 17 25 37 40 +183 9 16 18 23 25 45 +184 2 3 15 21 27 45 +185 3 5 8 13 29 39 +186 5 11 20 22 27 41 +187 6 9 12 13 39 45 +188 3 18 21 28 37 38 +189 5 13 16 36 37 39 +190 4 15 16 24 30 46 +191 1 7 10 25 32 38 +192 2 15 17 25 37 40 +193 9 16 18 23 25 45 +194 2 3 15 21 27 45 +195 3 5 8 13 29 39 +196 5 11 20 22 27 41 +197 6 9 12 13 39 45 +198 3 18 21 28 37 38 +199 5 13 16 36 37 39 +200 4 15 16 24 30 46 +201 1 7 10 25 32 38 +202 2 15 17 25 37 40 +203 9 16 18 23 25 45 +204 2 3 15 21 27 45 +205 3 5 8 13 29 39 +206 5 11 20 22 27 41 +207 6 9 12 13 39 45 +208 3 18 21 28 37 38 +209 5 13 16 36 37 39 +210 4 15 16 24 30 46 +211 1 7 10 25 32 38 +212 2 15 17 25 37 40 +213 9 16 18 23 25 45 +214 2 3 15 21 27 45 +215 3 5 8 13 29 39 +216 5 11 20 22 27 41 +217 6 9 12 13 39 45 +218 3 18 21 28 37 38 +219 5 13 16 36 37 39 +220 4 15 16 24 30 46 +221 1 7 10 25 32 38 +222 2 15 17 25 37 40 +223 9 16 18 23 25 45 +224 2 3 15 21 27 45 +225 3 5 8 13 29 39 +226 5 11 20 22 27 41 +227 6 9 12 13 39 45 +228 3 18 21 28 37 38 +229 5 13 16 36 37 39 +230 4 15 16 24 30 46 +231 1 7 10 25 32 38 +232 2 15 17 25 37 40 +233 9 16 18 23 25 45 +234 2 3 15 21 27 45 +235 3 5 8 13 29 39 +236 5 11 20 22 27 41 +237 6 9 12 13 39 45 +238 3 18 21 28 37 38 +239 5 13 16 36 37 39 +240 4 15 16 24 30 46 +241 1 7 10 25 32 38 +242 2 15 17 25 37 40 +243 9 16 18 23 25 45 +244 2 3 15 21 27 45 +245 3 5 8 13 29 39 +246 5 11 20 22 27 41 +247 6 9 12 13 39 45 +248 3 18 21 28 37 38 +249 5 13 16 36 37 39 +250 4 15 16 24 30 46 +251 1 7 10 25 32 38 +252 2 15 17 25 37 40 +253 9 16 18 23 25 45 +254 2 3 15 21 27 45 +255 3 5 8 13 29 39 +256 5 11 20 22 27 41 +257 6 9 12 13 39 45 +258 3 18 21 28 37 38 +259 5 13 16 36 37 39 +260 4 15 16 24 30 46 +261 1 7 10 25 32 38 +262 2 15 17 25 37 40 +263 9 16 18 23 25 45 +264 2 3 15 21 27 45 +265 3 5 8 13 29 39 +266 5 11 20 22 27 41 +267 6 9 12 13 39 45 +268 3 18 21 28 37 38 +269 5 13 16 36 37 39 +270 4 15 16 24 30 46 +271 1 7 10 25 32 38 +272 2 15 17 25 37 40 +273 9 16 18 23 25 45 +274 2 3 15 21 27 45 +275 3 5 8 13 29 39 +276 5 11 20 22 27 41 +277 6 9 12 13 39 45 +278 3 18 21 28 37 38 +279 5 13 16 36 37 39 +280 4 15 16 24 30 46 +281 1 7 10 25 32 38 diff --git a/Math/Lottery/screenshot, 1.png b/Math/Lottery/screenshot, 1.png new file mode 100644 index 0000000..5595096 Binary files /dev/null and b/Math/Lottery/screenshot, 1.png differ diff --git a/Math/Lottery/screenshot, 2.png b/Math/Lottery/screenshot, 2.png new file mode 100644 index 0000000..dcf804b Binary files /dev/null and b/Math/Lottery/screenshot, 2.png differ diff --git a/Math/Lottery/screenshot, 3.png b/Math/Lottery/screenshot, 3.png new file mode 100644 index 0000000..24f796e Binary files /dev/null and b/Math/Lottery/screenshot, 3.png differ diff --git a/Math/Multiplication trainer.bas b/Math/Multiplication trainer.bas new file mode 100644 index 0000000..1be28bf --- /dev/null +++ b/Math/Multiplication trainer.bas @@ -0,0 +1,188 @@ +' Program to teach and test multiplication. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2000, Initial version +' 2024, Improved program readability + +DECLARE SUB showGreetingAndSetup () +DEFINT A-Y +DECLARE SUB getUserInputAndDisplayQuestions () +DIM SHARED userName$ +DIM SHARED numberOfQuestions + +showGreetingAndSetup +getUserInputAndDisplayQuestions + +SUB getUserInputAndDisplayQuestions +RANDOMIZE TIMER + +numberOfAttempts = 0 +incorrectAnswers = 0 +correctAnswers = 0 +PRINT "How much is:" +4 +numberOfAttempts = numberOfAttempts + 1 +IF numberOfAttempts > numberOfQuestions THEN GOTO 6 + +' Generate random numbers for multiplication +multiplier1 = RND * 9 +multiplier2 = RND * 9 +question$ = STR$(multiplier1) + " X" + STR$(multiplier2) +PRINT " " +PRINT question$ + +5 +INPUT userAnswer$ + +' Handle invalid inputs +IF LEFT$(userAnswer$, 6) = "don't know" THEN + PRINT "Try at least !" + GOTO 5 +END IF + +' Convert input to number +IF userAnswer$ = "0" THEN + userAnswer = 0 + GOTO 10 +ELSE + userAnswer = VAL(userAnswer$) + IF userAnswer = 0 THEN userAnswer = -1 +END IF + +10 + +' Check if the answer is correct +IF multiplier1 * multiplier2 = userAnswer THEN + correctAnswers = correctAnswers + 1 + PRINT "Correct !" +ELSE + PRINT "Wrong !" + PRINT "Correct answer is ", multiplier1 * multiplier2 + incorrectAnswers = incorrectAnswers + 1 +END IF + +GOTO 4 + +6 +PRINT "-------------------------" +COLOR 2 +PRINT "Incorrect answers: ", incorrectAnswers + +' Calculate the score +scorePercentage = correctAnswers / numberOfQuestions * 100 + +grade = 1 + +' Determine the grade +IF scorePercentage >= 25 THEN grade = 2 +IF scorePercentage >= 50 THEN grade = 3 +IF scorePercentage >= 70 THEN grade = 4 +IF scorePercentage >= 90 THEN grade = 5 + +COLOR 14 +PRINT "Your grade is: "; grade +END SUB + +DEFINT Z +SUB showGreetingAndSetup + +' Clear the screen and set up graphics mode +CLS +SCREEN 13 +LOCATE 2, 1 +PRINT " Math teaching program" + +' Draw a simple background pattern +FOR y = 3 TO 20 + FOR x = 0 TO 320 + IF POINT(x, y) > 0 THEN + colorIndex = y + 56 + ELSE + colorIndex = 31 - y / 2 + END IF + PSET (x, y), colorIndex + NEXT x +NEXT y + +' Get user input for their name +LOCATE 5, 1 +COLOR 7 +INPUT "Enter your name ", userName$ +LOCATE 5, 1 +COLOR 8 +PRINT "Enter your name " + userName$ + +' Greet the user +LOCATE 6, 1 +COLOR 7 +PRINT "Hello " + userName$ + "!" + +8 +LOCATE 7, 1 +COLOR 8 +PRINT SPACE$(35) +COLOR 7 +LOCATE 7, 1 +INPUT "How many questions would you like ? ", numberOfQuestions +LOCATE 7, 1 +COLOR 8 +PRINT SPACE$(35) +LOCATE 7, 1 +COLOR 8 +PRINT "How many questions would you like? " + STR$(numberOfQuestions) + +' Validate the number of questions +IF numberOfQuestions < 5 THEN + PRINT "That would be too easy !" + GOTO 8 +END IF + +IF numberOfQuestions > 30 THEN + PRINT "That would be too hard !" + GOTO 8 +END IF + +PRINT "I will ask you some math questions." +PRINT "Press any button when you are ready..." + +' Initialize color palette +FOR a = 200 TO 230 + OUT &H3C8, a + OUT &H3C9, a - 200 + OUT &H3C9, 0 + OUT &H3C9, 0 +NEXT + +' Initialize color array +DIM colorArray(1 TO 32) + +currentColorIndex = 4 +colorChangeDirection = 1 + +2 +FOR a = 0 TO 31 + ' Draw vertical lines with decreasing brightness + LINE (a * 10, 170)-(a * 10 + 10, 190), 200 + colorArray(a + 1), BF + colorArray(a + 1) = colorArray(a + 1) - 1 + IF colorArray(a + 1) < 0 THEN colorArray(a + 1) = 0 +NEXT a + +' Change the color index +currentColorIndex = currentColorIndex + colorChangeDirection +IF currentColorIndex > 30 OR currentColorIndex < 3 THEN colorChangeDirection = -colorChangeDirection +colorArray(currentColorIndex) = 30 +SOUND 0, 1 + +' Check if user is ready +IF INKEY$ <> "" THEN GOTO 3 +GOTO 2 + +3 +CLS +END SUB + diff --git a/Math/Multiplication trainer.png b/Math/Multiplication trainer.png new file mode 100644 index 0000000..7ea027a Binary files /dev/null and b/Math/Multiplication trainer.png differ diff --git a/Math/Plotting/2D graph plot.bas b/Math/Plotting/2D graph plot.bas new file mode 100755 index 0000000..cc6d4ff --- /dev/null +++ b/Math/Plotting/2D graph plot.bas @@ -0,0 +1,85 @@ +' 2D Graph Plotter. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Created initial version +' 2024.08, Updated for better readability and maintainability + + +DECLARE SUB InitializeGraphicsEnvironment () +DECLARE SUB PlotPoint (x1 AS SINGLE, y1 AS SINGLE, x2 AS SINGLE, y2 AS SINGLE, colorCode AS INTEGER) + +' Scaling factor for the graph +DIM SHARED scaleFactor AS INTEGER +scaleFactor = 100 + +' Initialize the graphics environment +InitializeGraphicsEnvironment + +' Set the origin of the graph +DIM originX AS SINGLE +DIM originY AS SINGLE +originX = -320 / scaleFactor +originY = 0 + +' Loop to plot each point on the graph based on the formula +DIM currentX AS SINGLE +DIM currentY AS SINGLE +FOR currentX = -320 / scaleFactor TO 320 / scaleFactor STEP 1 / scaleFactor + ' Function to calculate y-value based on x-value + currentY = 1 - (COS(currentX * 2)) + (SIN(currentX * 2)) ' User-defined formula + + ' Plot the point and update the origin for the next segment + PlotPoint currentX, currentY, originX, originY, 14 + originX = currentX + originY = currentY +NEXT currentX + +' Subroutine to initialize the graphics window and grid +SUB InitializeGraphicsEnvironment + SCREEN 12 + + ' Draw horizontal grid lines + DIM horizontalGridStep AS SINGLE + FOR horizontalGridStep = -320 TO 320 + IF horizontalGridStep / scaleFactor = horizontalGridStep \ scaleFactor THEN + LINE (horizontalGridStep + 320, 0)-(horizontalGridStep + 320, 479), 1 + END IF + NEXT horizontalGridStep + + ' Draw vertical grid lines + DIM verticalGridStep AS SINGLE + FOR verticalGridStep = -240 TO 240 + IF verticalGridStep / scaleFactor = verticalGridStep \ scaleFactor THEN + LINE (0, verticalGridStep + 240)-(639, verticalGridStep + 240), 1 + END IF + NEXT verticalGridStep + + ' Draw the central axis lines + LINE (0, 240)-(639, 240), 3 + LINE (320, 0)-(320, 479), 3 +END SUB + +' Subroutine to plot a point on the graph +SUB PlotPoint (x AS SINGLE, y AS SINGLE, x1 AS SINGLE, y1 AS SINGLE, colorCode AS INTEGER) + ' Convert graph coordinates to screen pixel coordinates + DIM screenX1 AS INTEGER + DIM screenY1 AS INTEGER + DIM screenX2 AS INTEGER + DIM screenY2 AS INTEGER + + screenX1 = (x * scaleFactor) + 320 + screenY1 = 240 - (y * scaleFactor) + screenX2 = (x1 * scaleFactor) + 320 + screenY2 = 240 - (y1 * scaleFactor) + + ' Check if the point is within the screen boundaries before plotting + IF screenX1 >= 0 AND screenY1 >= 0 AND screenX1 <= 639 AND screenY1 <= 479 AND screenX2 >= 0 AND screenY2 >= 0 AND screenX2 <= 639 AND screenY2 <= 479 THEN + LINE (screenX1, screenY1)-(screenX2, screenY2), colorCode + END IF +END SUB + diff --git a/Math/Plotting/2D graph plot.png b/Math/Plotting/2D graph plot.png new file mode 100644 index 0000000..ad022d9 Binary files /dev/null and b/Math/Plotting/2D graph plot.png differ diff --git a/Math/Plotting/3D graph.bas b/Math/Plotting/3D graph.bas new file mode 100644 index 0000000..105d4a4 --- /dev/null +++ b/Math/Plotting/3D graph.bas @@ -0,0 +1,427 @@ +DECLARE SUB formula (x!, y!, z!) +DECLARE SUB graaf () +DECLARE SUB mkgr3 (x1!, y1!, z1!) +DECLARE SUB mkgr2 (x1!, y1!, z1!) +DECLARE SUB mkgr (x1!, y1!, z1!) +DECLARE SUB start () +DECLARE SUB getcor () +DECLARE SUB nait3d () +' 3D heightmap explorer. Allows to visualize heightmap for arbitrary function. +' Inspect and edit function "formula" to visualize alternative mathematical functions. + +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2002, Initial version +' 2024.09, Improved program readability + +' Keyboard controls: +' Cursor keys - move around +' - - fly up +' + - fly down +' ESC - exit program + +' Type your formula to sub module "formula". +' X & Y are surface coordinates. Z must be formula +' result, indicating height. "tm" variable counts +' frames. Use it in your formula to make graph moving in time. + +DIM SHARED vertexX(4000), vertexY(4000), vertexZ(4000) +DIM SHARED x(4000), y(4000), z(4000) + +DIM SHARED xo(4000), yo(4000), zo(4000) +DIM SHARED linePoint1(4000), linePoint2(4000) +DIM SHARED lineColor(4000) +DIM SHARED vertexCount, lineCount +DIM SHARED tmvertexCount, tmlineCount, tm +DIM SHARED myx, myy, myz, mye, myk + +myx = 520 +myy = -250 +myz = -1000 +tm = 0 + +ON ERROR GOTO 3 +start + +nait3d + +3 +PRINT "Kuskil programmis l�ks mingi arv �le lubatud piiride!!!" +RESUME + +' This subroutine initializes the coordinate system and sets up the grid. +SUB getcor + c = 12 + + ' Create background 2D grids along every axis in 3D space + ' to help viewer perceive scale. + mkgr -500, 0, 0 + mkgr2 0, 0, 500 + mkgr3 0, -500, 0 + + ' Place center-crossing pink lines across every axis (3D cross). + ' This is to help viewer to see where zero point on the graph is. + + ' Add vertices for the 3D cross. + vertexX(vertexCount + 1) = 0 + vertexY(vertexCount + 1) = -500 + vertexZ(vertexCount + 1) = 0 + + vertexX(vertexCount + 2) = 0 + vertexY(vertexCount + 2) = 500 + vertexZ(vertexCount + 2) = 0 + + vertexX(vertexCount + 3) = -500 + vertexY(vertexCount + 3) = 0 + vertexZ(vertexCount + 3) = 0 + + vertexX(vertexCount + 4) = 500 + vertexY(vertexCount + 4) = 0 + vertexZ(vertexCount + 4) = 0 + + vertexX(vertexCount + 5) = 0 + vertexY(vertexCount + 5) = 0 + vertexZ(vertexCount + 5) = -500 + + vertexX(vertexCount + 6) = 0 + vertexY(vertexCount + 6) = 0 + vertexZ(vertexCount + 6) = 500 + + ' Add lines for the 3D cross. + linePoint1(lineCount + 1) = vertexCount + 1 + linePoint2(lineCount + 1) = vertexCount + 2 + lineColor(lineCount + 1) = c + + linePoint1(lineCount + 2) = vertexCount + 3 + linePoint2(lineCount + 2) = vertexCount + 4 + lineColor(lineCount + 2) = c + + linePoint1(lineCount + 3) = vertexCount + 5 + linePoint2(lineCount + 3) = vertexCount + 6 + lineColor(lineCount + 3) = c + + ' Update the vertex and line counts + vertexCount = vertexCount + 6 + lineCount = lineCount + 3 + tmvertexCount = vertexCount + tmlineCount = lineCount +END SUB + +' This subroutine generates a grid of points based on the formula +SUB graaf + c = 14 + + d = 0 + e = 0 + FOR x = -500 TO 500 STEP 50 + FOR z = -500 TO 500 STEP 50 + + ' Increment the vertex count and add a new vertex + d = d + 1 + vertexX(vertexCount + d) = x + formula x / 50, z / 50, y ' evaluate formula that we want to visualize + vertexY(vertexCount + d) = y * 50 + vertexZ(vertexCount + d) = z + + ' Connect current point on the grid with neighbors + IF z > -500 THEN + e = e + 1 + linePoint1(lineCount + e) = vertexCount + d + linePoint2(lineCount + e) = vertexCount + d - 1 + lineColor(lineCount + e) = c + END IF + + IF x > -500 THEN + e = e + 1 + linePoint1(lineCount + e) = vertexCount + d + linePoint2(lineCount + e) = vertexCount + d - 21 + lineColor(lineCount + e) = c + END IF + + NEXT z + NEXT x + + ' Update the vertex and line counts + vertexCount = vertexCount + d + lineCount = lineCount + e +END SUB + +' This subroutine generates a measuring grid in the ZY plane. +SUB mkgr (x1, y1, z1) + c = 3 + + d = 0 + e = 0 + FOR z = -500 TO 500 STEP 100 + FOR y = -500 TO 500 STEP 100 + + ' Increment the vertex count and add a new vertex + d = d + 1 + vertexX(vertexCount + d) = x1 + vertexY(vertexCount + d) = y1 + y + vertexZ(vertexCount + d) = z1 + z + + ' Add lines to the line array if necessary + IF y > -500 THEN + e = e + 1 + linePoint1(lineCount + e) = vertexCount + d + linePoint2(lineCount + e) = vertexCount + d - 1 + lineColor(lineCount + e) = c + END IF + + IF z > -500 THEN + e = e + 1 + linePoint1(lineCount + e) = vertexCount + d + linePoint2(lineCount + e) = vertexCount + d - 11 + lineColor(lineCount + e) = c + END IF + + NEXT y + NEXT z + + ' Update the vertex and line counts + vertexCount = vertexCount + d + lineCount = lineCount + e +END SUB + +' This subroutine generates a measuring grid XY plane. +SUB mkgr2 (x1, y1, z1) + c = 3 + + d = 0 + e = 0 + FOR x = -500 TO 500 STEP 100 + FOR y = -500 TO 500 STEP 100 + + ' Increment the vertex count and add a new vertex + d = d + 1 + vertexX(vertexCount + d) = x1 + x + vertexY(vertexCount + d) = y1 + y + vertexZ(vertexCount + d) = z1 + + ' Add lines to the line array if necessary + IF y > -500 THEN + e = e + 1 + linePoint1(lineCount + e) = vertexCount + d + linePoint2(lineCount + e) = vertexCount + d - 1 + lineColor(lineCount + e) = c + END IF + + IF x > -500 THEN + e = e + 1 + linePoint1(lineCount + e) = vertexCount + d + linePoint2(lineCount + e) = vertexCount + d - 11 + lineColor(lineCount + e) = c + END IF + + NEXT y + NEXT x + + ' Update the vertex and line counts + vertexCount = vertexCount + d + lineCount = lineCount + e +END SUB + +' This subroutine generates a measuring grid in the XZ plane. +SUB mkgr3 (x1, y1, z1) + c = 3 + + d = 0 + e = 0 + FOR x = -500 TO 500 STEP 100 + FOR z = -500 TO 500 STEP 100 + + ' Increment the vertex count and add a new vertex + d = d + 1 + vertexX(vertexCount + d) = x1 + x + vertexY(vertexCount + d) = y1 + vertexZ(vertexCount + d) = z + + ' Add lines to the line array if necessary + IF z > -500 THEN + e = e + 1 + linePoint1(lineCount + e) = vertexCount + d + linePoint2(lineCount + e) = vertexCount + d - 1 + lineColor(lineCount + e) = c + END IF + + IF x > -500 THEN + e = e + 1 + linePoint1(lineCount + e) = vertexCount + d + linePoint2(lineCount + e) = vertexCount + d - 11 + lineColor(lineCount + e) = c + END IF + + NEXT z + NEXT x + + ' Update the vertex and line counts + vertexCount = vertexCount + d + lineCount = lineCount + e +END SUB + +' This subroutine renders the 3D scene. +SUB nait3d + +1 +vertexCount = tmvertexCount +lineCount = tmlineCount +tm = tm + 1 +graaf + +myx = myx + SIN(deg1) * mye +myz = myz + COS(deg1) * mye + +myx = myx + COS(deg1) * myk +myz = myz - SIN(deg1) * myk + +myy = myy + myyp + +deg1 = deg1 + d1 +Deg2 = Deg2 + d2 + +C1 = COS(deg1): S1 = SIN(deg1) +C2 = COS(Deg2): S2 = SIN(Deg2) + +' Transform the vertices to 3D space +FOR a = 1 TO vertexCount + + xo = vertexX(a) - myx + yo = -vertexY(a) - myy + zo = vertexZ(a) - myz + + ' Apply rotation transformations + x1 = (xo * C1 - zo * S1) + z1 = (xo * S1 + zo * C1) + + y1 = (yo * C2 - z1 * S2) + z2 = (yo * S2 + z1 * C2) + + ' Project the vertices onto the 2D screen + xo(a) = x(a) + yo(a) = y(a) + + IF z2 < 20 THEN + x(a) = -1 + ELSE + x(a) = 320 + (x1 / z2 * 500) + y(a) = 240 + (y1 / z2 * 500) + END IF +NEXT + +' Draw the lines on the screen +FOR a = 1 TO lineCount + p1 = linePoint1(a) + p2 = linePoint2(a) + + ' Skip drawing if either point is off-screen + IF xo(p1) = -1 OR xo(p2) = -1 THEN + ' Do nothing + ELSE + ' erase line at previous position + LINE (xo(p1), yo(p1))-(xo(p2), yo(p2)), 0 + ' draw line at new position + LINE (x(p1), y(p1))-(x(p2), y(p2)), lineColor(a) + END IF + +NEXT + +' Handle keyboard input +K$ = INKEY$ +IF K$ <> "" THEN + + SELECT CASE K$ + + CASE CHR$(0) + "P" + mye = mye - 3 + + CASE CHR$(0) + "H" + mye = mye + 3 + + CASE CHR$(0) + "M" + myk = myk + 3 + + CASE CHR$(0) + "K" + myk = myk - 3 + + CASE "+" + myyp = myyp + 5 + + CASE "-" + myyp = myyp - 5 + + CASE "6" + d1 = d1 + .01 + + CASE "4" + d1 = d1 - .01 + + CASE "8" + d2 = d2 - .01 + + CASE "2" + d2 = d2 + .01 + + CASE " " + d1 = d1 / 2 + d2 = d2 / 2 + d3 = d3 / 2 + mye = mye / 2 + myk = myk / 2 + myyp = myyp / 2 + + CASE "q" + SYSTEM + + CASE CHR$(27) + SYSTEM + + END SELECT +END IF + +GOTO 1 +END SUB + +' This subroutine initializes the graphics and sets up the program. +SUB start +SCREEN 12 +CLS + +FOR a = 1 TO 4000 + lineColor(a) = 15 +NEXT a + +vertexCount = 0 +lineCount = 0 + +getcor + +END SUB + +' This subroutine calculates the height of a point based on the formula +SUB formula (x, y, z) +z = 0 +v = SQR(x * x + y * y) ' v = distance from center, some formulas need it. + +' Apply the formula to calculate the height +z = z + SIN(x + y) * SIN(tm / 10) ' diagonal lines +z = z + (SQR((15 + v) * (15 - v)) - 10) ' top of the ball + +' As you see, multiple formulas can be enabled simultaneously. +' Few more example formulas that you can uncomment and enable. +' z = z + RND * 1 ' noise +' z = z + SIN((y + tm) / 2) ' forward moving wave +' z = z + SIN(v / 2) * 2 ' circular waves +' z = z - SQR(v * 6) ' sharp peak +' z = z + SIN(y / 1.5) / 1.5 + COS(x / 1.5) / 1.5' custom 1 +' z = z + SIN(y / 1.5) * COS(x / 1.5) / 1.5 ' custom 2 +' z = z + INT(SIN(1.5 * x * SIN(tm / 10))) * 3 ' custom 3 +' z = z - INT(v / 5) * 3 + 3 ' custom 4 +' z = z + 3 * ((-INT((x - .3) / 20) * INT((23 + x - ABS(y * 1.2)) / 15)) + -INT(-y / 20) * -INT(-x / 20) * INT(-((x - 2) * (x - 2) + (y * 1.2 - 4) * (y * 1.2 - 4)) / 2000 + 1.01) + -INT(y / 20) * -INT(-x / 20) * INT(-((x - 2) * (x - 2) + (y * 1.2 + 4) * (y * 1.2 + 4)) / 2000 + 1.01)) ' heart + +END SUB + diff --git a/Math/Plotting/3D graph.png b/Math/Plotting/3D graph.png new file mode 100644 index 0000000..a25dbb6 Binary files /dev/null and b/Math/Plotting/3D graph.png differ diff --git a/Math/Plotting/Deriviative calculator.bas b/Math/Plotting/Deriviative calculator.bas new file mode 100755 index 0000000..37b96e6 --- /dev/null +++ b/Math/Plotting/Deriviative calculator.bas @@ -0,0 +1,87 @@ +' Program that computes and plots arbitrary mathematical function on a 2D graph. +' Also it computes and plots the derivative of the function. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 200?, Initial version +' 2024.09, Improved program readability + + +DECLARE SUB Initialize () +DECLARE SUB PlotPoint (x, y, x1, y1, c!) +DIM SHARED scaleFactor + +scaleFactor = 50 ' Scale factor for the graph +Initialize + +oldX = -320 / scaleFactor +oldY = 0 + +FOR x = -320 / scaleFactor TO 320 / scaleFactor STEP 1 / scaleFactor + + ' Calculate the function value (replace with your desired formula) + t = x ^ 3 - (3 * x) + + PlotPoint x, t, oldX, prevY, 10 + y = (t - prevY) * scaleFactor + prevY = t + + PlotPoint x, y, oldX, oldY, 14 + oldX = x + oldY = y +NEXT x + +SUB Initialize + SCREEN 12 + + ' Draw vertical grid lines + FOR x = -320 TO 320 + IF x / scaleFactor = x \ scaleFactor THEN LINE (x + 320, 0)-(x + 320, 479), 1 + NEXT x + + ' Draw horizontal grid lines + FOR y = -240 TO 240 + IF y / scaleFactor = y \ scaleFactor THEN LINE (0, y + 240)-(639, y + 240), 1 + NEXT y + + ' Draw thicker vertical grid lines for every 5th unit + FOR x = -320 TO 320 + IF x / (scaleFactor * 5) = x \ (scaleFactor * 5) THEN LINE (x + 320, 0)-(x + 320, 479), 4 + NEXT x + + ' Draw thicker horizontal grid lines for every 5th unit + FOR y = -240 TO 240 + IF y / (scaleFactor * 5) = y \ (scaleFactor * 5) THEN LINE (0, y + 240)-(639, y + 240), 4 + NEXT y + + ' Draw x-axis and y-axis + LINE (0, 240)-(639, 240), 3 + LINE (320, 0)-(320, 479), 3 +END SUB + +SUB PlotPoint (x, y, x1, y1, c) + + x2 = (x * scaleFactor) + 320 + y2 = 240 - (y * scaleFactor) + x3 = (x1 * scaleFactor) + 320 + y3 = 240 - (y1 * scaleFactor) + + ' Check if the points are within the screen boundaries + IF x2 < 0 THEN GOTO Skip + IF y2 < 0 THEN GOTO Skip + IF x2 > 639 THEN GOTO Skip + IF y2 > 479 THEN GOTO Skip + IF x3 < 0 THEN GOTO Skip + IF y3 < 0 THEN GOTO Skip + IF x3 > 639 THEN GOTO Skip + IF y3 > 479 THEN GOTO Skip + + ' Draw a line between the two points with the specified color + LINE (x2, y2)-(x3, y3), c + +Skip: +END SUB diff --git a/Math/Plotting/Deriviative calculator.png b/Math/Plotting/Deriviative calculator.png new file mode 100644 index 0000000..5c49948 Binary files /dev/null and b/Math/Plotting/Deriviative calculator.png differ diff --git a/Math/Plotting/Sine and cosine table.bas b/Math/Plotting/Sine and cosine table.bas new file mode 100755 index 0000000..c4202c7 --- /dev/null +++ b/Math/Plotting/Sine and cosine table.bas @@ -0,0 +1,106 @@ +' SIN & COS table generator +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version. +' 2024.08, Updated code readability. + + +' Screen dimensions and video mode settings +screenWidth = 640 +screenHeight = 480 +videoMode = 12 ' Video mode switch (0 for text mode, non-zero for graphics mode) +stringSize = 0 ' String size for text mode + +' Adjust screen dimensions for a more accurate representation +screenWidth = screenWidth / 11.3 +screenHeight = screenHeight / 11.7 + +' Determine string size based on video mode +IF stringSize = 0 THEN + SELECT CASE videoMode + CASE 12, 11 + stringSize = 16 + + CASE 9, 10 + stringSize = 14 + + CASE 1, 13, 2, 7, 8 + stringSize = 8 + END SELECT +ELSE + GOTO InitializeScreen +END IF + +InitializeScreen: +SCREEN videoMode + +' Draw grid and label axes +FOR gridLine = 1 TO 10 + ' Draw horizontal grid lines + LINE (0, gridLine * screenHeight)-(screenWidth * 10, gridLine * screenHeight), 8 + + ' Draw vertical grid lines + LINE (gridLine * screenWidth, 0)-(gridLine * screenWidth, screenHeight * 10), 8 + + ' Label horizontal axis with numbers + textRow = 10 * screenHeight / stringSize + 2 + textCol = gridLine * screenWidth / 8 + 1 + LOCATE textRow, textCol + PRINT CHR$(gridLine + 48); +NEXT gridLine + +' Label the end of the horizontal axis +LOCATE 10 * screenHeight / stringSize + 2, screenWidth * 10 / 8 +PRINT "10"; + +' Label special points on the vertical axis +LOCATE 1 * screenHeight / stringSize + 1, screenWidth * 10 / 8 + 3 +PRINT "-1"; +LOCATE 5 * screenHeight / stringSize + 1, screenWidth * 10 / 8 + 3 +PRINT "0"; +LOCATE 10 * screenHeight / stringSize, screenWidth * 10 / 8 + 3 +PRINT "1"; + +' Draw central horizontal and vertical lines +LINE (0, screenHeight * 5 + 1)-(screenWidth * 10, screenHeight * 5 + 1), 14 +LINE (5 * screenWidth + 1, 0)-(5 * screenWidth + 1, 10 * screenHeight), 14 + +' Plot SIN function +FOR angle = 0 TO 10 STEP .05 + xPosition = angle * screenWidth + yPosition = SIN(angle) * screenHeight * 5 + screenHeight * 5 + IF angle > 0 THEN LINE (xPositionPrev, yPositionPrev)-(xPosition, yPosition), 15 + xPositionPrev = xPosition + yPositionPrev = yPosition +NEXT angle + +' Label the SIN curve +textRow = yPosition / stringSize + 1 +textCol = screenWidth * 10 / 8 +LOCATE textRow, textCol +PRINT "sin"; + +' Plot COS function +FOR angle = 0 TO 10 STEP .05 + xPosition = angle * screenWidth + yPosition = COS(angle) * screenHeight * 5 + screenHeight * 5 + IF angle > 0 THEN LINE (xPositionPrev, yPositionPrev)-(xPosition, yPosition), 12 + xPositionPrev = xPosition + yPositionPrev = yPosition +NEXT angle + +' Label the COS curve +textRow = yPosition / stringSize + 1 +textCol = screenWidth * 10 / 8 +LOCATE textRow, textCol +PRINT "cos"; + +' Wait for user input before exiting +a$ = INPUT$(1) +SYSTEM + diff --git a/Math/Plotting/Sine and cosine table.png b/Math/Plotting/Sine and cosine table.png new file mode 100644 index 0000000..e717cfa Binary files /dev/null and b/Math/Plotting/Sine and cosine table.png differ diff --git a/Math/Simulation/Explosion/Explosion simulator.bas b/Math/Simulation/Explosion/Explosion simulator.bas new file mode 100755 index 0000000..73fe672 --- /dev/null +++ b/Math/Simulation/Explosion/Explosion simulator.bas @@ -0,0 +1,240 @@ +' Program to simulate shock waves propagation in gas. +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003, Initial version +' 2024 - 2025, Improved program readability + +DECLARE SUB SetLocalPressure(xCoord!, yCoord!, pressureValue!) +DECLARE SUB DrawBoundaryLine(startX!, startY!, endX!, endY!) +DIM SHARED wallBoundary +wallBoundary = 9980 ' Special value indicating solid wall boundaries + +' Shared arrays for fluid simulation: +DIM SHARED pressureGrid(1 TO 100, 1 TO 100) ' Stores pressure values at each grid point +DIM SHARED horizontalVelocity(1 TO 100, 1 TO 100) ' Stores horizontal velocity components +DIM SHARED verticalVelocity(1 TO 100, 1 TO 100) ' Stores vertical velocity components +DIM SHARED horizontalPressureChange(1 TO 100, 1 TO 100) ' Stores x-direction pressure change at each grid point +DIM SHARED verticalPressureChange(1 TO 100, 1 TO 100) ' Stores y-direction pressure change at each grid point + +SCREEN 13 +PAINT (1, 1), 1 +SetupInitialConditions + +1 ' Main simulation loop + + ' Check if any key is pressed; if so, exit the program + IF INKEY$ <> "" THEN SYSTEM + + ' Display pressure values in a grid at the bottom of the screen. + FOR gridY = 2 TO 99 + FOR gridX = 2 TO 99 + IF pressureGrid(gridX, gridY) = wallBoundary THEN + ' Set velocities to zero for wall boundaries + horizontalVelocity(gridX - 1, gridY) = 0 + verticalVelocity(gridX, gridY - 1) = 0 + horizontalVelocity(gridX, gridY) = 0 + verticalVelocity(gridX, gridY) = 0 + GOTO 3 ' Skip further calculations for this grid point if it's a wall + END IF + + ' Apply gravitation by subtracting pressure from vertical speed + verticalVelocity(gridX, gridY) = verticalVelocity(gridX, gridY) - (pressureGrid(gridX, gridY) / 500) + + IF pressureGrid(gridX + 1, gridY) = wallBoundary THEN + horizontalVelocity(gridX, gridY) = 0 ' Set horizontal speed to zero if there's a wall to the right + GOTO 2 ' Skip further calculations for this grid point if there's a wall to the right + END IF + + ' Calculate x-direction speed based on pressure difference and previous speed + horizontalVelocity(gridX, gridY) = (pressureGrid(gridX + 1, gridY) - pressureGrid(gridX, gridY)) / 20 + horizontalVelocity(gridX, gridY) + +2 ' Label for skipping further calculations if there's a wall to the right + IF pressureGrid(gridX, gridY + 1) = wallBoundary THEN + verticalVelocity(gridX, gridY) = 0 ' Set vertical speed to zero if there's a wall below + GOTO 3 ' Skip further calculations for this grid point if there's a wall below + END IF + + ' Calculate y-direction speed based on pressure difference and previous speed + verticalVelocity(gridX, gridY) = (pressureGrid(gridX, gridY + 1) - pressureGrid(gridX, gridY)) / 20 + verticalVelocity(gridX, gridY) + +3 ' Label for skipping further calculations if there's a wall below or above + NEXT gridX + NEXT gridY + +4 ' Negative pressure correction loop + negativePressureFlag = 0 ' Initialize negative pressure flag to zero + FOR gridY = 2 TO 99 + FOR gridX = 2 TO 99 + pressureDifference = pressureGrid(gridX, gridY) + horizontalVelocity(gridX, gridY) + verticalVelocity(gridX, gridY) - horizontalVelocity(gridX - 1, gridY) - verticalVelocity(gridX, gridY - 1) + + IF pressureDifference = 0 OR ((pressureDifference < 0) AND (pressureDifference > -.0001)) THEN + ' If difference in pressure is zero or slightly negative, set speeds to zero + IF horizontalVelocity(gridX, gridY) < 0 THEN + horizontalVelocity(gridX, gridY) = 0 + END IF + IF verticalVelocity(gridX, gridY) < 0 THEN + verticalVelocity(gridX, gridY) = 0 + END IF + IF horizontalVelocity(gridX - 1, gridY) > 0 THEN + horizontalVelocity(gridX - 1, gridY) = 0 + END IF + IF verticalVelocity(gridX, gridY - 1) > 0 THEN + verticalVelocity(gridX, gridY - 1) = 0 + END IF + END IF + + ' If pressure difference is negative + IF pressureDifference < 0 THEN + IF horizontalVelocity(gridX, gridY) < 0 THEN + horizontalVelocity(gridX, gridY) = horizontalVelocity(gridX, gridY) / 1.5 ' Divide horizontal speed by 1.5 if negative + END IF + IF verticalVelocity(gridX, gridY) < 0 THEN + verticalVelocity(gridX, gridY) = verticalVelocity(gridX, gridY) / 1.5 ' Divide vertical speed by 1.5 if negative + END IF + IF horizontalVelocity(gridX - 1, gridY) > 0 THEN + horizontalVelocity(gridX - 1, gridY) = horizontalVelocity(gridX - 1, gridY) / 1.5 ' Divide horizontal speed by 1.5 if positive + END IF + IF verticalVelocity(gridX, gridY - 1) > 0 THEN + verticalVelocity(gridX, gridY - 1) = verticalVelocity(gridX, gridY - 1) / 1.5 ' Divide vertical speed by 1.5 if positive + END IF + negativePressureFlag = 1 ' Set negative pressure flag to one + ' Display negative pressure value at the bottom of the screen + LOCATE 20, 1 + PRINT pressureDifference + END IF + NEXT gridX + NEXT gridY + + IF negativePressureFlag = 1 THEN GOTO 4 ' If negative pressure was detected, repeat this loop to correct speeds + +' Update pressure based on velocity +FOR gridY = 2 TO 99 + FOR gridX = 2 TO 99 + ' Update pressure based on speed in the x-direction + IF horizontalVelocity(gridX, gridY) > 0 THEN + horizontalPressureChange(gridX - 1, gridY) = ((pressureGrid(gridX, gridY) * horizontalVelocity(gridX - 1, gridY)) + (horizontalVelocity(gridX, gridY) * horizontalVelocity(gridX, gridY))) / (pressureGrid(gridX, gridY) + horizontalVelocity(gridX, gridY)) - horizontalVelocity(gridX - 1, gridY) + END IF + + ' Update pressure based on speed in the y-direction + IF verticalVelocity(gridX, gridY) > 0 THEN + verticalPressureChange(gridX, gridY - 1) = ((pressureGrid(gridX, gridY) * verticalVelocity(gridX, gridY - 1)) + (verticalVelocity(gridX, gridY) * verticalVelocity(gridX, gridY))) / (pressureGrid(gridX, gridY) + verticalVelocity(gridX, gridY)) - verticalVelocity(gridX, gridY - 1) + END IF + + ' Handle negative speeds in the x-direction + IF horizontalVelocity(gridX - 1, gridY) < 0 THEN + horizontalPressureChange(gridX, gridY) = ((pressureGrid(gridX, gridY) * horizontalVelocity(gridX, gridY)) - (horizontalVelocity(gridX - 1, gridY) * horizontalVelocity(gridX - 1, gridY))) / (pressureGrid(gridX, gridY) - horizontalVelocity(gridX - 1, gridY)) - horizontalVelocity(gridX, gridY) + END IF + + ' Handle negative speeds in the y-direction + IF verticalVelocity(gridX, gridY - 1) < 0 THEN + verticalPressureChange(gridX, gridY) = ((pressureGrid(gridX, gridY) * verticalVelocity(gridX, gridY)) - (verticalVelocity(gridX, gridY - 1) * verticalVelocity(gridX, gridY - 1))) / (pressureGrid(gridX, gridY) - verticalVelocity(gridX, gridY - 1)) - verticalVelocity(gridX, gridY) + END IF + NEXT gridX +NEXT gridY + +' Update pressure grid based on velocities +FOR gridY = 2 TO 99 + FOR gridX = 2 TO 99 + ' Update pressure based on speed in the x-direction + pressureGrid(gridX + 1, gridY) = pressureGrid(gridX + 1, gridY) - horizontalVelocity(gridX, gridY) + + ' Update pressure based on speed in the y-direction + pressureGrid(gridX, gridY + 1) = pressureGrid(gridX, gridY + 1) - verticalVelocity(gridX, gridY) + + ' Add x and y speeds to pressure + pressureGrid(gridX, gridY) = pressureGrid(gridX, gridY) + horizontalVelocity(gridX, gridY) + pressureGrid(gridX, gridY) = pressureGrid(gridX, gridY) + verticalVelocity(gridX, gridY) + NEXT gridX +NEXT gridY + +' Update velocities based on pressure changes +FOR gridY = 2 TO 99 + FOR gridX = 2 TO 99 + ' Update speed based on previous speed in the x-direction + horizontalVelocity(gridX, gridY) = horizontalVelocity(gridX, gridY) + horizontalPressureChange(gridX, gridY) + + ' Reset pressure change to zero for next iteration + horizontalPressureChange(gridX, gridY) = 0 + + ' Update speed based on previous speed in the y-direction + verticalVelocity(gridX, gridY) = verticalVelocity(gridX, gridY) + verticalPressureChange(gridX, gridY) + + ' Reset pressure change to zero for next iteration + verticalPressureChange(gridX, gridY) = 0 + NEXT gridX +NEXT gridY + +' Draw the grid based on pressure values +FOR gridY = 1 TO 100 + FOR gridX = 1 TO 100 + ' Draw pixel based on pressure value + PSET (gridX, gridY), pressureGrid(gridX, gridY) + 16 + NEXT gridX +NEXT gridY + +GOTO 1 ' Repeat the main simulation loop + +SUB DrawBoundaryLine (startX!, startY!, endX!, endY!) + ' Draws a straight line between two points in the pressure grid + ' All points along the line are set to wallBoundary value + ' Uses linear interpolation for smooth line drawing + maxSteps = ABS(startX - endX) + IF ABS(startY - endY) > maxSteps THEN maxSteps = ABS(startY - endY) + deltaX = endX - startX + deltaY = endY - startY + FOR stepCount = 0 TO maxSteps + ' Calculate interpolated coordinates + interpX = deltaX * stepCount / maxSteps + startX + interpY = deltaY * stepCount / maxSteps + startY + ' Mark this point as a wall boundary + pressureGrid(interpX, interpY) = wallBoundary + NEXT stepCount +END SUB + +SUB SetLocalPressure (xCoord!, yCoord!, pressureValue!) + ' Sets a 2x2 block of cells to specified pressure value + ' Creates localized pressure disturbances in simulation + pressureGrid(xCoord, yCoord) = pressureValue + pressureGrid(xCoord + 1, yCoord) = pressureValue + pressureGrid(xCoord, yCoord + 1) = pressureValue + pressureGrid(xCoord + 1, yCoord + 1) = pressureValue +END SUB + +SUB SetupInitialConditions + ' Sets up initial conditions for the simulation: + ' - Initializes all pressure and velocity arrays + ' - Places initial pressure disturbances + ' - Creates boundary walls + FOR yIndex = 1 TO 100 + FOR xIndex = 1 TO 100 + ' Initialize pressure and velocity variables + pressureGrid(xIndex, yIndex) = 3 + horizontalVelocity(xIndex, yIndex) = 0 + verticalVelocity(xIndex, yIndex) = 0 + horizontalPressureChange(xIndex, yIndex) = 0 + verticalPressureChange(xIndex, yIndex) = 0 + NEXT xIndex + NEXT yIndex + + ' Create initial pressure spots + FOR yIndex = 30 TO 60 + FOR xIndex = 10 TO 50 + SetLocalPressure xIndex, yIndex, 30 + NEXT xIndex + NEXT yIndex + + ' Draw boundary lines + DrawBoundaryLine 2, 2, 2, 99 + DrawBoundaryLine 99, 2, 99, 99 + DrawBoundaryLine 2, 99, 99, 99 + DrawBoundaryLine 2, 2, 99, 2 + + ' Draw additional lines for testing + FOR xIndex = 5 TO 40 STEP 5 + DrawBoundaryLine xIndex, 80, xIndex + 50, 80 - xIndex + NEXT xIndex +END SUB diff --git a/Math/Simulation/Explosion/index.html b/Math/Simulation/Explosion/index.html new file mode 100644 index 0000000..e0410d6 --- /dev/null +++ b/Math/Simulation/Explosion/index.html @@ -0,0 +1,17 @@ + +explode + + + +

explode

+
+
+
Simulates air flow. +Air tries to spread equally around space, +while having is inertial farces, mass and gravitation. +Simulation animates shock waves propagation on +flat space after explosion. + +
+ + \ No newline at end of file diff --git a/Math/Simulation/Explosion/screenshot.png b/Math/Simulation/Explosion/screenshot.png new file mode 100644 index 0000000..80089b6 Binary files /dev/null and b/Math/Simulation/Explosion/screenshot.png differ diff --git a/Math/Simulation/Gravity in 2D.bas b/Math/Simulation/Gravity in 2D.bas new file mode 100755 index 0000000..3bebaeb --- /dev/null +++ b/Math/Simulation/Gravity in 2D.bas @@ -0,0 +1,59 @@ +' Gravitation Simulation +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' This program simulates the gravitational pull of a central mass +' on a small object in two-dimensional space. The simulation is +' visualized on the screen with the central mass as a large circle +' and the orbiting object as a smaller circle. +' +' Changelog: +' 2001, Initial version +' 2024 - 2025, Improved code readability + +DEFDBL A-Z ' Declare all variables as double precision for accuracy +SCREEN 12 ' Set the graphics mode to 640x480 resolution, 16 colors + +' Initialize position and velocity of the orbiting object +objX = -200 ' X-coordinate of the object +objY = 0 ' Y-coordinate of the object +objVelX = -1 ' X-velocity (speed) of the object +objVelY = 3 ' Y-velocity (speed) of the object + +' Draw the central mass as a large circle +CIRCLE (320, 240), 100, 3 + +' Main simulation loop +DO + + ' Check for user input and exit if any key is pressed + IF INKEY$ <> "" THEN SYSTEM + + ' Draw a small circle to represent the orbiting object + CIRCLE (objX + 320, objY + 240), 2, 14 + + ' Update the position of the orbiting object + objX = objX + objVelX + objY = objY + objVelY + + ' Calculate the distance from the central mass + dist = SQR(objX * objX + objY * objY) + + ' Calculate the gravitational acceleration towards the center + gravAccel = 20 / dist ' Gravitational constant for this simulation + + ' Adjust velocities based on gravitational pull and distance + objVelX = objVelX + (gravAccel * (-objX) / dist) + objVelY = objVelY + (gravAccel * (-objY) / dist) + + ' Draw a line to show the object's trajectory + LINE (objX + 320, objY + 240)-(320, 240), 1 + + + SOUND 0, .1 + +LOOP + diff --git a/Math/Simulation/Gravity in 2D.png b/Math/Simulation/Gravity in 2D.png new file mode 100644 index 0000000..51de6bf Binary files /dev/null and b/Math/Simulation/Gravity in 2D.png differ diff --git a/Math/Simulation/Gravity in 3D.bas b/Math/Simulation/Gravity in 3D.bas new file mode 100755 index 0000000..0efdb9d --- /dev/null +++ b/Math/Simulation/Gravity in 3D.bas @@ -0,0 +1,129 @@ +' Program to simulate gravitational forces between atoms. +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024.08, Improved program readability + +DECLARE SUB Gravitate () +DECLARE SUB AddAtom (x AS SINGLE, y AS SINGLE, z AS SINGLE, size AS SINGLE) +DECLARE SUB DisplaySystem () + +DIM SHARED atomX(1 TO 100) +DIM SHARED atomY(1 TO 100) +DIM SHARED atomZ(1 TO 100) +DIM SHARED atomXSpeed(1 TO 100) +DIM SHARED atomYSpeed(1 TO 100) +DIM SHARED atomZSpeed(1 TO 100) +DIM SHARED atomSize(1 TO 100) +DIM SHARED countOfAtoms +DIM SHARED myX, myY, myZ +DIM SHARED oldAtomX(1 TO 100) +DIM SHARED oldAtomY(1 TO 100) +DIM SHARED oldAtomSize(1 TO 100) + +myX = 0 +myY = 0 +myZ = -5 +countOfAtoms = 0 + +SCREEN 13 + +' Initialize the system with a random distribution of atoms +FOR a = 1 TO 30 + AddAtom RND * 6 - 3, RND * 6 - 3, RND * 4, 50 +NEXT a + +' Main loop to display and update the system +1 + DisplaySystem + Gravitate + IF INKEY$ <> "" THEN SYSTEM ' Exit on any key press + + ' Delay animation + SOUND 0, 1 +GOTO 1 + +SUB AddAtom (x, y, z, size) + ' Increment the atom count + countOfAtoms = countOfAtoms + 1 + + ' Store the new atom's position and size + atomX(countOfAtoms) = x + atomY(countOfAtoms) = y + atomZ(countOfAtoms) = z + atomSize(countOfAtoms) = size + + ' Initialize the speed of the new atom to zero + atomXSpeed(countOfAtoms) = 0 + atomYSpeed(countOfAtoms) = 0 + atomZSpeed(countOfAtoms) = 0 +END SUB + +SUB DisplaySystem + FOR a = 1 TO countOfAtoms + ' Calculate the relative position of each atom + x = atomX(a) - myX + y = atomY(a) - myY + z = atomZ(a) - myZ + + ' Project the 3D positions onto a 2D screen + x1 = x / z * 100 + 160 + y1 = y / z * 100 + 100 + + ' Erase the old atom position and draw the new one + CIRCLE (oldAtomX(a), oldAtomY(a)), oldAtomSize(a), 0 + CIRCLE (x1, y1), atomSize(a) / z, 15 + + ' Update the old positions for the next frame + oldAtomX(a) = x1 + oldAtomY(a) = y1 + oldAtomSize(a) = atomSize(a) / z + NEXT a +END SUB + +SUB Gravitate + DIM pxs, pys, pzs + + FOR a = 1 TO countOfAtoms + ' Get the current atom's position + x = atomX(a) + y = atomY(a) + z = atomZ(a) + + ' Initialize gravitational forces to zero + pxs = 0 + pys = 0 + pzs = 0 + + FOR b = 1 TO countOfAtoms + IF b = a THEN GOTO 2 ' Skip self-gravitation + + ' Calculate the distance between atoms + v = SQR((atomX(b) - x) ^ 2 + (atomY(b) - y) ^ 2 + (atomZ(b) - z) ^ 2) + v2 = 1 / (v - 1) + + ' Accumulate gravitational forces from other atoms + pxs = pxs + (atomX(b) - x) / v2 / 10000 + pys = pys + (atomY(b) - y) / v2 / 10000 + pzs = pzs + (atomZ(b) - z) / v2 / 10000 + +2 NEXT b + + ' Update the atom's velocity with the accumulated forces + atomXSpeed(a) = atomXSpeed(a) / 1.01 + pxs + atomYSpeed(a) = atomYSpeed(a) / 1.01 + pys + atomZSpeed(a) = atomZSpeed(a) / 1.01 + pzs + NEXT a + + ' Update the positions of all atoms based on their velocities + FOR a = 1 TO countOfAtoms + atomX(a) = atomX(a) + atomXSpeed(a) + atomY(a) = atomY(a) + atomYSpeed(a) + atomZ(a) = atomZ(a) + atomZSpeed(a) + NEXT a +END SUB + diff --git a/Math/Simulation/Gravity in 3D.webm b/Math/Simulation/Gravity in 3D.webm new file mode 100644 index 0000000..c941ab8 Binary files /dev/null and b/Math/Simulation/Gravity in 3D.webm differ diff --git a/Math/Simulation/Interference.BAS b/Math/Simulation/Interference.BAS new file mode 100755 index 0000000..6252cf5 --- /dev/null +++ b/Math/Simulation/Interference.BAS @@ -0,0 +1,51 @@ +' Program simulates interference between two slightly different frequencies +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' ?, Initial version +' 2024-2025, Improved program readability + +DECLARE SUB GetFrequency () +DECLARE SUB Start () +DECLARE FUNCTION GetY! (t!) + +SCREEN 12 +1 + +' Check for user input and exit if any key is pressed +IF INKEY$ <> "" THEN SYSTEM + +frame = frame + 1 +FOR x = 0 TO 639 + + oldY1 = y1 + oldY2 = y2 + oldY3 = y3 + + ' Calculate new Y values for the waves + ' First wave: simple sine wave + y1 = SIN(frame + x / 4) * 20 + 150 + + ' Second wave: same but with additional phase shift that increases with x + ' This creates a slight frequency difference + y2 = SIN(frame + x / 4 + (x / 50)) * 20 + 150 + + ' Third line: sum of both waves to show interference pattern + y3 = y1 + y2 + + ' Clear the previous frame by drawing black vertical line + LINE (x, 0)-(x, 479), 0 + + ' Draw new lines for each wave + LINE (x - 1, oldY1)-(x, y1), 1 ' Blue wave + LINE (x - 1, oldY2)-(x, y2), 2 ' Green wave + LINE (x - 1, oldY3)-(x, y3), 15 ' White combined wave + +NEXT x +GOTO 1 + + diff --git a/Math/Simulation/Interference.webm b/Math/Simulation/Interference.webm new file mode 100644 index 0000000..2b2b15d Binary files /dev/null and b/Math/Simulation/Interference.webm differ diff --git a/Math/Simulation/Interferogram.BAS b/Math/Simulation/Interferogram.BAS new file mode 100755 index 0000000..1378bf9 --- /dev/null +++ b/Math/Simulation/Interferogram.BAS @@ -0,0 +1,52 @@ +' Program simulates lot of frequencies interfering with itself. +' As a result, interferogram is produced. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' ?, Initial version +' 2024 - 2025, Improved program readability + +' Set graphics mode (640x480 with 16 colors) +SCREEN 12 + +' Start drawing from the leftmost pixel +PSET (0, 0) + +' Loop through all horizontal positions on screen +FOR currentXPosition = 0 TO 639 + + ' Calculate frequency scaling factor based on position + ' This creates a gradient effect in the interference pattern + frequencyScalingFactor = (currentXPosition - 320) / 5000 + 1 + + ' Initialize accumulated signal value + totalSignalValue = 0 + + ' Sample the signal at multiple time steps to calculate interference + FOR currentTimeStep = 1 TO 5000 STEP 5 + ' Generate two sine waves: + ' y1 - base frequency wave + ' y2 - frequency scaled wave (based on horizontal position) + baseWave = SIN(currentTimeStep) + scaledWave = SIN(currentTimeStep * frequencyScalingFactor) + + ' Calculate interference by summing the waves and taking absolute value + totalSignalValue = totalSignalValue + ABS(baseWave + scaledWave) + NEXT currentTimeStep + + ' Normalize the signal value + normalizedSignalValue = totalSignalValue / 5 + + ' Limit the value to screen boundaries + IF normalizedSignalValue > 470 THEN normalizedSignalValue = 470 + IF normalizedSignalValue < 0 THEN normalizedSignalValue = 0 + + ' Draw a line from previous position to current position + LINE -(currentXPosition, 479 - normalizedSignalValue), 15 + +NEXT currentXPosition + diff --git a/Math/Simulation/Interferogram.png b/Math/Simulation/Interferogram.png new file mode 100644 index 0000000..b433b07 Binary files /dev/null and b/Math/Simulation/Interferogram.png differ diff --git a/Math/Simulation/Surface tension.bas b/Math/Simulation/Surface tension.bas new file mode 100755 index 0000000..096acaa --- /dev/null +++ b/Math/Simulation/Surface tension.bas @@ -0,0 +1,101 @@ +' Program simulates water spill and subsequent surface tension effects +' that try to round out sharp edges through cellular automata rules. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024 - 2025, Improved program readability + +DEFINT A-Z +WIDTH 80, 50 +VIEW PRINT 1 TO 50 +RANDOMIZE TIMER +CLS + +' Create two grids for double buffering technique +' This prevents visual artifacts during updates +DIM SHARED currentGrid(1 TO 80, 1 TO 50) +DIM SHARED nextGrid(1 TO 80, 1 TO 50) + +' Initialize grid with random water (1) and empty space (0) +FOR row = 1 TO 50 + FOR column = 1 TO 80 + currentGrid(column, row) = INT(RND * 2) + NEXT column +NEXT row + +'================================================================================ +' MAIN SIMULATION LOOP +' Continuously calculates next state based on surface tension rules +' Uses cellular automata approach with Moore neighborhood (8 neighbors) +'================================================================================ +1 + +' Check for user input and exit if any key is pressed +IF INKEY$ <> "" THEN SYSTEM + +FOR row = 2 TO 49 + FOR column = 2 TO 79 + ' Count live cells around current position (Moore neighborhood) + ' This includes all 8 surrounding cells forming a square around it + neighborTotal = currentGrid(column - 1, row - 1) + neighborTotal = neighborTotal + currentGrid(column, row - 1) + neighborTotal = neighborTotal + currentGrid(column + 1, row - 1) + neighborTotal = neighborTotal + currentGrid(column - 1, row) + neighborTotal = neighborTotal + currentGrid(column + 1, row) + neighborTotal = neighborTotal + currentGrid(column - 1, row + 1) + neighborTotal = neighborTotal + currentGrid(column, row + 1) + neighborTotal = neighborTotal + currentGrid(column + 1, row + 1) + + ' Apply surface tension rules: + ' 1. Water cell (value 1) survives only if surrounded by moderate density + ' 2. Empty space (value 0) becomes water if surrounded by high density + IF currentGrid(column, row) = 1 THEN + IF neighborTotal > 3 THEN + nextGrid(column, row) = 1 + ELSE + nextGrid(column, row) = 0 + END IF + ELSE + IF neighborTotal > 4 THEN + nextGrid(column, row) = 1 + ELSE + nextGrid(column, row) = 0 + END IF + END IF + NEXT column +NEXT row + +' UPDATE DISPLAY AND SWAP BUFFERS +' Renders the simulation state to screen using ASCII characters and prepares +' for next iteration by swapping active/inactive grids +FOR row = 1 TO 50 + FOR column = 1 TO 80 + ' Transfer calculated state from working buffer to display buffer + cellState = nextGrid(column, row) + currentGrid(column, row) = cellState + + ' Visual representation: # for water, . for empty space + LOCATE row, column + IF cellState = 0 THEN + PRINT "."; + ELSE + PRINT "#" + END IF + NEXT column +NEXT row + +'================================================================================ +' FRAME RATE CONTROL +' Creates approximately 60 frames per second using inaudible sound workaround +' Actual frequency value of 0 creates short delay without producing sound +'================================================================================ +SOUND 0, 3 + +' Return to start of simulation loop +GOTO 1 + diff --git a/Math/Simulation/Surface tension.png b/Math/Simulation/Surface tension.png new file mode 100644 index 0000000..181c764 Binary files /dev/null and b/Math/Simulation/Surface tension.png differ diff --git a/Math/Simulation/Wave 1.bas b/Math/Simulation/Wave 1.bas new file mode 100755 index 0000000..4baad40 --- /dev/null +++ b/Math/Simulation/Wave 1.bas @@ -0,0 +1,60 @@ +' Program simulate wave propagation across surface. +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024 - 2025, Improved program readability + +SCREEN 13 + +DIM SHARED yHigh(1 TO 300) ' surface height +DIM SHARED yVelocity(1 TO 300) ' surface movement direction and velocity + +' Initialize the arrays +FOR x = 1 TO 300 + yVelocity(x) = 0 + yHigh(x) = 100 +NEXT x + +' Create an initial wave shape +FOR x = 140 TO 160 + yHigh(x) = 150 +NEXT x + +' Main simulation loop +1 : + ' Draw the wave + FOR x = 1 TO 300 + LINE (x, 0)-(x, 200 - yHigh(x)), 0 + LINE (x, 200 - yHigh(x))-(x, 200), 15 + NEXT x + + ' Calculate the average height of neighboring points + FOR x = 10 TO 290 + avgHeight = (yHigh(x - 1) + yHigh(x + 1) + yHigh(x + 2) + yHigh(x - 2)) / 4 + ' Update the smooth wave height + yVelocity(x) = yVelocity(x) + (avgHeight - yHigh(x)) / 5 + ' Apply a damping factor + yVelocity(x) = yVelocity(x) / 1.01 + NEXT x + + ' Update the wave height based on the smooth values + FOR x = 10 TO 290 + yHigh(x) = yHigh(x) + yVelocity(x) + ' Apply smoothing to neighboring points + yHigh(x - 1) = yHigh(x - 1) + yVelocity(x) / 2 + yHigh(x + 1) = yHigh(x + 1) + yVelocity(x) / 2 + NEXT x + + ' Play a sound + SOUND 0, .5 + + ' Check for user input to exit + IF INKEY$ <> "" THEN SYSTEM + +' Loop back to the start of the simulation loop +GOTO 1 + diff --git a/Math/Simulation/Wave 1.png b/Math/Simulation/Wave 1.png new file mode 100644 index 0000000..44294d2 Binary files /dev/null and b/Math/Simulation/Wave 1.png differ diff --git a/Math/Simulation/Wave 2.bas b/Math/Simulation/Wave 2.bas new file mode 100755 index 0000000..2b4e81f --- /dev/null +++ b/Math/Simulation/Wave 2.bas @@ -0,0 +1,59 @@ +' Program renders 2D surface of a water. Water surface is disturbed by random rain droplets. +' Program simulates and visualizes propagating waves on the water surface. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003, Initial version +' 2024 - 2025, Improved program readability + +SCREEN 13 + +DIM SHARED surfaceHeight(1 TO 300) +DIM SHARED verticalMovementSpeed(1 TO 300) + +FOR x = 1 TO 300 + verticalMovementSpeed(x) = 0 + surfaceHeight(x) = 50 +NEXT x + +' Main loop +1 + +CLS +FOR x = 1 TO 300 + ' Draw the current wave height at each point + PSET (x, 200 - surfaceHeight(x)), 31 +NEXT x + +' Calculate new wave heights based on neighboring points +FOR x = 10 TO 290 + averageNeighborHeights = (surfaceHeight(x - 1) + surfaceHeight(x + 1) + surfaceHeight(x + 2) + surfaceHeight(x - 2)) / 4 + verticalMovementSpeed(x) = verticalMovementSpeed(x) + (averageNeighborHeights - surfaceHeight(x)) / 5 + ' Smooth the new wave heights + verticalMovementSpeed(x) = verticalMovementSpeed(x) / 1.01 +NEXT x + +' Update the current wave heights with the newly calculated values +FOR x = 10 TO 290 + surfaceHeight(x) = surfaceHeight(x) + verticalMovementSpeed(x) +NEXT x + +' Randomly generate a new wave at the start point +IF RND * 100 < 2 THEN + newWaveIndex = RND * 200 + waveAmplitude = RND * 10 + 2 + FOR x = 0 TO 3.14 STEP 3.14 / waveAmplitude + surfaceHeight(newWaveIndex) = surfaceHeight(newWaveIndex) + SIN(x) * waveAmplitude * 3 + newWaveIndex = newWaveIndex + 1 + NEXT x +END IF + +' Check for user input to exit the program +IF INKEY$ <> "" THEN SYSTEM + +' Go back to the main loop +GOTO 1 diff --git a/Math/Simulation/Wave 2.png b/Math/Simulation/Wave 2.png new file mode 100644 index 0000000..abd173f Binary files /dev/null and b/Math/Simulation/Wave 2.png differ diff --git a/Math/Sine computation.bas b/Math/Sine computation.bas new file mode 100755 index 0000000..8a85efc --- /dev/null +++ b/Math/Sine computation.bas @@ -0,0 +1,52 @@ +' Sine calculator without relying on built-in trigonometry functions. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.12, Initial version +' 2024 - 2025, Improved program readability. +' +' This program calculates the sine of an angle without using the +' built-in SIN function. Then it plots the calculated sine wave +' alongside the built-in sine wave for comparison. There is +' intentional vertical 1 pixel offset between the two waves so that we +' can see them simultaneously. + +SCREEN 12 + +' Draw a horizontal baseline +LINE (0, 240)-(640, 240), 15 + +' Initialize variables for the sine wave calculation +' r represents the current value of the sine approximation +' r1 represents the rate of change of the sine approximation +LET radius = 0 +LET rateOfChange = 1 + +' Iterate over each horizontal pixel to calculate and plot the sine values +FOR angleDegrees = 1 TO 639 + ' Calculate the actual sine value using the built-in SIN function + ' for comparison. + ' Scale and translate the sine wave to fit within the screen coordinates. + LET trueSineY = SIN(angleDegrees / 100) * 100 + 240 + PSET (angleDegrees, trueSineY), 15 + + ' Update the rate of change and the radius (sine approximation) + ' This is a simple implementation of the differential equation + ' that defines the sine function, effectively integrating over time + LET rateOfChange = rateOfChange + ((0 - radius) / 10000) + LET radius = radius + rateOfChange + + ' Calculate the approximate sine value using our own method + ' Offset the plot by 241 pixels to display below the true sine wave + LET approxSineY = radius + PSET (angleDegrees, approxSineY + 241), 12 +NEXT angleDegrees + +' Wait for a key press before ending the program +PRINT "Press any key to exit." +DO UNTIL INKEY$ <> "" +LOOP diff --git a/Math/Sine computation.png b/Math/Sine computation.png new file mode 100644 index 0000000..86fc66c Binary files /dev/null and b/Math/Sine computation.png differ diff --git a/Math/Truth table calculator/img/screenshot, 1.png b/Math/Truth table calculator/img/screenshot, 1.png new file mode 100644 index 0000000..b2a4218 Binary files /dev/null and b/Math/Truth table calculator/img/screenshot, 1.png differ diff --git a/Math/Truth table calculator/img/screenshot, 2.png b/Math/Truth table calculator/img/screenshot, 2.png new file mode 100644 index 0000000..e64bc42 Binary files /dev/null and b/Math/Truth table calculator/img/screenshot, 2.png differ diff --git a/Math/Truth table calculator/img/screenshot, 3.png b/Math/Truth table calculator/img/screenshot, 3.png new file mode 100644 index 0000000..c5b9612 Binary files /dev/null and b/Math/Truth table calculator/img/screenshot, 3.png differ diff --git a/Math/Truth table calculator/index.html b/Math/Truth table calculator/index.html new file mode 100644 index 0000000..89a2606 --- /dev/null +++ b/Math/Truth table calculator/index.html @@ -0,0 +1,1683 @@ + + + + + + + +Truth table calculator + + + + + + + + + + + + + + + + + + +
+

Truth table calculator

+ + + +

+A truth table is a mathematical table used to determine the output of a logic function +based on all possible combinations of inputs. Each row represents a possible state of +the input variables, with the corresponding output value. Truth tables are crucial in +designing and understanding digital circuits, Boolean algebra, and logical expressions. +

+ +
+

1. Implemented logical operations

+
+
+
+

1.1. Equivalent ( ⇔ , 1 )

+
+

+The equivalent operation, also known as logical biconditional, is true if and only if +both inputs are the same. In other words, it asserts that both propositions are +either both true or both false. It is often represented by the symbol ⇔. +

+ +

+Truth Table: +

+ + + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ABA ⇔ B
TTT
TFF
FTF
FFT
+
+
+ +
+

1.2. Implies ( ⇒ , 2 )

+
+

+An implication asserts that if the first proposition is true, the +second must be true as well. If the first is false, the implication +holds regardless of the second proposition's value. +

+ +

+Truth table: +

+ + + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ABA ⇒ B
TTT
TFF
FTT
FFT
+
+
+ +
+

1.3. OR ( ∨ , 3 )

+
+

+The OR operation, also known as logical disjunction, is true if at +least one of the inputs is true. It asserts that if either proposition +is true, the entire expression is true. +

+ +

+Truth table: +

+ + + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ABA ∨ B
TTT
TFT
FTT
FFF
+
+
+ +
+

1.4. AND ( ∧ , 4 )

+
+

+The AND operation, also known as logical conjunction, is true if and +only if both inputs are true. +

+ +

+Truth table: +

+ + + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ABA ∧ B
TTT
TFF
FTF
FFF
+
+
+ +
+

1.5. NOT ( ¬ , 5 )

+
+

+The NOT operation, also known as logical negation, inverts the value +of the input. If the input is true, the output is false, and vice +versa. +

+ +

+Truth Table: +

+ + + + +++ ++ + + + + + + + + + + + + + + + + + +
A¬A
TF
FT
+
+
+
+
+

2. Examples

+
+
+
+

2.1. Example: (A ∧ B) ∨ ¬C

+
+ + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ABC(A ∧ B) ∨ ¬C
TTTT
TTFT
TFTF
TFFT
FTTF
FTFT
FFTF
FFFT
+
+
+ +
+

2.2. Example: A ⇒ (B ∨ ¬C)

+
+ + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ABCA ⇒ (B ∨ ¬C)
TTTT
TTFT
TFTF
TFFT
FTTT
FTFT
FFTT
FFFT
+
+
+ +
+

2.3. Example: (A ⇔ B) ∧ C

+
+

+Truth Table: +

+ + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ABC(A ⇔ B) ∧ C
TTTT
TTFF
TFTF
TFFF
FTTF
FTFF
FFTT
FFFF
+
+
+
+
+
+

Created: 2025-05-31 la 07:09

+

Validate

+
+ + diff --git a/Math/Truth table calculator/index.org b/Math/Truth table calculator/index.org new file mode 100644 index 0000000..cd58c50 --- /dev/null +++ b/Math/Truth table calculator/index.org @@ -0,0 +1,131 @@ +#+SETUPFILE: ~/.emacs.d/org-styles/html/darksun.theme +#+TITLE: Truth table calculator +#+LANGUAGE: en +#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry} +#+LATEX_HEADER: \usepackage{parskip} +#+LATEX_HEADER: \usepackage[none]{hyphenat} + +#+OPTIONS: H:20 num:20 +#+OPTIONS: author:nil + +- See also: https://en.wikipedia.org/wiki/Truth_table + +A truth table is a mathematical table used to determine the output of a logic function +based on all possible combinations of inputs. Each row represents a possible state of +the input variables, with the corresponding output value. Truth tables are crucial in +designing and understanding digital circuits, Boolean algebra, and logical expressions. + +* Implemented logical operations +** Equivalent ( ⇔ , 1 ) + +The equivalent operation, also known as logical biconditional, is true if and only if +both inputs are the same. In other words, it asserts that both propositions are +either both true or both false. It is often represented by the symbol *⇔*. + +Truth Table: + +| A | B | A ⇔ B | +|---+---+-------| +| T | T | T | +| T | F | F | +| F | T | F | +| F | F | T | + +** Implies ( ⇒ , 2 ) + +An implication asserts that if the first proposition is true, the +second must be true as well. If the first is false, the implication +holds regardless of the second proposition's value. + +Truth table: + +| A | B | A ⇒ B | +|---+---+-------| +| T | T | T | +| T | F | F | +| F | T | T | +| F | F | T | + +** OR ( ∨ , 3 ) + +The OR operation, also known as logical disjunction, is true if at +least one of the inputs is true. It asserts that if either proposition +is true, the entire expression is true. + +Truth table: + +| A | B | A ∨ B | +|---+---+-------| +| T | T | T | +| T | F | T | +| F | T | T | +| F | F | F | + +** AND ( ∧ , 4 ) + +The AND operation, also known as logical conjunction, is true if and +only if both inputs are true. + +Truth table: + +| A | B | A ∧ B | +|---+---+-------| +| T | T | T | +| T | F | F | +| F | T | F | +| F | F | F | + +** NOT ( ¬ , 5 ) + +The NOT operation, also known as logical negation, inverts the value +of the input. If the input is true, the output is false, and vice +versa. + +Truth Table: + +| A | ¬A | +|---+----| +| T | F | +| F | T | +* Examples + +** Example: (A ∧ B) ∨ ¬C + +| A | B | C | (A ∧ B) ∨ ¬C | +|---+---+---+--------------| +| T | T | T | T | +| T | T | F | T | +| T | F | T | F | +| T | F | F | T | +| F | T | T | F | +| F | T | F | T | +| F | F | T | F | +| F | F | F | T | + +** Example: A ⇒ (B ∨ ¬C) + +| A | B | C | A ⇒ (B ∨ ¬C) | +|---+---+---+--------------| +| T | T | T | T | +| T | T | F | T | +| T | F | T | F | +| T | F | F | T | +| F | T | T | T | +| F | T | F | T | +| F | F | T | T | +| F | F | F | T | + +** Example: (A ⇔ B) ∧ C + +Truth Table: + +| A | B | C | (A ⇔ B) ∧ C | +|---+---+---+-------------| +| T | T | T | T | +| T | T | F | F | +| T | F | T | F | +| T | F | F | F | +| F | T | T | F | +| F | T | F | F | +| F | F | T | T | +| F | F | F | F | diff --git a/Math/Truth table calculator/truth.bas b/Math/Truth table calculator/truth.bas new file mode 100755 index 0000000..ee39e82 --- /dev/null +++ b/Math/Truth table calculator/truth.bas @@ -0,0 +1,597 @@ +' TRUTH TABLE CALCULATOR +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2002, Initial version +' 2024 - 2025, Improved program readability +' +' +' A truth table is a mathematical table used to determine the output of a +' logic function based on all possible combinations of inputs. Each row +' represents a possible state of the input variables, with the +' corresponding output value. Truth tables are crucial in designing and +' understanding digital circuits, Boolean algebra, and logical +' expressions. +' +' Implemented operations: +' Equivalent ( Keyboard shortcut: 1 ) +' Implies ( Keyboard shortcut: 2 ) +' OR ( Keyboard shortcut: 3 ) +' AND ( Keyboard shortcut: 4 ) +' NOT ( Keyboard shortcut: 5 ) + +DECLARE SUB removeRedundancies (startIndex!, endIndex!, removalCount!) +DECLARE SUB getOperatorPriority (a!, b!) +DECLARE SUB movM (x1!, n!) +DECLARE SUB clearScreenBuffer () +DECLARE SUB lendm (x1!, m!) +DECLARE SUB mov (x1!, n!) +DECLARE SUB lendp (x1!, m!) +DECLARE SUB teeslg (x1!, x2!, l!) +DECLARE SUB prepare () +DECLARE SUB tee (x1!, x2!) +DECLARE SUB lahend (x1, x2) +DECLARE SUB printText (x!, y!, c!, c1!, a$) +DECLARE SUB sist () +DECLARE SUB start () +DIM SHARED font(0 TO 7, 0 TO 7, 0 TO 122) + +' Logical expression storage and processing arrays +DIM SHARED logicalExpression(0 TO 79) ' Stores ASCII values of logical expression +DIM SHARED variableValues(1 TO 8, 1 TO 100) ' Stores variable values for each combination +DIM SHARED variableNames(1 TO 8) ' Stores ASCII values of variable names +DIM SHARED resultValues(1 TO 100) ' Stores computed result values +DIM SHARED expressionPosition(0 TO 79) ' Stores screen positions of expression characters +DIM SHARED xlahn +DIM SHARED tehl +DIM SHARED nm +DIM SHARED prnp + +start + +13 +sist +prepare +GOTO 13 + +SUB clearScreenBuffer +' Waits for user input to clear the screen buffer +FOR a = 1 TO 50 + a$ = INKEY$ +NEXT a +END SUB + +SUB getOperatorPriority (operator, priority) +' Determines the priority of logical operators +SELECT CASE operator + CASE 5 ' NOT + priority = 1 + CASE 3, 4 ' OR, AND + priority = 2 + CASE 2 ' Implies + priority = 3 + CASE 1 ' Equivalent + priority = 4 + CASE 40, 41 ' Parentheses + priority = 100 +END SELECT +END SUB + + +SUB lahend (x1, x2) +' Analyzes and prepares the logical equation for solving +DIM muu(65 TO 122) +FOR a = 65 TO 122 + muu(a) = 0 +NEXT a + +muu(116) = 1 ' t +muu(118) = 1 ' v + +nm = 0 +FOR a = x1 TO x2 + b = logicalExpression(a) + IF ((b >= 65) AND (b <= 90)) OR ((b >= 97) AND (b <= 122)) THEN + IF muu(b) = 0 THEN + nm = nm + 1 + variableNames(nm) = b + muu(b) = 1 + END IF + END IF +NEXT a + +variableNames(nm + 1) = 116 ' t +variableNames(nm + 2) = 118 ' v + +f = 2 ^ nm +tehl = f +FOR a = 1 TO nm + d = 1 + e = 1 + f = f / 2 + FOR b = 1 TO 2 ^ nm + IF e > f THEN d = -d: e = 1 + IF d = 1 THEN c = ASC("t") ELSE c = ASC("v") + variableValues(a, b) = c + e = e + 1 + NEXT b +NEXT a + +FOR a = 1 TO tehl + variableValues(nm + 1, a) = 116 ' t + variableValues(nm + 2, a) = 118 ' v +NEXT a + +nm = nm + 2 + +DIM bck(0 TO 79) +FOR a = 0 TO 79 + bck(a) = logicalExpression(a) + expressionPosition(a) = a +NEXT a + +LOCATE 5, 1 +teeslg x1, x2, a + +tee x1, x2 + a + +FOR a = 0 TO 79 + logicalExpression(a) = bck(a) +NEXT a + +FOR a = 1 TO tehl + printText x2 + 1, a, 14, 0, CHR$(resultValues(a)) +NEXT a + +END SUB + +SUB lendm (x1, m) +' Measures the length of a logical expression enclosed in parentheses +IF logicalExpression(x1) <> 41 THEN m = 1: GOTO 19 +c = x1 +d = 1 +20 +c = c - 1 +IF logicalExpression(c) = 40 THEN d = d - 1 +IF logicalExpression(c) = 41 THEN d = d + 1 +IF d > 0 THEN GOTO 20 +m = x1 - c +19 +END SUB + +SUB lendp (x1, m) +' Measures the length of a logical expression enclosed in parentheses +IF logicalExpression(x1) <> 40 THEN m = 1: GOTO 17 +c = x1 +d = 1 +18 +c = c + 1 +IF logicalExpression(c) = 40 THEN d = d + 1 +IF logicalExpression(c) = 41 THEN d = d - 1 +IF d > 0 THEN GOTO 18 +m = c - x1 + 1 +17 +END SUB + +SUB mov (x1, n) +' Moves a portion of the logical expression to the right +FOR a = 79 - n TO x1 STEP -1 + logicalExpression(a + n) = logicalExpression(a) + expressionPosition(a + n) = expressionPosition(a) +NEXT a +END SUB + +SUB movM (x1, n) +' Moves a portion of the logical expression to the left +FOR a = x1 TO 79 - n + logicalExpression(a) = logicalExpression(a + n) + expressionPosition(a) = expressionPosition(a + n) +NEXT a +END SUB + +SUB prepare +' Prepares the logical equation for processing +CLS + +ln = 79 +FOR a = 0 TO 79 +5 + IF logicalExpression(a) = 32 OR logicalExpression(a) = 0 THEN + FOR b = a TO 78 + logicalExpression(b) = logicalExpression(b + 1) + NEXT b + ln = ln - 1 + IF ln <= a - 1 THEN GOTO 6 + GOTO 5 + END IF +NEXT a +6 + +CLS + +FOR a = 0 TO ln + printText a, 0, 13, 1, CHR$(logicalExpression(a)) +NEXT a + +printText 0, 1, 7, 0, SPACE$(79) + +lahend 0, ln + +a$ = INPUT$(1) + +END SUB + +SUB printText (x, y, c, c1, a$) + ' Prints characters to the screen at location (x,y) with color c, background c1 + x1 = x * 8 + y1 = (y + prnp) * 8 + + FOR b = 1 TO LEN(a$) + LINE (x1, y1)-(x1 + 7, y1 + 7), c1, BF + d = ASC(RIGHT$(LEFT$(a$, b), 1)) + IF d > 122 THEN GOTO 22 + FOR y2 = 0 TO 7 + FOR x2 = 0 TO 7 + c2 = font(x2, y2, d) + IF c2 > 0 THEN PSET (x1 + x2, y1 + y2), c + NEXT x2 + NEXT y2 +22 x1 = x1 + 8 + NEXT b + +END SUB + +SUB removeRedundancies (startIndex, endIndex, removalCount) + ' This procedure scans for parentheses that can be safely removed + ' without changing the logic of the expression, then removes them. + + DIM currentEnd, parenthesesCount + currentEnd = endIndex + parenthesesCount = 0 + + a = startIndex +26 IF logicalExpression(a) = 40 THEN + ' We found an opening parenthesis. Now let's see if it can be removed. + IF a = startIndex THEN p1 = 100 ELSE getOperatorPriority logicalExpression(a - 1), p1 + + c = a + d = 1 + p2 = 0 + +25 c = c + 1 + IF logicalExpression(c) = 40 THEN d = d + 1 + IF logicalExpression(c) = 41 THEN d = d - 1 + + ' Once d returns to 1, we are back to one level of parentheses, + ' meaning we can check operator priority inside. + IF d = 1 THEN + IF (logicalExpression(c) > 0) AND (logicalExpression(c) <= 5) THEN + getOperatorPriority logicalExpression(c), b + IF b > p2 THEN p2 = b + END IF + END IF + + IF d > 0 THEN GOTO 25 + + IF c + 1 > currentEnd THEN p3 = 100 ELSE getOperatorPriority logicalExpression(c + 1), p3 + + ' If the operator outside is higher priority than what's inside, + ' we can safely remove the parentheses. + IF (p1 > p2) AND (p3 >= p2) THEN + movM c, 1 + movM a, 1 + parenthesesCount = parenthesesCount + 2 + currentEnd = currentEnd - 2 + a = a - 1 + END IF + END IF + + a = a + 1 + IF a <= currentEnd THEN GOTO 26 + + removalCount = parenthesesCount +END SUB + +SUB sist +' Interacts with the user to input a logical equation +CLS +printText 0, 0, 3, 0, "Enter equation (ESC to quit) keys: 1 - " + CHR$(1) + " 2 - " + CHR$(2) + " 3 - " + CHR$(3) + " 4 - " + CHR$(4) + " 5 - " + CHR$(5) +printText 0, 1, 3, 0, "Example: a" + CHR$(1) + "b" + CHR$(2) + "(g" + CHR$(3) + "b)" + +FOR a = 0 TO 79 + logicalExpression(a) = 0 +NEXT a + +x = 0 +1 +FOR a = 0 TO 79 + IF a = x THEN printText a, 2, 14, 1, CHR$(logicalExpression(a)) ELSE printText a, 2, 3, 0, CHR$(logicalExpression(a)) +NEXT a +2 +a$ = INKEY$ +IF a$ = "" THEN GOTO 2 + +IF a$ = CHR$(27) THEN SYSTEM +IF a$ = CHR$(0) + "M" THEN x = x + 1 +IF a$ = CHR$(0) + "K" THEN x = x - 1 +IF x < 0 THEN x = 0 +IF x > 79 THEN x = 79 + +IF LEN(a$) = 1 THEN + SELECT CASE ASC(a$) + CASE 32, 40, 41, 65 TO 90, 97 TO 122 +3 + FOR a = 78 TO x STEP -1 + logicalExpression(a + 1) = logicalExpression(a) + NEXT a + logicalExpression(x) = ASC(a$) + x = x + 1 + CASE 8 + IF x > 0 THEN + FOR a = x - 1 TO 78 + logicalExpression(a) = logicalExpression(a + 1) + NEXT a + x = x - 1 + END IF + CASE 49 TO 53 + a$ = CHR$(ASC(a$) - 48) + GOTO 3 + CASE 13 + GOTO 4 + END SELECT +END IF + +GOTO 1 +4 + +END SUB + +SUB start +' Initializes the screen and font +prnp = 0 + +SCREEN 7 + +FOR a = 0 TO 122 + LOCATE 1, 1 + SELECT CASE a + CASE 7 + CASE 1 + LINE (0, 0)-(7, 7), 0, BF + LINE (2, 1)-(0, 3), 15 + LINE (1, 4)-(2, 5), 15 + LINE (5, 1)-(7, 3), 15 + LINE (6, 4)-(5, 5), 15 + LINE (1, 2)-(5, 2), 15 + LINE (1, 4)-(5, 4), 15 + + CASE 2 + LINE (0, 0)-(7, 7), 0, BF + LINE (5, 1)-(7, 3), 15 + LINE (6, 4)-(5, 5), 15 + LINE (1, 2)-(5, 2), 15 + LINE (1, 4)-(5, 4), 15 + + CASE 3 + LINE (0, 0)-(7, 7), 0, BF + LINE (0, 0)-(3, 7), 15 + LINE (6, 0)-(3, 7), 15 + + CASE 4 + LINE (0, 0)-(7, 7), 0, BF + LINE (0, 7)-(3, 0), 15 + LINE (6, 7)-(3, 0), 15 + + CASE 5 + LINE (0, 0)-(7, 7), 0, BF + LINE (0, 0)-(4, 0), 15 + LINE (4, 1)-(4, 7), 15 + + CASE ELSE + PRINT CHR$(a) + END SELECT + + FOR y = 0 TO 7 + FOR x = 0 TO 7 + font(x, y, a) = POINT(x, y) + NEXT x + NEXT y +NEXT a + +SCREEN 12 + +END SUB + +SUB tee (x1, x2) +' Processes the logical equation and applies logical operations +DIM opr(1 TO 2, 1 TO tehl) +ng = 0 +ngx = 0 +oprm = 1 +oe = 0 +oex = 0 + +FOR a = x1 TO x2 + b = logicalExpression(a) + SELECT CASE b + CASE 40 + c = a + d = 1 +10 + c = c + 1 + IF logicalExpression(c) = ASC("(") THEN d = d + 1 + IF logicalExpression(c) = ASC(")") THEN d = d - 1 + IF d = 0 THEN GOTO 11 + GOTO 10 +11 + tee a + 1, c - 1 + a = c + FOR c = 1 TO tehl + opr(oprm, c) = resultValues(c) + NEXT c + GOTO 12 + CASE 5 + ng = 1 + ngx = a + CASE 1 TO 4 + oe = b + oex = a + CASE 65 TO 90, 97 TO 122 + FOR c = 1 TO nm + IF variableNames(c) = b THEN d = c: GOTO 8 + NEXT c +8 + FOR c = 1 TO tehl + opr(oprm, c) = variableValues(d, c) + printText expressionPosition(a), c, 3, 0, CHR$(variableValues(d, c)) + NEXT c +12 + IF ng = 1 THEN GOSUB mkneg + IF oprm = 2 THEN + SELECT CASE oe + CASE 1 + FOR c = 1 TO tehl + d = opr(1, c) + e = opr(2, c) + IF d = e THEN f = ASC("t") ELSE f = ASC("v") + opr(1, c) = f + printText expressionPosition(oex), c, 12, 0, CHR$(f) + NEXT c + CASE 2 + FOR c = 1 TO tehl + d = opr(1, c) + e = opr(2, c) + f = ASC("t") + IF (d = ASC("t")) AND (e = ASC("v")) THEN f = ASC("v") + opr(1, c) = f + printText expressionPosition(oex), c, 12, 0, CHR$(f) + NEXT c + CASE 3 + FOR c = 1 TO tehl + d = opr(1, c) + e = opr(2, c) + f = ASC("t") + IF (d = ASC("v")) AND (e = ASC("v")) THEN f = ASC("v") + opr(1, c) = f + printText expressionPosition(oex), c, 12, 0, CHR$(f) + NEXT c + CASE 4 + FOR c = 1 TO tehl + d = opr(1, c) + e = opr(2, c) + f = ASC("v") + IF (d = ASC("t")) AND (e = ASC("t")) THEN f = ASC("t") + opr(1, c) = f + printText expressionPosition(oex), c, 12, 0, CHR$(f) + NEXT c + END SELECT + ELSE + oprm = oprm + 1 + END IF + END SELECT +NEXT a + +GOTO 9 + +mkneg: + ' NOT operation (negation) is applied to the current operand + FOR c = 1 TO tehl + d = opr(oprm, c) + IF d = ASC("t") THEN d = ASC("v") ELSE d = ASC("t") + printText expressionPosition(ngx), c, 4, 0, CHR$(d) + opr(oprm, c) = d + NEXT c + ng = 0 +RETURN +9 + +FOR c = 1 TO tehl + resultValues(c) = opr(1, c) +NEXT c +END SUB + +SUB teeslg (x1, x4, l) +' Prepares the logical equation for solving by simplifying expressions within parentheses +x2 = x4 +h = 0 +FOR e = 1 TO 4 + g = 1 + a = x1 +21 + b = logicalExpression(a) + IF b = 40 THEN + c = a + d = 1 +14 + c = c + 1 + IF logicalExpression(c) = ASC("(") THEN d = d + 1 + IF logicalExpression(c) = ASC(")") THEN d = d - 1 + IF d = 0 THEN GOTO 15 + GOTO 14 +15 + IF e = 1 THEN teeslg a + 1, c - 1, l ELSE l = 0 + a = c + l + x2 = x2 + l + h = h + l + GOTO 16 + END IF + + IF (b = 5) AND (e = 1) AND (g > 1) THEN + mov a, 1 + logicalExpression(a) = 40 + lendp a + 2, f + mov a + 2 + f, 1 + logicalExpression(a + 2 + f) = 41 + h = h + 2 + x2 = x2 + 2 + a = a + 2 + f + GOTO 16 + END IF + + IF (b = 3 OR b = 4) AND (e = 2) AND (g > 2) THEN + lendm a - 1, f + mov a - f, 1 + logicalExpression(a - f) = 40 + lendp a + 2, f + mov a + 2 + f, 1 + logicalExpression(a + 2 + f) = 41 + h = h + 2 + x2 = x2 + 2 + a = a + 2 + f + GOTO 16 + END IF + + IF (b = 2) AND (e = 3) AND (g > 3) THEN + lendm a - 1, f + mov a - f, 1 + logicalExpression(a - f) = 40 + lendp a + 2, f + mov a + 2 + f, 1 + logicalExpression(a + 2 + f) = 41 + h = h + 2 + x2 = x2 + 2 + a = a + 2 + f + GOTO 16 + END IF + + SELECT CASE b + CASE 5 + g = 1 + CASE 3, 4 + g = 2 + CASE 2 + g = 3 + CASE 1 + g = 4 + END SELECT +16 + a = a + 1 + IF a <= x2 THEN GOTO 21 +NEXT e +l = h +END SUB + diff --git a/Miscellaneous/4D engine/index.html b/Miscellaneous/4D engine/index.html new file mode 100644 index 0000000..67998b4 --- /dev/null +++ b/Miscellaneous/4D engine/index.html @@ -0,0 +1,22 @@ + +4D engine + + + +

4D engine

+
+
+Implementation of 4 dimensional (4D) engine. +It's like 3D but with additional extra dimension. + +It's possible to define objects from 4D polygons. +In 4D world minimum amount of points to define 4D +shape is 5. Each point will be defined by 4 coordinates (X, Y, Z, Q). + +You can rotate object around any axis +(4D world has 6 rotation axes!) +Program allows you to move along any dimension. + +
+ + \ No newline at end of file diff --git a/Miscellaneous/4D engine/qeng.bas b/Miscellaneous/4D engine/qeng.bas new file mode 100755 index 0000000..1f87299 --- /dev/null +++ b/Miscellaneous/4D engine/qeng.bas @@ -0,0 +1,350 @@ +' 4D engine. It renders a 5-cell (aka. pentachoron) as a series +' of 3D tetrahedrons with varying brightness. Brightness is used +' to indicate shift in the fourth dimension. +' +' In essence, you can look at a 3D object as a series of 2D +' cross-sections along the third dimension. Here we look at +' a 4D object as a series of 3D cross-sections with varying +' brightness (to distinguish between them). +' +' 4 dimensions also make it possible to rotate the object along +' 6 different axes. Interestingly, the shape of the object changes +' in 3D space when it is rotated along any of the axes that +' involve the fourth dimension. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003.08, Initial version +' 2024 - 2025, Improved program readability + +' Declare subroutines and functions that will be used in the program +DECLARE SUB CalculateInterpolatedLine (originalX1!, originalY1!, originalZ1!, originalQ1!, originalX2!, originalY2!, originalZ2!, originalQ2!) +DECLARE SUB RotatePoint (x1!, y1!, z1!, q1!, x4!, y4!, z4!, q4!) +DECLARE SUB SetupPalette () +DECLARE SUB GetPointAtDistance (x1!, y1!, z1!, q1!, x2!, y2!, z2!, q2!, distanceFactor!, rx!, ry!, rz!, rq!) +DECLARE SUB RenderPentachoron (ox1!, oy1!, oz1!, oq1!, ox2!, oy2!, oz2!, oq2!, ox3!, oy3!, oz3!, oq3!, ox4!, oy4!, oz4!, oq4!, ox5!, oy5!, oz5!, oq5!) +DECLARE FUNCTION CalculateDistance (x1!, y1!, z1!, q1!, x2!, y2!, z2!, q2!) + +' Shared variables that can be accessed from any subroutine +DIM SHARED screenSize +DIM SHARED angleXZ, angleYZ, angleXY, angleQX, angleQY, angleQZ +DIM SHARED cameraX, cameraY, cameraZ, cameraQ +DIM SHARED pi +DIM SHARED sineXZ, sineYZ, sineXY, sineQX, sineQY, sineQZ +DIM SHARED cosineXZ, cosineYZ, cosineXY, cosineQX, cosineQY, cosineQZ + +' Arrays to store projected points and other drawing information +DIM SHARED projectedX(1 TO 10) +DIM SHARED projectedY(1 TO 10) +DIM SHARED pointCount +DIM SHARED frame + +' Display control instructions to the user +PRINT "" +PRINT " Use keys:" +PRINT " Rotate:" +PRINT " qw - XZ" +PRINT " as - YZ" +PRINT " zx - XY" +PRINT " er - QX" +PRINT " df - QY" +PRINT " cv - QZ" +PRINT " Move:" +PRINT " 46 - x" +PRINT " 82 - y" +PRINT " 71 - z" +PRINT " -+ - q" +PRINT +PRINT " ESC - to quit program" +PRINT +PRINT " Press any key to continue..." +in$ = INPUT$(1) + +' Initialize pi value for rotation calculations +pi = 3.1415 + +' Initialize rotation angles for each axis +angleXZ = pi * .5 +angleYZ = angleXZ +angleXY = angleXZ +angleQX = angleXZ +angleQY = angleXZ +angleQZ = angleXZ + +' Set initial camera position in 4D space +cameraX = 0 +cameraY = 0 +cameraZ = 0 +cameraQ = .5 + +' Set graphics mode to 640x480 with 16 colors +SCREEN 12 +' Setup the color palette for rendering +SetupPalette + +MainLoop: +' Clear screen for new frame +CLS + +' Calculate sine and cosine values for each rotation angle +sineXZ = SIN(angleXZ): cosineXZ = COS(angleXZ) +sineYZ = SIN(angleYZ): cosineYZ = COS(angleYZ) +sineXY = SIN(angleXY): cosineXY = COS(angleXY) +sineQX = SIN(angleQX): cosineQX = COS(angleQX) +sineQY = SIN(angleQY): cosineQY = COS(angleQY) +sineQZ = SIN(angleQZ): cosineQZ = COS(angleQZ) + +' Render multiple frames of the pentachoron with varying depth +FOR frame = 1 TO 15 STEP 3 + ' Render a pentachoron (5-cell) with the current camera position and rotation + RenderPentachoron -10, -10, -10, 0, 10, -10, -10, 0, 0, -10, 10, 0, 0, 10, 0, 0, 0, 0, 0, 10 +NEXT frame + +' Get user input for camera control +in$ = INPUT$(1) + +' Handle user input for rotation and movement +SELECT CASE in$ +CASE CHR$(27) + ' ESC key pressed - exit program + SYSTEM +CASE "q" + ' Increase rotation angle along XZ axis + angleXZ = angleXZ + .1 +CASE "w" + ' Decrease rotation angle along XZ axis + angleXZ = angleXZ - .1 +CASE "a" + ' Increase rotation angle along YZ axis + angleYZ = angleYZ + .1 +CASE "s" + ' Decrease rotation angle along YZ axis + angleYZ = angleYZ - .1 +CASE "z" + ' Increase rotation angle along XY axis + angleXY = angleXY + .1 +CASE "x" + ' Decrease rotation angle along XY axis + angleXY = angleXY - .1 +CASE "e" + ' Increase rotation angle along QX axis + angleQX = angleQX + .1 +CASE "r" + ' Decrease rotation angle along QX axis + angleQX = angleQX - .1 +CASE "d" + ' Increase rotation angle along QY axis + angleQY = angleQY + .1 +CASE "f" + ' Decrease rotation angle along QY axis + angleQY = angleQY - .1 +CASE "c" + ' Increase rotation angle along QZ axis + angleQZ = angleQZ + .1 +CASE "v" + ' Decrease rotation angle along QZ axis + angleQZ = angleQZ - .1 + +' Handle user input for movement in the 4D space +CASE "4" + ' Move camera left along X axis + cameraX = cameraX - 3 +CASE "6" + ' Move camera right along X axis + cameraX = cameraX + 3 +CASE "8" + ' Move camera forward along Z axis + cameraZ = cameraZ + 3 +CASE "2" + ' Move camera backward along Z axis + cameraZ = cameraZ - 3 +CASE "7" + ' Move camera up along Y axis + cameraY = cameraY + 3 +CASE "1" + ' Move camera down along Y axis + cameraY = cameraY - 3 +CASE "+" + ' Move camera forward along Q axis (4th dimension) + cameraQ = cameraQ + .3 +CASE "-" + ' Move camera backward along Q axis (4th dimension) + cameraQ = cameraQ - .3 + +END SELECT + +' Loop back to render next frame +GOTO MainLoop + +' Function to calculate the distance between two points in 4D space +FUNCTION CalculateDistance (x1, y1, z1, q1, x2, y2, z2, q2) + ' Calculate Euclidean distance in 4D space + CalculateDistance = SQR((x1 - x2) ^ 2 + (y1 - y2) ^ 2 + (z1 - z2) ^ 2 + (q1 - q2) ^ 2) +END FUNCTION + +' Subroutine to calculate the linear interpolation between two points +SUB CalculateInterpolatedLine (originalX1, originalY1, originalZ1, originalQ1, originalX2, originalY2, originalZ2, originalQ2) + ' Local variables to store coordinates of the two points + x1 = originalX1: y1 = originalY1: z1 = originalZ1: q1 = originalQ1 + x2 = originalX2: y2 = originalY2: z2 = originalZ2: q2 = originalQ2 + + ' If the first point is in front of the camera and the second is behind, + ' swap them to ensure proper rendering order + IF (q1 > cameraQ) AND (q2 < cameraQ) THEN + SWAP x1, x2 + SWAP y1, y2 + SWAP z1, z2 + SWAP q1, q2 + END IF + + ' If the first point is in front of the camera and the second is behind, + ' calculate the intersection point where the line segment crosses the camera plane + IF (q1 < cameraQ) AND (q2 > cameraQ) THEN + ' Calculate the difference in Q coordinates + qDifference = q2 - q1 + ' Calculate how far along the line segment we need to go to reach the camera plane + qToCamera = cameraQ - q1 + ' Calculate the interpolation factor + interpolationFactor = qToCamera / qDifference + ' Increment point counter + pointCount = pointCount + 1 + ' Calculate interpolated coordinates + interpolatedX = (x2 - x1) * interpolationFactor + x1 + interpolatedY = (y2 - y1) * interpolationFactor + y1 + interpolatedZ = (z2 - z1) * interpolationFactor + z1 + 50 + ' Project 3D coordinates to 2D screen coordinates and store them + projectedX(pointCount) = interpolatedX / interpolatedZ * 700 + 320 + projectedY(pointCount) = interpolatedY / interpolatedZ * 700 + 240 + END IF +END SUB + +' Subroutine to get a point at a specific distance along the line segment +SUB GetPointAtDistance (x1, y1, z1, q1, x2, y2, z2, q2, distanceFactor, rx, ry, rz, rq) + ' Calculate the vector between the two points + xVector = x2 - x1 + yVector = y2 - y1 + zVector = z2 - z1 + qVector = q2 - q1 + + ' Calculate the coordinates of the point at the specified distance along the line segment + rx = x1 + (xVector * distanceFactor) + ry = y1 + (yVector * distanceFactor) + rz = z1 + (zVector * distanceFactor) + rq = q1 + (qVector * distanceFactor) +END SUB + +' Subroutine to render a 3D tetrahedron with varying brightness +SUB RenderPentachoron (originalX1, originalY1, originalZ1, originalQ1, originalX2, originalY2, originalZ2, originalQ2, originalX3, originalY3, originalZ3, originalQ3, originalX4, originalY4, originalZ4, originalQ4, originalX5, originalY5, originalZ5 _ +, originalQ5) + + ' Adjust coordinates based on camera position and frame depth + originalX1 = originalX1 - cameraX + originalY1 = originalY1 - cameraY + originalZ1 = originalZ1 - cameraZ + originalQ1 = originalQ1 - cameraQ - frame + + originalX2 = originalX2 - cameraX + originalY2 = originalY2 - cameraY + originalZ2 = originalZ2 - cameraZ + originalQ2 = originalQ2 - cameraQ - frame + + originalX3 = originalX3 - cameraX + originalY3 = originalY3 - cameraY + originalZ3 = originalZ3 - cameraZ + originalQ3 = originalQ3 - cameraQ - frame + + originalX4 = originalX4 - cameraX + originalY4 = originalY4 - cameraY + originalZ4 = originalZ4 - cameraZ + originalQ4 = originalQ4 - cameraQ - frame + + originalX5 = originalX5 - cameraX + originalY5 = originalY5 - cameraY + originalZ5 = originalZ5 - cameraZ + originalQ5 = originalQ5 - cameraQ - frame + + ' Rotate all points based on current rotation angles + RotatePoint originalX1, originalY1, originalZ1, originalQ1, x1, y1, z1, q1 + RotatePoint originalX2, originalY2, originalZ2, originalQ2, x2, y2, z2, q2 + RotatePoint originalX3, originalY3, originalZ3, originalQ3, x3, y3, z3, q3 + RotatePoint originalX4, originalY4, originalZ4, originalQ4, x4, y4, z4, q4 + RotatePoint originalX5, originalY5, originalZ5, originalQ5, x5, y5, z5, q5 + + ' Initialize point counter + pointCount = 0 + + ' Calculate interpolated points for all edges of the pentachoron + CalculateInterpolatedLine x1, y1, z1, q1, x2, y2, z2, q2 + CalculateInterpolatedLine x1, y1, z1, q1, x3, y3, z3, q3 + CalculateInterpolatedLine x1, y1, z1, q1, x4, y4, z4, q4 + CalculateInterpolatedLine x1, y1, z1, q1, x5, y5, z5, q5 + + CalculateInterpolatedLine x2, y2, z2, q2, x3, y3, z3, q3 + CalculateInterpolatedLine x2, y2, z2, q2, x4, y4, z4, q4 + CalculateInterpolatedLine x2, y2, z2, q2, x5, y5, z5, q5 + + CalculateInterpolatedLine x3, y3, z3, q3, x4, y4, z4, q4 + CalculateInterpolatedLine x3, y3, z3, q3, x5, y5, z5, q5 + + CalculateInterpolatedLine x4, y4, z4, q4, x5, y5, z5, q5 + + ' Draw lines between each pair of interpolated points + FOR pointA = 1 TO pointCount + FOR pointB = pointA + 1 TO pointCount + ' Draw line with color based on frame depth (for varying brightness) + LINE (projectedX(pointA), projectedY(pointA))-(projectedX(pointB), projectedY(pointB)), 15 - frame + NEXT pointB + NEXT pointA + +END SUB + +' Subroutine to rotate a point along the specified axes +SUB RotatePoint (x1, y1, z1, q1, x4, y4, z4, q4) + + ' Rotate the point along the QX axis + q2 = q1 * sineQX - x1 * cosineQX + x2 = q1 * cosineQX + x1 * sineQX + + ' Rotate the point along the QY axis + q3 = q2 * sineQY - y1 * cosineQY + y2 = q2 * cosineQY + y1 * sineQY + + ' Rotate the point along the QZ axis + q4 = q3 * sineQZ - z1 * cosineQZ + z2 = q3 * cosineQZ + z1 * sineQZ + + ' Rotate the point along the XZ axis + x3 = x2 * sineXZ - z2 * cosineXZ + z3 = x2 * cosineXZ + z2 * sineXZ + + ' Rotate the point along the YZ axis + y3 = y2 * sineYZ - z3 * cosineYZ + z4 = y2 * cosineYZ + z3 * sineYZ + + ' Rotate the point along the XY axis + y4 = y3 * sineXY - x3 * cosineXY + x4 = y3 * cosineXY + x3 * sineXY + +END SUB + +' Subroutine to set up the color palette +SUB SetupPalette + + ' Set up a grayscale color palette + FOR colorIndex = 0 TO 15 + ' Set palette register + OUT &H3C8, colorIndex + ' Set RGB values (all equal for grayscale) + OUT &H3C9, colorIndex * 4 + OUT &H3C9, colorIndex * 4 + OUT &H3C9, colorIndex * 4 + ' Draw a vertical line with this color to visualize the palette + LINE (colorIndex, 0)-(colorIndex, 400), colorIndex + NEXT colorIndex + +END SUB + diff --git a/Miscellaneous/4D engine/sshot.png b/Miscellaneous/4D engine/sshot.png new file mode 100644 index 0000000..03e6e3e Binary files /dev/null and b/Miscellaneous/4D engine/sshot.png differ diff --git a/Miscellaneous/Alien font.bas b/Miscellaneous/Alien font.bas new file mode 100644 index 0000000..cdbc6fc --- /dev/null +++ b/Miscellaneous/Alien font.bas @@ -0,0 +1,112 @@ +' Program attempts to render imaginary alien text. +' Text is composed by subdividing square into 4 triangles. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2001, Initial version. +' 2024.08, Improved code readability. + +DEFINT A-Z + +' Declare the subroutine which will draw a character at a given position with a given size and color +DECLARE SUB DrawCharacter (characterX, characterY, characterColor, CharacterSize) + +' Define shared array for colors +DIM SHARED characterColors(1 TO 4) AS INTEGER + +' Initialize the color palette +characterColors(1) = 7 ' LightGray +characterColors(2) = 7 ' LightGray +characterColors(3) = 0 ' Black +characterColors(4) = 0 ' Black + +' Set the screen mode and seed the random number generator +SCREEN 12 +RANDOMIZE TIMER + +' Clear the screen with black color +PAINT (1, 1), 0 + +' Define the size of each character +CONST CharacterSize = 4 + +' Initialize counters for drawing characters +DIM tmp AS INTEGER +tmp = 0 + +' Outer loop for vertical positioning of characters +FOR characterY = 1 TO 480 - CharacterSize - 2 STEP CharacterSize + (CharacterSize \ 2) + DIM tmp1 AS INTEGER + tmp1 = 0 + + ' Inner loop for horizontal positioning of characters + FOR characterX = 1 TO 640 - CharacterSize - 2 STEP CharacterSize + (CharacterSize \ 2) + ' Draw a character with random color and specified size at the current position + CALL DrawCharacter(characterX, characterY, INT(RND * 16), CharacterSize) + + ' Increment the inner loop counter + tmp1 = tmp1 + 1 + + ' Add spaces to emulate visual character clusters + IF tmp1 > 20 THEN + tmp1 = 0 + characterX = characterX + (CharacterSize) + END IF + NEXT characterX + + ' Increment the outer loop counter + tmp = tmp + 1 + + ' Add space to group caracters visually into clusters + IF tmp > 5 THEN + tmp = 0 + characterY = characterY + (CharacterSize) + END IF +NEXT characterY + +' Subroutine to draw a character at a given position with a given size and color +SUB DrawCharacter (characterX AS INTEGER, characterY AS INTEGER, characterColor AS INTEGER, CharacterSize AS INTEGER) + ' Calculate half the size of the character for drawing diagonals + DIM halfSize AS INTEGER + halfSize = CharacterSize \ 2 + + ' Randomly select a color from the palette + DIM randomColor AS INTEGER + randomColor = characterColors(INT(RND * 3) + 1) + + ' Draw the top horizontal line and diagonals of the character + LINE (characterX, characterY)-(characterX + CharacterSize, characterY), randomColor + LINE (characterX, characterY)-(characterX + halfSize, characterY + halfSize), randomColor + LINE (characterX + CharacterSize, characterY)-(characterX + halfSize, characterY + halfSize), randomColor + ' Fill the top right corner of the character + PAINT (characterX + 2, characterY + 1), randomColor + + ' Draw the left vertical line and diagonals of the character + randomColor = characterColors(INT(RND * 3) + 1) + LINE (characterX, characterY)-(characterX, characterY + CharacterSize), randomColor + LINE (characterX, characterY)-(characterX + halfSize, characterY + halfSize), randomColor + LINE (characterX, characterY + CharacterSize)-(characterX + halfSize, characterY + halfSize), randomColor + ' Fill the middle left of the character + PAINT (characterX + 1, characterY + 2), randomColor + + ' Draw the right vertical line and diagonals of the character + randomColor = characterColors(INT(RND * 3) + 1) + LINE (characterX + CharacterSize, characterY)-(characterX + CharacterSize, characterY + CharacterSize), randomColor + LINE (characterX + CharacterSize, characterY)-(characterX + halfSize, characterY + halfSize), randomColor + LINE (characterX + CharacterSize, characterY + CharacterSize)-(characterX + halfSize, characterY + halfSize), randomColor + ' Fill the middle right of the character + PAINT (characterX + CharacterSize - 1, characterY + 2), randomColor + + ' Draw the bottom horizontal line and diagonals of the character + randomColor = characterColors(INT(RND * 3) + 1) + LINE (characterX, characterY + CharacterSize)-(characterX + CharacterSize, characterY + CharacterSize), randomColor + LINE (characterX, characterY + CharacterSize)-(characterX + halfSize, characterY + halfSize), randomColor + LINE (characterX + CharacterSize, characterY + CharacterSize)-(characterX + halfSize, characterY + halfSize), randomColor + ' Fill the bottom left corner of the character + PAINT (characterX + 2, characterY + CharacterSize - 1), randomColor +END SUB + diff --git a/Miscellaneous/Alien font.png b/Miscellaneous/Alien font.png new file mode 100644 index 0000000..ec7e817 Binary files /dev/null and b/Miscellaneous/Alien font.png differ diff --git a/Miscellaneous/Automated school clock/v1/Electronics/1.png b/Miscellaneous/Automated school clock/v1/Electronics/1.png new file mode 100644 index 0000000..798fdf3 Binary files /dev/null and b/Miscellaneous/Automated school clock/v1/Electronics/1.png differ diff --git a/Miscellaneous/Automated school clock/v1/Electronics/2.png b/Miscellaneous/Automated school clock/v1/Electronics/2.png new file mode 100644 index 0000000..f998b57 Binary files /dev/null and b/Miscellaneous/Automated school clock/v1/Electronics/2.png differ diff --git a/Miscellaneous/Automated school clock/v1/Electronics/3 key keyboard.png b/Miscellaneous/Automated school clock/v1/Electronics/3 key keyboard.png new file mode 100644 index 0000000..4c70f99 Binary files /dev/null and b/Miscellaneous/Automated school clock/v1/Electronics/3 key keyboard.png differ diff --git a/Miscellaneous/Automated school clock/v1/Electronics/3.png b/Miscellaneous/Automated school clock/v1/Electronics/3.png new file mode 100644 index 0000000..73df687 Binary files /dev/null and b/Miscellaneous/Automated school clock/v1/Electronics/3.png differ diff --git a/Miscellaneous/Automated school clock/v1/Electronics/4.png b/Miscellaneous/Automated school clock/v1/Electronics/4.png new file mode 100644 index 0000000..1109bba Binary files /dev/null and b/Miscellaneous/Automated school clock/v1/Electronics/4.png differ diff --git a/Miscellaneous/Automated school clock/v1/Electronics/skeem.png b/Miscellaneous/Automated school clock/v1/Electronics/skeem.png new file mode 100644 index 0000000..3c93169 Binary files /dev/null and b/Miscellaneous/Automated school clock/v1/Electronics/skeem.png differ diff --git a/Miscellaneous/Automated school clock/v1/README.html b/Miscellaneous/Automated school clock/v1/README.html new file mode 100644 index 0000000..d7dc1d0 --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/README.html @@ -0,0 +1,473 @@ + + + +juhend + + + + + + + + + + + + + +
+

juhend

+

+Kooli Kell programmi kasutusjuhend +

+ +
    +
  • 2002.10 +
  • +
  • Svjatoslav Agejenko +
  • +
+ + +
+

1 Kasutajaliides

+
+

+Programm Kooli Kell on mõldud kella laskmiseks koolis, tundi sisse ja +välja. Samuti juhib programm arvuti küljes olevat liidest, +kahekohaliste numbrite näitamiseks (minutid / tunnid), 3 klahvilist +klaviatuuri ja releed. Tundi sisse minev kell on 1 pikk ning 1 l”em +helin. Väljaminev kell on 1 tavaline pikk helin. Programm loeb aega +arvuti süsteemsest kellast. Kella laskmis ajad on organiseeritud +failidesse *.PP . Aasta või päevaplaani muutmiseks tuleb redakteerida +vastavaid faile. Programm valib sobiva päevaplaani lähtudes +aastaplaanist, mis asub failis "aasta.ap" . Programmi saab kasutada +arvutil millele on printeri pesasse (LPT1) ”endatud spetsiaalne +liides, liidese skeem on failis "skeem.bmp". Liides omab kolme +nummerdatud nuppu paigutusega: +

+ +

+<1> <2>
+   <3>
+

+ +

+Programm on ettenähtud iseseisvalt töötama, kuid on ka võimalus +erandkorras kгitsi kella lasta, aega muuta jne.. Programm eristab +tavalisi nupuvajutusi ja topeltklõpse. Eesmärgiga suurendada +funktsionaalsust väheste nuppudega. +

+
+ +
+

1.1 Nuppude funktsioonid peamenüüs:

+
+
+
<1> klõps
laseb kella tundi sisse +
+
<1> topeltklõps
laseb kella tunnist välja +
+ +
<2> klõps
läheb aja muutmis menüüsse +
+
<3> topeltklõps
hakkab tööle uuendatud graafikuga, vajalik pвast +sisendfailide redigeerimist. +
+ +
<3> klõps
ümardab süsteemse aja täistunnini, vajalik aja +sünkroniseerimiseks. +
+
<3> topeltklõps
laeb süsteemse: aasta, kuu, päeva, tunnid, +minutid failist "sync.txt" +
+
+
+
+ +
+

1.2 Nuppude funktsioonid aja muutmis menüüs:

+
+
+
<1> klõps
vähendab süsteemsed tunnid/minutid 1. võrra +
+ +
<2> klõps
suurendab süsteemsed tunnid/minutid 1. võrra +
+ +
<3> klõps
valib näitamiseks ja redigeerimiseks tunnid või minutid. +
+
<3> topeltklõps
läheb tagasi peamenüüsse. +
+
+ +

+Aja muutmis menüüd tunneb ära selle järgi et indikaator tunnid või +minutid vilgub, mitte ei põle nagu peamenüüs. +

+
+
+
+ + +
+

2 Faili AASTA.AP formaat: (aastaplaan)

+
+
+v       <kuu>-<päev>     <kuu>-<päev>     <päevaplaan>
+
+ +

+Sõnast aja vahemik. Paneb paika päevaplaani antud +ajavahemikus. Esimene daatum peab kindlasti olema väiksem kui +teine. St. kui on tõesti vaja: +

+ +
+v       10-4    2-1     eri
+
+ +

+tuleb kirjutada: +

+ +
+v       10-4    12-31   eri
+v       1-1     2-1     eri
+
+ +

+Päevaplaan kehtib vahemiku esimesest päevast kuni vahemiku viimase +päevani. +

+ + +
+n       <kuu>-<päev>     <kuu>-<päev>     <nädalapäev>      <päevaplaan>
+
+ +

+Sõnast nädalapäv. sama mis "v" kuid: paneb paika päevaplaani antud +ajavahemikus, antud nädalapäeval. Nädalapäeva kirjeldatakse numbriga. +nädala esimene päev on esmaspäev, talle vastab number 1. +

+ + +
+e       <kuu>-<päev> <päevaplaan>
+
+ +

+Sõnast eriline. Paneb paika antud kuupävale antud pävaplaani. Sobib +hästi erakorraliste lüendatud või muul moel muudetud päevaplaanide +kehtestamiseks. Näiteks riigipühad, spordipäev jne. +

+ +

+Kui teatud päeva kohta ei käinud ühtegi kirjet siis toimib vaikimisi +"tuhi" päevaplaan. Kui teatud päeva kohta käis mitu kirjet siis jääb +peale viimane. +

+
+
+ + + +
+

3 Failide *.PP formaat: (päevaplaanid)

+
+
+# <tund>:<minut>  <kell>
+
+ +

+Laseb antud ajal antud kella. Võimalikud kella helinad on: +

+ + + + +++ ++ + + + + + + + + + + + + + + + + + +
kella koodvastav helin
siskell tundi sisse
valkell tunnist välja
+
+
+ +
+

4 Faili SYNC.TXT formaat:

+
+

+faili esimesel kahel real peab olema järgnev: +

+ +
+KK-PP-AAAA
+TT:MM
+
+ +

+kus: +

+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
koodtähendus
KKkuu
PPpäev
AAAAaasta
TTtunnid
MMminutid
+
+
+
+
+

Author: Svjatoslav Agejenko

+

Created: 2018-04-20 Fri 11:08

+

Emacs 25.1.1 (Org-mode 8.2.10)

+
+
+ + diff --git a/Miscellaneous/Automated school clock/v1/README.org b/Miscellaneous/Automated school clock/v1/README.org new file mode 100644 index 0000000..b153ade --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/README.org @@ -0,0 +1,115 @@ +Kooli Kell programmi kasutusjuhend + +- 2002.10 +- Svjatoslav Agejenko + + +* Kasutajaliides +Programm Kooli Kell on mõldud kella laskmiseks koolis, tundi sisse ja +välja. Samuti juhib programm arvuti küljes olevat liidest, +kahekohaliste numbrite näitamiseks (minutid / tunnid), 3 klahvilist +klaviatuuri ja releed. Tundi sisse minev kell on 1 pikk ning 1 l”em +helin. Väljaminev kell on 1 tavaline pikk helin. Programm loeb aega +arvuti süsteemsest kellast. Kella laskmis ajad on organiseeritud +failidesse *.PP . Aasta või päevaplaani muutmiseks tuleb redakteerida +vastavaid faile. Programm valib sobiva päevaplaani lähtudes +aastaplaanist, mis asub failis "aasta.ap" . Programmi saab kasutada +arvutil millele on printeri pesasse (LPT1) ”endatud spetsiaalne +liides, liidese skeem on failis "skeem.bmp". Liides omab kolme +nummerdatud nuppu paigutusega: + +#+BEGIN_VERSE + <1> <2> + <3> +#+END_VERSE + +Programm on ettenähtud iseseisvalt töötama, kuid on ka võimalus +erandkorras kгitsi kella lasta, aega muuta jne.. Programm eristab +tavalisi nupuvajutusi ja topeltklõpse. Eesmärgiga suurendada +funktsionaalsust väheste nuppudega. + +** Nuppude funktsioonid peamenüüs: + ++ <1> klõps :: laseb kella tundi sisse ++ <1> topeltklõps :: laseb kella tunnist välja + ++ <2> klõps :: läheb aja muutmis menüüsse ++ <3> topeltklõps :: hakkab tööle uuendatud graafikuga, vajalik pвast + sisendfailide redigeerimist. + ++ <3> klõps :: ümardab süsteemse aja täistunnini, vajalik aja + sünkroniseerimiseks. ++ <3> topeltklõps :: laeb süsteemse: aasta, kuu, päeva, tunnid, + minutid failist "sync.txt" + +** Nuppude funktsioonid aja muutmis menüüs: + ++ <1> klõps :: vähendab süsteemsed tunnid/minutid 1. võrra + ++ <2> klõps :: suurendab süsteemsed tunnid/minutid 1. võrra + ++ <3> klõps :: valib näitamiseks ja redigeerimiseks tunnid või minutid. ++ <3> topeltklõps :: läheb tagasi peamenüüsse. + +Aja muutmis menüüd tunneb ära selle järgi et indikaator tunnid või +minutid vilgub, mitte ei põle nagu peamenüüs. + +* Faili AASTA.AP formaat: (aastaplaan) +: v - - + +Sõnast aja vahemik. Paneb paika päevaplaani antud +ajavahemikus. Esimene daatum peab kindlasti olema väiksem kui +teine. St. kui on tõesti vaja: + +: v 10-4 2-1 eri + +tuleb kirjutada: + +: v 10-4 12-31 eri +: v 1-1 2-1 eri + +Päevaplaan kehtib vahemiku esimesest päevast kuni vahemiku viimase +päevani. + + +: n - - + +Sõnast nädalapäv. sama mis "v" kuid: paneb paika päevaplaani antud +ajavahemikus, antud nädalapäeval. Nädalapäeva kirjeldatakse numbriga. +nädala esimene päev on esmaspäev, talle vastab number 1. + + +: e - + +Sõnast eriline. Paneb paika antud kuupävale antud pävaplaani. Sobib +hästi erakorraliste lüendatud või muul moel muudetud päevaplaanide +kehtestamiseks. Näiteks riigipühad, spordipäev jne. + +Kui teatud päeva kohta ei käinud ühtegi kirjet siis toimib vaikimisi +"tuhi" päevaplaan. Kui teatud päeva kohta käis mitu kirjet siis jääb +peale viimane. + +* Failide *.PP formaat: (päevaplaanid) +: # : + +Laseb antud ajal antud kella. Võimalikud kella helinad on: + +| kella kood | vastav helin | +|------------+--------------------| +| sis | kell tundi sisse | +| val | kell tunnist välja | + +* Faili SYNC.TXT formaat: +faili esimesel kahel real peab olema järgnev: + +: KK-PP-AAAA +: TT:MM + +kus: +| kood | tähendus | +|------+----------| +| KK | kuu | +| PP | päev | +| AAAA | aasta | +| TT | tunnid | +| MM | minutid | diff --git a/Miscellaneous/Automated school clock/v1/aasta.ap b/Miscellaneous/Automated school clock/v1/aasta.ap new file mode 100644 index 0000000..ef1b084 --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/aasta.ap @@ -0,0 +1,7 @@ +v 01-01 12-31 tava +n 01-01 12-31 5 reede +e 10-04 opetajap +e 10-31 rebased +n 01-01 12-31 6 tuhi +n 01-01 12-31 7 tuhi + diff --git a/Miscellaneous/Automated school clock/v1/autoexec.bat b/Miscellaneous/Automated school clock/v1/autoexec.bat new file mode 100755 index 0000000..cd7ae3c --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/autoexec.bat @@ -0,0 +1,2 @@ +coff +qb /run kk.bas \ No newline at end of file diff --git a/Miscellaneous/Automated school clock/v1/coff.asm b/Miscellaneous/Automated school clock/v1/coff.asm new file mode 100644 index 0000000..0466c15 --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/coff.asm @@ -0,0 +1,4 @@ +mov dx, 37Ah +mov al, 0 +out dx, al +ret \ No newline at end of file diff --git a/Miscellaneous/Automated school clock/v1/coff.com b/Miscellaneous/Automated school clock/v1/coff.com new file mode 100755 index 0000000..2537f6d Binary files /dev/null and b/Miscellaneous/Automated school clock/v1/coff.com differ diff --git a/Miscellaneous/Automated school clock/v1/ekr.bas b/Miscellaneous/Automated school clock/v1/ekr.bas new file mode 100755 index 0000000..67ac754 --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/ekr.bas @@ -0,0 +1,70 @@ +DECLARE SUB jooks () +DECLARE SUB suva () +DECLARE SUB display () +DECLARE SUB clearBits () +DEFINT A-Z +DIM SHARED bit(0 TO 16) + +suva +jooks + +clearBits +bit(10) = 0 +bit(14) = 0 +bit(6) = 0 +bit(2) = 0 +4 +GOTO 4 + +SUB clearBits +' This subroutine initializes all bits in the bit array to 1 +FOR a = 1 TO 16 + bit(a) = 1 +NEXT a + +END SUB + +SUB display +' This subroutine displays the current state of the bit array using LPT attached display +prt = &H378 +d = 0 +FOR a = 0 TO 3 + c = 2 ^ a + FOR b = 4 TO 7 + d = d + 1 + c = c + (bit(d) * 2 ^ b) + NEXT b + + OUT prt, c +NEXT a +END SUB + +SUB jooks +' This subroutine demonstrates a simple counting +2 +clearBits +FOR a = 1 TO 16 + bit(16) = 1 ' Set the most significant bit to 1 + bit(a - 1) = 1 ' Set the previous bit to 1 + bit(a) = 0 ' Clear the current bit + PRINT a + FOR b = 1 TO 1000 + display + NEXT b +NEXT a +GOTO 2 +END SUB + +SUB suva +' This subroutine demonstrates a simple random bit setting algorithm +3 +clearBits +FOR b = 1 TO 16 + IF RND * 100 > 50 THEN bit(b) = 0 ' Randomly set bits to 0 +NEXT b +FOR b = 1 TO 100 + display +NEXT b +GOTO 3 +END SUB + diff --git a/Miscellaneous/Automated school clock/v1/kk.bas b/Miscellaneous/Automated school clock/v1/kk.bas new file mode 100755 index 0000000..14883f8 --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/kk.bas @@ -0,0 +1,699 @@ +' Program allows scheduling school clock ringing. +' Timetables are stored in separate files. +' Also it drives numerical 2 digit led display through parallel LPT printer port. +' Program is driven by special 3 button keyboard that is also attached to LPT port. + +DECLARE SUB num (a%) +DECLARE SUB mntime () +DECLARE SUB showit () +DECLARE SUB ekrf (a%) +DECLARE SUB ekr () +DECLARE SUB rese () +DECLARE SUB start () +DECLARE SUB boot () +DECLARE SUB getnad (g%, n%, d%, k%) +DECLARE SUB initp (b$) +DECLARE SUB getmd (a$, m, d) +DECLARE SUB son (a$) +DEFINT A-Z + +DECLARE SUB inita () +DECLARE SUB chm () +DECLARE SUB chd () +DECLARE SUB kell (a%) +DECLARE SUB sync2 () +DECLARE SUB sync () +DECLARE SUB mnmain () +DECLARE SUB main () +DECLARE SUB getkey (kla%) +DECLARE SUB klnait (k%) +DECLARE SUB heli (a%) +DECLARE SUB keys () +DECLARE SUB disp () +DIM SHARED bit(0 TO 7) +DIM SHARED kl +DIM SHARED hist(1 TO 3) +DIM SHARED ap$(1 TO 500) +DIM SHARED apl +DIM SHARED pp$(1 TO 500) +DIM SHARED ppl +DIM SHARED prt, prt2 +DIM SHARED timo$ +DIM SHARED dato$ +DIM SHARED sona$(1 TO 50) +DIM SHARED mitus +DIM SHARED lp$ +DIM SHARED ndlp +DIM SHARED pn$(1 TO 7) +DIM SHARED bitt(1 TO 16) +DIM SHARED modee, vilgu +DIM SHARED tul(1 TO 2) + +start +heli 4 + +disp +mnmain + +SUB chd +b$ = "tuhi" +IF apl = 0 THEN inita + +a$ = DATE$ +n1 = VAL(RIGHT$(a$, 4)) +n2 = VAL(LEFT$(a$, 2)) +a$ = LEFT$(a$, 5) +n3 = VAL(RIGHT$(a$, 2)) +getnad n1, n2, n3, ndlp +LOCATE 10, 1 +PRINT "Week plan:", pn$(ndlp) +FOR a = 1 TO apl +son ap$(a) +SELECT CASE sona$(1) +CASE "v" +getmd sona$(2), m1, d1 +getmd sona$(3), m2, d2 +getmd DATE$, m3, d3 +IF m3 < m1 THEN GOTO 9 +IF m3 > m2 THEN GOTO 9 +IF m3 = m1 THEN IF d3 < d1 THEN GOTO 9 +IF m3 = m2 THEN IF d3 > d2 THEN GOTO 9 +b$ = sona$(4) +CASE "n" +getmd sona$(2), m1, d1 +getmd sona$(3), m2, d2 +getmd DATE$, m3, d3 +IF m3 < m1 THEN GOTO 9 +IF m3 > m2 THEN GOTO 9 +IF m3 = m1 THEN IF d3 < d1 THEN GOTO 9 +IF m3 = m2 THEN IF d3 > d2 THEN GOTO 9 +IF ndlp <> VAL(sona$(4)) THEN GOTO 9 +b$ = sona$(5) +CASE "e" +getmd sona$(2), m1, d1 +getmd DATE$, m2, d2 +IF (m1 = m2) AND (d1 = d2) THEN b$ = sona$(3) +END SELECT +9 +NEXT a + +IF b$ <> lp$ THEN initp b$ +lp$ = b$ +LOCATE 9, 1 +PRINT "Day plan:", lp$ +END SUB + +SUB chm +showit +a$ = DATE$ +IF a$ <> dato$ THEN chd +dato$ = a$ +b = 0 +FOR a = 1 TO ppl +son pp$(a) +SELECT CASE sona$(1) +CASE "#" +getmd sona$(2), h1, m1 +getmd TIME$, h2, m2 +' PRINT h1, m1, h2, m2 +IF (h2 = h1) AND (m2 = m1) THEN +IF sona$(3) = "sis" THEN b = 1 +IF sona$(3) = "val" THEN b = 2 +END IF +END SELECT +NEXT a + +IF b > 0 THEN kell b + +END SUB + +SUB disp +CLS +PRINT "Kooli Kell v 1.2 2002.10.10" +PRINT "Programmi autor Svjatoslav Agejenko" + +END SUB + +SUB ekr +FOR e = 1 TO 10 +c = 1 +c = c + 16 * bitt(1) +c = c + 32 * bitt(2) +c = c + 64 * bitt(3) +c = c + 128 * bitt(4) +OUT prt2, c + +c = 2 +c = c + 16 * bitt(5) +c = c + 32 * bitt(6) +c = c + 64 * bitt(7) +c = c + 128 * bitt(8) +OUT prt2, c + +c = 4 +c = c + 16 * bitt(9) +c = c + 32 * bitt(10) +c = c + 64 * bitt(11) +c = c + 128 * bitt(12) +OUT prt2, c + +c = 8 +c = c + 16 * bitt(13) +c = c + 32 * bitt(14) +c = c + 64 * bitt(15) +c = c + 128 * bitt(16) +OUT prt2, c + +NEXT e +END SUB + +SUB ekrf (a) +SELECT CASE (a) +CASE 0 +bitt(1) = 0 +bitt(2) = 0 +bitt(3) = 0 +bitt(7) = 0 +bitt(5) = 0 +bitt(6) = 0 +bitt(8) = 1 +CASE 1 +bitt(2) = 0 +bitt(7) = 0 +CASE 2 +bitt(1) = 0 +bitt(3) = 0 +bitt(5) = 0 +bitt(7) = 0 +bitt(8) = 0 +CASE 3 +bitt(1) = 0 +bitt(2) = 0 +bitt(5) = 0 +bitt(8) = 0 +bitt(7) = 0 +CASE 4 +bitt(2) = 0 +bitt(6) = 0 +bitt(7) = 0 +bitt(8) = 0 +CASE 5 +bitt(1) = 0 +bitt(2) = 0 +bitt(5) = 0 +bitt(6) = 0 +bitt(8) = 0 +CASE 6 +bitt(1) = 0 +bitt(2) = 0 +bitt(3) = 0 +bitt(5) = 0 +bitt(6) = 0 +bitt(8) = 0 +CASE 7 +bitt(2) = 0 +bitt(7) = 0 +bitt(5) = 0 +CASE 8 +bitt(1) = 0 +bitt(2) = 0 +bitt(3) = 0 +bitt(7) = 0 +bitt(5) = 0 +bitt(6) = 0 +bitt(8) = 0 +CASE 9 +bitt(1) = 0 +bitt(2) = 0 +bitt(7) = 0 +bitt(5) = 0 +bitt(6) = 0 +bitt(8) = 0 +CASE 10 +bitt(15) = 0 +bitt(16) = 0 +bitt(12) = 0 +bitt(10) = 0 +bitt(9) = 0 +bitt(4) = 0 +CASE 11 +bitt(15) = 0 +bitt(4) = 0 +CASE 12 +bitt(15) = 0 +bitt(16) = 0 +bitt(9) = 0 +bitt(10) = 0 +bitt(11) = 0 +CASE 13 +bitt(15) = 0 +bitt(4) = 0 +bitt(16) = 0 +bitt(11) = 0 +bitt(9) = 0 +CASE 14 +bitt(15) = 0 +bitt(4) = 0 +bitt(12) = 0 +bitt(11) = 0 +CASE 15 +bitt(9) = 0 +bitt(4) = 0 +bitt(11) = 0 +bitt(12) = 0 +bitt(16) = 0 +CASE 16 +bitt(9) = 0 +bitt(4) = 0 +bitt(11) = 0 +bitt(12) = 0 +bitt(16) = 0 +bitt(10) = 0 +CASE 17 +bitt(4) = 0 +bitt(15) = 0 +bitt(16) = 0 +CASE 18 +bitt(4) = 0 +bitt(15) = 0 +bitt(16) = 0 +bitt(12) = 0 +bitt(11) = 0 +bitt(10) = 0 +bitt(9) = 0 +CASE 19 +bitt(4) = 0 +bitt(15) = 0 +bitt(16) = 0 +bitt(12) = 0 +bitt(11) = 0 +bitt(9) = 0 +END SELECT + +END SUB + +SUB getkey (kla) + +' Read the state of the buttons on the keyboard +1 +IF vilgu = 1 THEN +tmr = tmr + 1 +IF tmr > 5 THEN bitt(13) = tul(1): bitt(14) = tul(2) ELSE bitt(13) = 1: bitt(14) = 1 +IF tmr > 10 THEN +tmr = 0 +END IF +ELSE +bitt(13) = tul(1) +bitt(14) = tul(2) +END IF + +' Get the current time +b$ = LEFT$(TIME$, 5) +IF b$ <> timo$ THEN chm +timo$ = b$ +hist(1) = hist(1) + 1 +IF hist(1) > 20000 THEN hist(1) = 15000 +hist(2) = hist(2) + 1 +IF hist(2) > 20000 THEN hist(2) = 15000 +hist(3) = hist(3) + 1 +IF hist(3) > 20000 THEN hist(3) = 15000 + +' Read the state of the buttons on the keyboard +keys +IF kl > 0 THEN + IF hist(kl) > 1 AND hist(kl) < 9 THEN + klnait kl + 3 + kla = kl + 3 + GOTO 4 + ELSE + hist(kl) = 0 + END IF +END IF +IF hist(1) = 10 THEN klnait 1: kla = 1: GOTO 4 +IF hist(2) = 10 THEN klnait 2: kla = 2: GOTO 4 +IF hist(3) = 10 THEN klnait 3: kla = 3: GOTO 4 + +IF hist(1) > 11 AND hist(2) > 11 AND hist(3) > 11 THEN klnait 0 + +' Display current time and date +LOCATE 7, 1 +PRINT TIME$ +LOCATE 8, 1 +PRINT DATE$ +GOTO 1 +4 + +' Reset the button press count +hist(1) = 10000 +hist(2) = 10000 +hist(3) = 10000 + +' Play a sound to indicate button press +FOR b = 1 TO 100 +SOUND 0, .1 +NEXT b +IF kla > 3 THEN SOUND 4000, .1 ELSE SOUND 3000, .1 + +END SUB + +SUB getmd (a$, m, d) +b$ = LEFT$(a$, 5) +m = VAL(LEFT$(b$, 2)) +d = VAL(RIGHT$(b$, 2)) + +END SUB + +SUB getnad (g, n, d, k) +LOCATE 11, 1 +PRINT g, n, d +p = g +m = n - 2 +IF n > 2 GOTO 120 +p = p - 1: m = m + 12 +120 +c = INT(p / 100) +y = p - c * 100 +w = d + INT((13 * m - 1) / 5) + y + INT(y / 4) + INT(c / 4) - 2 * c +k = w - 7 * INT(w / 7) +IF k = 0 THEN k = 7 +END SUB + +SUB heli (a) +'GOTO 10 +SELECT CASE a +CASE 1 +FOR c = 1 TO 5 +SOUND 3000, 1 +SOUND 0, 1 +NEXT c + +CASE 2 +FOR c = 1 TO 5 +SOUND 2500, 1 +SOUND 0, 2 +NEXT c +SOUND 2500, 10 + +CASE 3 +FOR a = 1 TO 10 +SOUND 500, .5 +SOUND 1500, .5 +SOUND 2000, .5 +SOUND 1520, .5 +NEXT a + +CASE 4 +FOR a = 800 TO 1000 STEP 10 +SOUND a, .1 +SOUND a * 3, .1 +SOUND 0, 1 +NEXT a +10 + +END SELECT + +END SUB + +SUB inita +apl = 0 +OPEN "aasta.ap" FOR INPUT AS #1 +5 +IF EOF(1) <> 0 THEN GOTO 3 +LINE INPUT #1, a$ +apl = apl + 1 +ap$(apl) = a$ +GOTO 5 +3 +CLOSE #1 +END SUB + +SUB initp (b$) +ppl = 0 +OPEN b$ + ".pp" FOR INPUT AS #1 +6 +IF EOF(1) <> 0 THEN GOTO 7 +LINE INPUT #1, a$ +ppl = ppl + 1 +pp$(ppl) = a$ +GOTO 6 +7 +CLOSE #1 +END SUB + +SUB kell (a) +heli 3 + +SELECT CASE a +CASE 1 +OUT prt, 255 +FOR b = 1 TO 80 +SOUND 0, 1 +NEXT b +OUT prt, 0 +FOR b = 1 TO 15 +SOUND 0, 1 +NEXT b +OUT prt, 255 +FOR b = 1 TO 15 +SOUND 0, 1 +NEXT b +OUT prt, 0 + +CASE 2 +OUT prt, 255 +FOR b = 1 TO 80 +SOUND 0, 1 +NEXT b +OUT prt, 0 + +END SELECT +END SUB + +SUB keys +kl = 0 +OUT prt, 0 +8 +a = INP(prt) +b = INP(prt) +IF a <> b THEN GOTO 8 + +b = 128 +FOR c = 0 TO 7 +d = INT(a / b) +bit(c) = d +a = a - (b * d) +b = b / 2 +NEXT c + +IF bit(4) = 1 AND bit(6) = 1 THEN bit(4) = 0: bit(6) = 0: kl = 3 +IF bit(6) = 1 THEN kl = 2 +IF bit(4) = 1 THEN kl = 1 + +a$ = INKEY$ +IF a$ = CHR$(0) + "K" THEN kl = 1 +IF a$ = CHR$(0) + "M" THEN kl = 2 +IF a$ = CHR$(0) + "P" THEN kl = 3 +ekr +END SUB + +SUB klnait (k) + +' Highlight the pressed button on the display +IF k = 3 THEN c = 3 ELSE c = 1 +IF k = 6 THEN c = 14 +LOCATE 5, 6 +COLOR 7, c +PRINT "" +COLOR 7, 0 + +' Highlight the pressed button on the display +IF k = 1 THEN c = 3 ELSE c = 1 +IF k = 4 THEN c = 14 +LOCATE 4, 1 +COLOR 7, c +PRINT "" +COLOR 7, 0 + +IF k = 2 THEN c = 3 ELSE c = 1 +IF k = 5 THEN c = 14 +LOCATE 4, 10 +COLOR 7, c +PRINT "" +COLOR 7, 0 + +END SUB + +SUB mnmain +2 +getkey a +IF a = 6 THEN sync +IF a = 3 THEN sync2 + +IF a = 1 THEN kell 1 +IF a = 4 THEN kell 2 + +IF a = 2 THEN mntime +IF a = 5 THEN rese +GOTO 2 + +END SUB + +SUB mntime +vilgu = 1 +11 +showit +getkey a + +IF modee = 1 THEN + b = VAL(LEFT$(TIME$, 2)) + c = 0 + IF a = 1 THEN c = 1: b = b - 1 + IF a = 2 THEN c = 1: b = b + 1 + IF b < 0 THEN b = 0 + IF b > 23 THEN b = 23 + d$ = STR$(b) + IF LEFT$(d$, 1) = " " THEN d$ = RIGHT$(d$, LEN(d$) - 1) + IF LEN(d$) < 2 THEN d$ = "0" + d$ + e$ = d$ + RIGHT$(TIME$, 6) + IF c = 1 THEN TIME$ = e$ +ELSE + b = VAL(RIGHT$(LEFT$(TIME$, 5), 2)) + c = 0 + IF a = 1 THEN c = 1: b = b - 1 + IF a = 2 THEN c = 1: b = b + 1 + IF b < 0 THEN b = 0 + IF b > 59 THEN b = 59 + d$ = STR$(b) + IF LEFT$(d$, 1) = " " THEN d$ = RIGHT$(d$, LEN(d$) - 1) + IF LEN(d$) < 2 THEN d$ = "0" + d$ + e$ = LEFT$(TIME$, 3) + d$ + RIGHT$(TIME$, 3) + IF c = 1 THEN TIME$ = e$ +END IF + +IF a = 3 THEN +IF modee = 1 THEN modee = 2 ELSE modee = 1 +END IF + +IF a = 6 THEN GOTO 12 +GOTO 11 +12 +vilgu = 0 +modee = 2 +END SUB + +SUB num (a) + +FOR b = 1 TO 12 +bitt(b) = 1 +NEXT b +bitt(15) = 1 +bitt(16) = 1 + +b = INT(a / 10) +c = a - (10 * b) +ekrf b +ekrf c + 10 +END SUB + +SUB rese +heli 4 +timo$ = "" +dato$ = "" +apl = 0 +END SUB + +SUB showit +a$ = LEFT$(TIME$, 5) +IF modee = 1 THEN +b = VAL(LEFT$(a$, 2)) +tul(1) = 1 +tul(2) = 0 +ELSE +b = VAL(RIGHT$(a$, 2)) +tul(1) = 0 +tul(2) = 1 +END IF +LOCATE 15, 1 +PRINT b +num b + + +END SUB + +SUB son (a$) + +FOR b = 1 TO 50 +sona$(b) = "" +NEXT b +mitus = 0 + +b = 1 +FOR c = 1 TO LEN(a$) +d$ = RIGHT$(LEFT$(a$, c), 1) +IF d$ = " " OR d$ = CHR$(9) THEN +b = 1 +ELSE +IF b = 1 THEN b = 0: mitus = mitus + 1 +sona$(mitus) = sona$(mitus) + d$ +END IF +NEXT c + + +END SUB + +SUB start +pn$(1) = "Monday" +pn$(2) = "Tuesday" +pn$(3) = "Wednesday" +pn$(4) = "Thursday" +pn$(5) = "Friday" +pn$(6) = "Saturday" +pn$(7) = "Sunday" + +prt = &H37A +prt2 = &H378 +hist(1) = 10000 +hist(2) = 10000 +hist(3) = 10000 + +FOR a = 1 TO 16 +bitt(a) = 1 +NEXT a +modee = 2 +vilgu = 0 +tul(1) = 1 +tul(2) = 1 +END SUB + +SUB sync +OPEN "sync.txt" FOR INPUT AS #1 +LINE INPUT #1, a$ +DATE$ = a$ +LINE INPUT #1, a$ +TIME$ = a$ +CLOSE #1 + +heli 2 +END SUB + +SUB sync2 +a$ = TIME$ +a$ = LEFT$(a$, 5) +b = VAL(RIGHT$(a$, 2)) +c = VAL(LEFT$(a$, 2)) +IF b >= 30 THEN c = c + 1 +b = 0 +IF c > 23 THEN c = c - 24 +a$ = RIGHT$(STR$(c), LEN(STR$(c)) - 1) +b$ = RIGHT$(STR$(b), LEN(STR$(b)) - 1) +IF LEN(a$) < 2 THEN a$ = "0" + a$ +IF LEN(b$) < 2 THEN b$ = "0" + b$ +a$ = a$ + ":" + b$ + +'LOCATE 10, 1 +'PRINT a$ + +TIME$ = a$ + +heli 1 +END SUB diff --git a/Miscellaneous/Automated school clock/v1/opetajap.pp b/Miscellaneous/Automated school clock/v1/opetajap.pp new file mode 100644 index 0000000..0708469 --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/opetajap.pp @@ -0,0 +1,19 @@ +# 08:30 sis +# 09:15 val + +# 09:25 sis +# 10:10 val + +# 10:20 sis +# 10:45 val + +# 10:55 sis +# 11:20 val + +# 11:40 sis +# 12:05 val + +# 12:15 sis +# 12:40 val + + diff --git a/Miscellaneous/Automated school clock/v1/rebased.pp b/Miscellaneous/Automated school clock/v1/rebased.pp new file mode 100644 index 0000000..97dc6a5 --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/rebased.pp @@ -0,0 +1,23 @@ +# 08:30 sis +# 09:10 val + +# 09:20 sis +# 10:00 val + +# 10:10 sis +# 10:50 val + +# 11:30 sis +# 12:10 val + +# 12:20 sis +# 13:00 val + +# 13:10 sis +# 13:50 val + +# 14:00 sis +# 14:40 val + +# 14:45 sis +# 15:30 val diff --git a/Miscellaneous/Automated school clock/v1/reede.pp b/Miscellaneous/Automated school clock/v1/reede.pp new file mode 100644 index 0000000..b4c0e82 --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/reede.pp @@ -0,0 +1,23 @@ +# 08:30 sis +# 09:15 val + +# 09:25 sis +# 10:10 val + +# 10:20 sis +# 11:05 val + +# 11:35 sis +# 12:20 val + +# 12:30 sis +# 13:15 val + +# 13:20 sis +# 14:05 val + +# 14:10 sis +# 14:55 val + +# 15:00 sis +# 15:45 val diff --git a/Miscellaneous/Automated school clock/v1/sync.txt b/Miscellaneous/Automated school clock/v1/sync.txt new file mode 100644 index 0000000..f6ff243 --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/sync.txt @@ -0,0 +1,5 @@ +09-06-2002 +15:38 + +kuu-paev-aasta +tunnid-minutid \ No newline at end of file diff --git a/Miscellaneous/Automated school clock/v1/tava.pp b/Miscellaneous/Automated school clock/v1/tava.pp new file mode 100644 index 0000000..ce22071 --- /dev/null +++ b/Miscellaneous/Automated school clock/v1/tava.pp @@ -0,0 +1,36 @@ +# 08:30 sis +# 09:15 val + +# 09:25 sis +# 10:10 val + +# 10:20 sis +# 11:05 val + +# 11:35 sis +# 12:20 val + +# 12:30 sis +# 13:15 val + +# 13:25 sis +# 14:10 val + +# 14:20 sis +# 15:05 val + +# 15:10 sis +# 15:55 val + +# 16:00 sis +# 16:45 val + +# 16:50 sis +# 17:45 val + +# 17:50 sis +# 18:25 val + +# 18:30 sis +# 19:15 val + diff --git a/Miscellaneous/Automated school clock/v1/tuhi.pp b/Miscellaneous/Automated school clock/v1/tuhi.pp new file mode 100644 index 0000000..e69de29 diff --git a/Miscellaneous/Automated school clock/v2/aasta.ap b/Miscellaneous/Automated school clock/v2/aasta.ap new file mode 100644 index 0000000..82777d6 --- /dev/null +++ b/Miscellaneous/Automated school clock/v2/aasta.ap @@ -0,0 +1,14 @@ +v 01-01 12-31 tava +n 01-01 12-31 5 reede +e 10-04 opetajap +e 10-31 rebased +e 04-17 luhend +e 04-18 tuhi +e 04-30 luhend +e 05-01 tuhi +e 06-23 tuhi +e 06-24 tuhi +n 01-01 12-31 6 tuhi +n 01-01 12-31 7 tuhi +v 07-01 08-31 tuhi + diff --git a/Miscellaneous/Automated school clock/v2/kkmini.bas b/Miscellaneous/Automated school clock/v2/kkmini.bas new file mode 100755 index 0000000..4564dc8 --- /dev/null +++ b/Miscellaneous/Automated school clock/v2/kkmini.bas @@ -0,0 +1,485 @@ +DECLARE SUB dispt () +' Svjatoslav Agejenko +' E-mail: svjatoslav@svjatoslav.eu +' Homepage: www.hot.ee/n0/ + +DECLARE SUB dispp () +DECLARE SUB displukk () +DECLARE SUB kola (a%) +DECLARE SUB rese () +DECLARE SUB start () +DECLARE SUB getnad (g%, n%, d%, k%) +DECLARE SUB initp (b$) +DECLARE SUB getmd (a$, m%, d%) +DECLARE SUB son (a$) +DECLARE SUB inita () +DECLARE SUB chm () +DECLARE SUB chd () +DECLARE SUB kell (a%) +DECLARE SUB sync2 () +DECLARE SUB sync () +DECLARE SUB mnmain () +DECLARE SUB heli (a%) +DECLARE SUB disp () +DEFINT A-Z + +DIM SHARED ap$(1 TO 500) +DIM SHARED apl +DIM SHARED pp$(1 TO 500) +DIM SHARED ppl +DIM SHARED prt, prt2 +DIM SHARED timo$ +DIM SHARED dato$ +DIM SHARED sona$(1 TO 50) +DIM SHARED mitus +DIM SHARED lp$ +DIM SHARED ndlp +DIM SHARED pn$(1 TO 7) +DIM SHARED lk$ +DIM SHARED ssave +DIM SHARED ssavel +DIM SHARED timero AS LONG +DIM SHARED kblukk +DIM SHARED tunnidara + +start + + +disp +mnmain + +SUB chd +b$ = "tuhi" +IF apl = 0 THEN inita + +a$ = DATE$ +n1 = VAL(RIGHT$(a$, 4)) +n2 = VAL(LEFT$(a$, 2)) +a$ = LEFT$(a$, 5) +n3 = VAL(RIGHT$(a$, 2)) +getnad n1, n2, n3, ndlp +FOR a = 1 TO apl +son ap$(a) +SELECT CASE sona$(1) +CASE "v" +getmd sona$(2), m1, d1 +getmd sona$(3), m2, d2 +getmd DATE$, m3, d3 +IF m3 < m1 THEN GOTO 9 +IF m3 > m2 THEN GOTO 9 +IF m3 = m1 THEN IF d3 < d1 THEN GOTO 9 +IF m3 = m2 THEN IF d3 > d2 THEN GOTO 9 +b$ = sona$(4) +CASE "n" +getmd sona$(2), m1, d1 +getmd sona$(3), m2, d2 +getmd DATE$, m3, d3 +IF m3 < m1 THEN GOTO 9 +IF m3 > m2 THEN GOTO 9 +IF m3 = m1 THEN IF d3 < d1 THEN GOTO 9 +IF m3 = m2 THEN IF d3 > d2 THEN GOTO 9 +IF ndlp <> VAL(sona$(4)) THEN GOTO 9 +b$ = sona$(5) +CASE "e" +getmd sona$(2), m1, d1 +getmd DATE$, m2, d2 +IF (m1 = m2) AND (d1 = d2) THEN b$ = sona$(3) +END SELECT +9 +NEXT a + +IF b$ <> lp$ THEN initp b$ +lp$ = b$ +tunnidara = 0 +dispp +disp +END SUB + +SUB chm +a$ = DATE$ +IF a$ <> dato$ THEN chd +dato$ = a$ +b = 0 +FOR a = 1 TO ppl +son pp$(a) +SELECT CASE sona$(1) +CASE "#" +getmd sona$(2), h1, m1 +getmd TIME$, h2, m2 +' PRINT h1, m1, h2, m2 +IF (h2 = h1) AND (m2 = m1) THEN +IF sona$(3) = "sis" THEN b = 1 +IF sona$(3) = "val" THEN b = 2 +END IF +END SELECT +NEXT a + +IF (tunnidara = 0) AND (b > 0) THEN kell b +ssave = ssave + 1 +END SUB + +SUB disp +CLS +PRINT "Kooli Kell (mini) v 1.1 2003.3" +PRINT "Programmi autor Svjatoslav Agejenko E-mail: n0@hot.ee" +PRINT "" +PRINT "s - kell tundi sisse v - kell tunnist v�lja" +PRINT "a - sisesta uus aeg d - sisesta uus daatum" +PRINT "u - �mardab aja t�istunnini l - laeb aja failist SYNC.TXT" +PRINT "7 - 1 minut tagasi 8 - 1 minut edasi" +PRINT "4 - 1 tund tagasi 5 - 1 tund edasi" +PRINT "r - programmi restart q - programmist v�lja" +PRINT " j - j�tab k�ik tunnid t�na �ra" + +dispp + +LOCATE 12, 15 +PRINT "Kuu-P�ev-Aasta (USA standard)" + + +LOCATE 17 + +FOR a = 1 TO ppl +IF pp$(a) <> SPACE$(LEN(pp$(a))) THEN + PRINT pp$(a); + PRINT SPACE$(15 - LEN(pp$(a))); +END IF +NEXT a + +displukk +dispt +END SUB + +SUB displukk +LOCATE 1, 40 +IF kblukk = 1 THEN + COLOR 0, 7 + PRINT "Klaviatuur lukus! Vajuta CTRL+L" + COLOR 7, 0 +ELSE + PRINT " " +END IF +END SUB + +SUB dispp +IF ndlp = 0 THEN GOTO 14 +LOCATE 14, 1 +PRINT "n�dalap�ev:", pn$(ndlp) +LOCATE 15, 1 +PRINT "p�evaplaan:", lp$ +14 +END SUB + +SUB dispt +LOCATE 16, 20 +COLOR 12 + 15, 0 +IF tunnidara = 1 THEN + PRINT "T�na on k�ik tunnid �ra j�etud" +ELSE + PRINT " " +END IF +COLOR 7, 0 +END SUB + +SUB getmd (a$, m, d) +b$ = LEFT$(a$, 5) +m = VAL(LEFT$(b$, 2)) +d = VAL(RIGHT$(b$, 2)) + +END SUB + +SUB getnad (g, n, d, k) +'LOCATE 11, 1 +'PRINT g, n, d +p = g +m = n - 2 +IF n > 2 GOTO 120 +p = p - 1: m = m + 12 +120 +c = INT(p / 100) +y = p - c * 100 +w = d + INT((13 * m - 1) / 5) + y + INT(y / 4) + INT(c / 4) - 2 * c +k = w - 7 * INT(w / 7) +IF k = 0 THEN k = 7 +END SUB + +SUB heli (a) +'GOTO 10 +SELECT CASE a +CASE 1 +FOR c = 1 TO 5 +SOUND 3000, 1 +SOUND 0, 1 +NEXT c + +CASE 2 +FOR c = 1 TO 5 +SOUND 2500, 1 +SOUND 0, 2 +NEXT c +SOUND 2500, 10 + +CASE 3 +FOR a = 1 TO 10 +SOUND 500, .5 +SOUND 1500, .5 +SOUND 2000, .5 +SOUND 1520, .5 +NEXT a + + +CASE 4 +FOR a = 800 TO 1000 STEP 10 +SOUND a, .1 +SOUND a * 3, .1 +SOUND 0, 1 +NEXT a +10 + +END SELECT + + +END SUB + +SUB inita +apl = 0 +OPEN "aasta.ap" FOR INPUT AS #1 +5 +IF EOF(1) <> 0 THEN GOTO 3 +LINE INPUT #1, a$ +apl = apl + 1 +ap$(apl) = a$ +GOTO 5 +3 +CLOSE #1 +END SUB + +SUB initp (b$) +ppl = 0 +OPEN b$ + ".pp" FOR INPUT AS #1 +6 +IF EOF(1) <> 0 THEN GOTO 7 +LINE INPUT #1, a$ +ppl = ppl + 1 +pp$(ppl) = a$ +GOTO 6 +7 +CLOSE #1 +END SUB + +SUB kell (a) +b$ = TIME$ + DATE$ +IF b$ <> lk$ THEN lk$ = b$ ELSE GOTO 2 + +heli 3 + +SELECT CASE a +CASE 1 +kola 4 +FOR b = 1 TO 15 +SOUND 0, 1 +NEXT b +kola 1 +CASE 2 +kola 5 +END SELECT +2 +END SUB + +SUB kola (a) +timero = TIMER +11 +FOR b = 1 TO 100 +OUT prt, 0 +OUT prt, 255 +NEXT b +IF ABS(timero - TIMER) < a THEN GOTO 11 +END SUB + +SUB mnmain +1 +b$ = LEFT$(TIME$, 5) +IF b$ <> timo$ THEN chm +timo$ = b$ + +a$ = INKEY$ + +IF a$ <> "" THEN +IF ssave > ssavel THEN disp +ssave = 0 +END IF + +IF a$ = CHR$(12) THEN + IF kblukk = 1 THEN kblukk = 0 ELSE kblukk = 1 + displukk +END IF +IF kblukk = 1 THEN a$ = "" + +IF a$ = "s" THEN kell 1 +IF a$ = "v" THEN kell 2 + +IF a$ = "a" THEN +CLS +PRINT " vana aeg: " + TIME$ +INPUT "sisesta uus aeg (TT:MM:SS): ", b$ +IF LEN(b$) <> 8 THEN GOTO 12 +TIME$ = b$ +timo$ = "" +12 +disp +END IF + +IF a$ = "d" THEN +CLS +PRINT " vana daatum: " + DATE$ +INPUT "sisesta uus daatum (KK-PP-AAAA): ", b$ +IF LEN(b$) <> 10 THEN GOTO 13 +DATE$ = b$ +timo$ = "" +13 +disp +END IF + +IF a$ = "7" OR a$ = "8" THEN + b = VAL(RIGHT$(LEFT$(TIME$, 5), 2)) + IF a$ = "7" THEN b = b - 1 + IF a$ = "8" THEN b = b + 1 + IF b < 0 THEN b = 0 + IF b > 59 THEN b = 59 + d$ = STR$(b) + IF LEFT$(d$, 1) = " " THEN d$ = RIGHT$(d$, LEN(d$) - 1) + IF LEN(d$) < 2 THEN d$ = "0" + d$ + e$ = LEFT$(TIME$, 3) + d$ + RIGHT$(TIME$, 3) + TIME$ = e$ +END IF + +IF a$ = "4" OR a$ = "5" THEN + b = VAL(LEFT$(TIME$, 2)) + IF a$ = "4" THEN b = b - 1 + IF a$ = "5" THEN b = b + 1 + IF b < 0 THEN b = 0 + IF b > 23 THEN b = 23 + d$ = STR$(b) + IF LEFT$(d$, 1) = " " THEN d$ = RIGHT$(d$, LEN(d$) - 1) + IF LEN(d$) < 2 THEN d$ = "0" + d$ + e$ = d$ + RIGHT$(TIME$, 6) + TIME$ = e$ +END IF + +IF a$ = "u" THEN sync2 +IF a$ = "l" THEN sync + +IF a$ = "r" THEN rese +IF a$ = "q" THEN SYSTEM + +IF a$ = "j" THEN +IF tunnidara = 0 THEN tunnidara = 1 ELSE tunnidara = 0 +dispt +END IF + +IF ssave <= ssavel THEN + LOCATE 11, 1 + PRINT TIME$ + LOCATE 12, 1 + PRINT DATE$ +ELSE + IF ABS(TIMER - timero) > 10 THEN + CLS + kblukk = 1 + FOR b = 1 TO 20 + LOCATE RND * 22 + 1, RND * 79 + 1 + IF RND * 100 < 50 THEN PRINT "*" ELSE PRINT "." + NEXT b + LOCATE RND * 22 + 1, RND * 50 + 1 + COLOR 0, 7 + PRINT "< " + LEFT$(TIME$, 2); + COLOR 16, 7 + PRINT ":"; + COLOR 0, 7 + PRINT RIGHT$(LEFT$(TIME$, 5), 2) + " >" + COLOR 7, 0 + timero = TIMER + END IF +END IF +GOTO 1 + + +END SUB + +SUB rese +heli 4 +timo$ = "" +dato$ = "" +apl = 0 +END SUB + +SUB son (a$) + +FOR b = 1 TO 50 +sona$(b) = "" +NEXT b +mitus = 0 + +b = 1 +FOR c = 1 TO LEN(a$) +d$ = RIGHT$(LEFT$(a$, c), 1) +IF d$ = " " OR d$ = CHR$(9) THEN +b = 1 +ELSE +IF b = 1 THEN b = 0: mitus = mitus + 1 +sona$(mitus) = sona$(mitus) + d$ +END IF +NEXT c + + +END SUB + +SUB start +pn$(1) = "esmasp�ev" +pn$(2) = "teisip�ev" +pn$(3) = "kolmap�ev" +pn$(4) = "neljap�ev" +pn$(5) = "reede" +pn$(6) = "laup�ev" +pn$(7) = "p�hap�ev" + +prt = &H378 + +ssavel = 2 +kblukk = 1 +tunnidara = 0 +END SUB + +SUB sync +OPEN "sync.txt" FOR INPUT AS #1 +LINE INPUT #1, a$ +DATE$ = a$ +LINE INPUT #1, a$ +TIME$ = a$ +CLOSE #1 + +heli 2 +END SUB + +SUB sync2 +a$ = TIME$ +a$ = LEFT$(a$, 5) +b = VAL(RIGHT$(a$, 2)) +c = VAL(LEFT$(a$, 2)) +IF b >= 30 THEN c = c + 1 +b = 0 +IF c > 23 THEN c = c - 24 +a$ = RIGHT$(STR$(c), LEN(STR$(c)) - 1) +b$ = RIGHT$(STR$(b), LEN(STR$(b)) - 1) +IF LEN(a$) < 2 THEN a$ = "0" + a$ +IF LEN(b$) < 2 THEN b$ = "0" + b$ +a$ = a$ + ":" + b$ + +'LOCATE 10, 1 +'PRINT a$ + +TIME$ = a$ + +heli 1 +END SUB + diff --git a/Miscellaneous/Automated school clock/v2/luhend.pp b/Miscellaneous/Automated school clock/v2/luhend.pp new file mode 100644 index 0000000..8c36fd4 --- /dev/null +++ b/Miscellaneous/Automated school clock/v2/luhend.pp @@ -0,0 +1,27 @@ +# 08:30 sis +# 09:00 val + +# 09:10 sis +# 09:40 val + +# 09:50 sis +# 10:20 val + +# 10:30 sis +# 11:00 val + +# 11:30 sis +# 12:00 val + +# 12:10 sis +# 12:40 val + +# 12:50 sis +# 13:20 val + +# 13:30 sis +# 14:00 val + +# 14:05 sis +# 14:35 val + diff --git a/Miscellaneous/Automated school clock/v2/opetajap.pp b/Miscellaneous/Automated school clock/v2/opetajap.pp new file mode 100644 index 0000000..0708469 --- /dev/null +++ b/Miscellaneous/Automated school clock/v2/opetajap.pp @@ -0,0 +1,19 @@ +# 08:30 sis +# 09:15 val + +# 09:25 sis +# 10:10 val + +# 10:20 sis +# 10:45 val + +# 10:55 sis +# 11:20 val + +# 11:40 sis +# 12:05 val + +# 12:15 sis +# 12:40 val + + diff --git a/Miscellaneous/Automated school clock/v2/rebased.pp b/Miscellaneous/Automated school clock/v2/rebased.pp new file mode 100644 index 0000000..97dc6a5 --- /dev/null +++ b/Miscellaneous/Automated school clock/v2/rebased.pp @@ -0,0 +1,23 @@ +# 08:30 sis +# 09:10 val + +# 09:20 sis +# 10:00 val + +# 10:10 sis +# 10:50 val + +# 11:30 sis +# 12:10 val + +# 12:20 sis +# 13:00 val + +# 13:10 sis +# 13:50 val + +# 14:00 sis +# 14:40 val + +# 14:45 sis +# 15:30 val diff --git a/Miscellaneous/Automated school clock/v2/reede.pp b/Miscellaneous/Automated school clock/v2/reede.pp new file mode 100644 index 0000000..b4c0e82 --- /dev/null +++ b/Miscellaneous/Automated school clock/v2/reede.pp @@ -0,0 +1,23 @@ +# 08:30 sis +# 09:15 val + +# 09:25 sis +# 10:10 val + +# 10:20 sis +# 11:05 val + +# 11:35 sis +# 12:20 val + +# 12:30 sis +# 13:15 val + +# 13:20 sis +# 14:05 val + +# 14:10 sis +# 14:55 val + +# 15:00 sis +# 15:45 val diff --git a/Miscellaneous/Automated school clock/v2/sync.txt b/Miscellaneous/Automated school clock/v2/sync.txt new file mode 100644 index 0000000..dbbc645 --- /dev/null +++ b/Miscellaneous/Automated school clock/v2/sync.txt @@ -0,0 +1,5 @@ +02-03-2003 +11:32 + +kuu-paev-aasta +tunnid-minutid \ No newline at end of file diff --git a/Miscellaneous/Automated school clock/v2/tava.pp b/Miscellaneous/Automated school clock/v2/tava.pp new file mode 100644 index 0000000..e83ded7 --- /dev/null +++ b/Miscellaneous/Automated school clock/v2/tava.pp @@ -0,0 +1,29 @@ +# 08:30 sis +# 09:15 val + +# 09:25 sis +# 10:10 val + +# 10:20 sis +# 11:05 val + +# 11:35 sis +# 12:20 val + +# 12:30 sis +# 13:15 val + +# 13:25 sis +# 14:10 val + +# 14:20 sis +# 15:05 val + +# 15:10 sis +# 15:55 val + +# 16:00 sis +# 16:45 val + +# 16:50 sis +# 17:35 val \ No newline at end of file diff --git a/Miscellaneous/Automated school clock/v2/tuhi.pp b/Miscellaneous/Automated school clock/v2/tuhi.pp new file mode 100644 index 0000000..e69de29 diff --git a/Miscellaneous/Automated school clock/v3/aasta.ap b/Miscellaneous/Automated school clock/v3/aasta.ap new file mode 100644 index 0000000..8640065 --- /dev/null +++ b/Miscellaneous/Automated school clock/v3/aasta.ap @@ -0,0 +1,12 @@ +v 01-01 12-31 tava +n 01-01 12-31 5 reede +e 04-17 luhend +e 04-18 tuhi +e 04-30 luhend +e 05-01 tuhi +e 06-23 tuhi +e 06-24 tuhi +n 01-01 12-31 6 tuhi +n 01-01 12-31 7 tuhi +v 07-01 08-31 tuhi + diff --git a/Miscellaneous/Automated school clock/v3/kell3.bas b/Miscellaneous/Automated school clock/v3/kell3.bas new file mode 100755 index 0000000..459e85a --- /dev/null +++ b/Miscellaneous/Automated school clock/v3/kell3.bas @@ -0,0 +1,623 @@ +' Program allows scheduling school clock ringing. +' Timetables are stored in separate files. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' ?, Initial version +' 2024, Improved program readability + + +DECLARE FUNCTION getName$ (a%) +DECLARE FUNCTION getSym$ (a$, b%) +DECLARE SUB editor () +DECLARE SUB leiaconf () +DECLARE SUB clrerr () +DECLARE SUB dispt () + +DECLARE SUB dispp () +DECLARE SUB displukk () +DECLARE SUB kola (a%) +DECLARE SUB rese () +DECLARE SUB start () +DECLARE SUB getNad (g%, n%, d%, k%) +DECLARE SUB initp (b$) +DECLARE SUB getMd (a$, m%, d%) +DECLARE SUB son (a$) +DECLARE SUB inita () +DECLARE SUB chm () +DECLARE SUB chd () +DECLARE SUB kell (a%) +DECLARE SUB sync2 () +DECLARE SUB sync () +DECLARE SUB mnmain () +DECLARE SUB heli (a%) +DECLARE SUB disp () +DEFINT A-Z + +DIM SHARED ap$(1 TO 500) +DIM SHARED apl +DIM SHARED pp$(1 TO 500) +DIM SHARED ppl +DIM SHARED prt, prt2 +DIM SHARED timo$ +DIM SHARED dato$ +DIM SHARED sona$(1 TO 50) +DIM SHARED mitus +DIM SHARED lp$ +DIM SHARED ndlp +DIM SHARED pn$(1 TO 7) +DIM SHARED lk$ +DIM SHARED ssave +DIM SHARED ssavel +DIM SHARED timero AS LONG +DIM SHARED kblukk +DIM SHARED tunnidara +DIM SHARED errmsg$ +DIM SHARED cnflist$(1 TO 200) + +'ON ERROR GOTO 20 + +start +disp +mnmain + +20 +LOCATE 20, 1 +COLOR 0, 15 +PRINT "Programmi t88s ilmus j2rgnev t6rge:" +PRINT errmsg$ +PRINT "Programmi t2itmine katkestatud! Abi saamiseks lugege juhendit." +SYSTEM + +SUB chd +b$ = "tuhi" +IF apl = 0 THEN inita + +a$ = DATE$ +n1 = VAL(RIGHT$(a$, 4)) +n2 = VAL(LEFT$(a$, 2)) +a$ = LEFT$(a$, 5) +n3 = VAL(RIGHT$(a$, 2)) +getNad n1, n2, n3, ndlp +FOR a = 1 TO apl + son ap$(a) + SELECT CASE sona$(1) + CASE "v" + getMd sona$(2), m1, d1 + getMd sona$(3), m2, d2 + getMd DATE$, m3, d3 + IF m3 < m1 THEN GOTO 9 + IF m3 > m2 THEN GOTO 9 + IF m3 = m1 THEN IF d3 < d1 THEN GOTO 9 + IF m3 = m2 THEN IF d3 > d2 THEN GOTO 9 + b$ = sona$(4) + CASE "n" + getMd sona$(2), m1, d1 + getMd sona$(3), m2, d2 + getMd DATE$, m3, d3 + IF m3 < m1 THEN GOTO 9 + IF m3 > m2 THEN GOTO 9 + IF m3 = m1 THEN IF d3 < d1 THEN GOTO 9 + IF m3 = m2 THEN IF d3 > d2 THEN GOTO 9 + IF ndlp <> VAL(sona$(4)) THEN GOTO 9 + b$ = sona$(5) + CASE "e" + getMd sona$(2), m1, d1 + getMd DATE$, m2, d2 + IF (m1 = m2) AND (d1 = d2) THEN b$ = sona$(3) + END SELECT +9 +NEXT a + +IF b$ <> lp$ THEN initp b$ +lp$ = b$ +tunnidara = 0 +dispp +disp +END SUB + +SUB chm +a$ = DATE$ +IF a$ <> dato$ THEN chd +dato$ = a$ +b = 0 +FOR a = 1 TO ppl + son pp$(a) + SELECT CASE sona$(1) + CASE "#" + getMd sona$(2), h1, m1 + getMd TIME$, h2, m2 + ' PRINT h1, m1, h2, m2 + IF (h2 = h1) AND (m2 = m1) THEN + IF sona$(3) = "sis" THEN b = 1 + IF sona$(3) = "val" THEN b = 2 + END IF + END SELECT + NEXT a + +IF (tunnidara = 0) AND (b > 0) THEN kell b +ssave = ssave + 1 +END SUB + +SUB clrerr +errmsg$ = "tundmatu viga. V6ibolla on v2he RAM m2lu?" +END SUB + +SUB disp +CLS +PRINT "Kooli Kell 3 2003.09" +PRINT "autor: Svjatoslav Agejenko " +PRINT "" +PRINT "s - kell tundi sisse v - kell tunnist v�lja" +PRINT "a - sisesta uus aeg d - sisesta uus daatum" +PRINT "p - n2itab dokumentatsiooni j - j�tab k�ik tunnid t�na �ra" +PRINT "7 - 1 minut tagasi 8 - 1 minut edasi" +PRINT "4 - 1 tund tagasi 5 - 1 tund edasi" +PRINT "r - programmi restart q - programmist v�lja" +PRINT "k - konfiguratsiooni redaktor CTRL+L - klaviatuuri lukk (sees/v2ljas)" + +dispp + +LOCATE 12, 15 +PRINT "Kuu-P�ev-Aasta (USA standard)" + +LOCATE 17 + +FOR a = 1 TO ppl + IF pp$(a) <> SPACE$(LEN(pp$(a))) THEN + PRINT pp$(a); + PRINT SPACE$(15 - LEN(pp$(a))); + END IF +NEXT a + +displukk +dispt +END SUB + +SUB displukk +LOCATE 1, 40 +IF kblukk = 1 THEN + COLOR 0, 7 + PRINT "Klaviatuur lukus! Vajuta CTRL+L" + COLOR 15, 0 +ELSE + PRINT " " +END IF +END SUB + +SUB dispp +IF ndlp = 0 THEN GOTO 14 +LOCATE 14, 1 +PRINT "n�dalap�ev:", pn$(ndlp) +LOCATE 15, 1 +PRINT "p�evaplaan:", lp$ +14 +END SUB + +SUB dispt +LOCATE 16, 20 +COLOR 12 + 15, 0 +IF tunnidara = 1 THEN + PRINT "T2na on k6ik tunnid 2ra j2etud" +ELSE + PRINT " " +END IF +COLOR 15, 0 +END SUB + +SUB editor +23 +leiaconf +CLS +COLOR 0, 15 +LOCATE 1, 1 +PRINT SPACE$(80); +LOCATE 1, 1 +PRINT "Konfiguratsiooni redaktor. Valige v�lja p�eva v6i aasta plaani." +LOCATE 2, 1 +PRINT SPACE$(80) +LOCATE 2, 1 +PRINT " nr nimi laiend suurus loomisdaatum" + +LOCATE 22, 1 +PRINT SPACE$(80) +LOCATE 22, 1 +PRINT "K - valitud faili kustutamine U - uus fail ESC - redaktorist v�lja" +p = 0 +v = 1 +17 +FOR a = 3 TO 21 + IF a - 2 + p = v THEN + COLOR 0, 7 + LOCATE a, 1 + PRINT cnflist$(a - 2 + p) + SPACE$(55 - LEN(cnflist$(a - 2 + p))) + LOCATE a, 56 + COLOR 31, 0 + PRINT "<==" + IF cnflist$(a - 2 + p) <> SPACE$(LEN(cnflist$(a - 2 + p))) THEN + COLOR 15, 0 + PRINT " valitud: " + getName$(v) + END IF + COLOR 15, 0 + ELSE + COLOR 15, 0 + LOCATE a, 1 + PRINT cnflist$(a - 2 + p) + SPACE$(80 - LEN(cnflist$(a - 2 + p))) + END IF +NEXT a + +a$ = INKEY$ +LOCATE 1, 1 +'IF a$ <> "" THEN PRINT ASC(RIGHT$(a$, 1)); ASC(LEFT$(a$, 1)) +IF a$ = CHR$(27) THEN GOTO 18 +IF a$ = "u" OR a$ = "U" THEN SHELL "EDIT": GOTO 23 +IF a$ = CHR$(0) + "P" THEN v = v + 1 +IF a$ = CHR$(0) + "H" THEN v = v - 1 +IF a$ = CHR$(0) + CHR$(73) THEN v = v - 17 +IF a$ = CHR$(0) + CHR$(81) THEN v = v + 17 +IF a$ = "K" OR a$ = "k" THEN + IF LEN(getName$(v)) > 2 THEN + IF getName$(v) = "AASTA.AP" THEN + SOUND 3000, .1 + ELSE + KILL getName$(v) + GOTO 23 + END IF + ELSE + SOUND 3000, .1 + END IF +END IF +IF a$ = CHR$(13) THEN + IF getName$(v) = "." THEN + SOUND 3000, .1 + ELSE + SHELL "EDIT " + getName$(v) + GOTO 23 + END IF +END IF + +IF v < 1 THEN v = 1: SOUND 3000, .2 +IF v > 200 THEN v = 200: : SOUND 3000, .2 + +21 +IF v - p > 19 THEN p = p + 1: GOTO 21 +22 +IF v - p < 1 THEN p = p - 1: GOTO 22 + +GOTO 17 +18 +COLOR 15, 0 +disp +END SUB + +SUB getMd (a$, m, d) +b$ = LEFT$(a$, 5) +m = VAL(LEFT$(b$, 2)) +d = VAL(RIGHT$(b$, 2)) + +END SUB + +SUB getNad (g, n, d, k) +'LOCATE 11, 1 +'PRINT g, n, d +p = g +m = n - 2 +IF n > 2 GOTO 120 +p = p - 1: m = m + 12 +120 +c = INT(p / 100) +y = p - c * 100 +w = d + INT((13 * m - 1) / 5) + y + INT(y / 4) + INT(c / 4) - 2 * c +k = w - 7 * INT(w / 7) +IF k = 0 THEN k = 7 +END SUB + +FUNCTION getName$ (a) +c$ = "" +FOR b = 8 TO 40 + d$ = getSym(cnflist$(a), b) + IF d$ = " " THEN GOTO 19 + c$ = c$ + d$ +NEXT b +19 +getName$ = c$ + "." + getSym(cnflist$(a), 17) + getSym(cnflist$(a), 18) +END FUNCTION + +FUNCTION getSym$ (a$, b) +getSym$ = RIGHT$(LEFT$(a$, b), 1) +END FUNCTION + +SUB heli (a) +'GOTO 10 +SELECT CASE a + CASE 1 + FOR c = 1 TO 5 + SOUND 3000, 1 + SOUND 0, 1 + NEXT c + + CASE 2 + FOR c = 1 TO 5 + SOUND 2500, 1 + SOUND 0, 2 + NEXT c + SOUND 2500, 10 + + CASE 3 + FOR a = 1 TO 10 + SOUND 500, .5 + SOUND 1500, .5 + SOUND 2000, .5 + SOUND 1520, .5 + NEXT a + + CASE 4 + FOR a = 800 TO 1000 STEP 10 + SOUND a, .1 + SOUND a * 3, .1 + SOUND 0, 1 + NEXT a + 10 +END SELECT + +END SUB + +SUB inita +apl = 0 +errmsg$ = "Ei leia aastaplaani faili! 'aasta.ap'" +OPEN "aasta.ap" FOR INPUT AS #1 +clrerr +5 +IF EOF(1) <> 0 THEN GOTO 3 +LINE INPUT #1, a$ +apl = apl + 1 +ap$(apl) = a$ +GOTO 5 +3 +CLOSE #1 +END SUB + +SUB initp (b$) +ppl = 0 +errmsg$ = "Ei leia aastaplaanis mainitud '" + b$ + ".pp' p�evaplaani!" +OPEN b$ + ".pp" FOR INPUT AS #1 +clrerr +6 +IF EOF(1) <> 0 THEN GOTO 7 +LINE INPUT #1, a$ +ppl = ppl + 1 +pp$(ppl) = a$ +GOTO 6 +7 +CLOSE #1 +END SUB + +SUB kell (a) +b$ = TIME$ + DATE$ +IF b$ <> lk$ THEN lk$ = b$ ELSE GOTO 2 + +heli 3 + +SELECT CASE a + CASE 1 + kola 4 + FOR b = 1 TO 15 + SOUND 0, 1 + NEXT b + kola 1 + + CASE 2 + kola 5 +END SELECT +2 + +END SUB + +SUB kola (a) +COLOR 15, 7 +s$ = "" +FOR b = 1 TO 80 + s$ = s$ + CHR$(219) +NEXT b +FOR b = 1 TO 30 + PRINT s$; +NEXT b + +timero = TIMER +11 +OUT prt, 255 +IF ABS(timero - TIMER) < a THEN GOTO 11 +OUT prt, 0 +COLOR 15, 0 +disp +END SUB + +SUB leiaconf +FOR a = 1 TO 200 + cnflist$(a) = "" +NEXT a +c = 1 + +SHELL "dir >dir.tmp" +OPEN "dir.tmp" FOR INPUT AS #1 +15 +IF EOF(1) <> 0 THEN GOTO 16 +LINE INPUT #1, a$ +IF LEN(a$) < 30 THEN GOTO 15 +IF LEFT$(a$, 1) = " " THEN GOTO 15 +IF LEFT$(a$, 1) = "." THEN GOTO 15 +b$ = RIGHT$(LEFT$(a$, 12), 3) +IF b$ = "PP " OR b$ = "AP " THEN ELSE GOTO 15 +d$ = " " + STR$(c) +a$ = RIGHT$(d$, 4) + " " + a$ +IF LEN(a$) > 50 THEN a$ = LEFT$(a$, 50) +cnflist$(c) = a$ +c = c + 1 +GOTO 15 +16 +CLOSE #1 +KILL "dir.tmp" +END SUB + +SUB mnmain +1 +b$ = LEFT$(TIME$, 5) +IF b$ <> timo$ THEN chm +timo$ = b$ + +a$ = INKEY$ + +IF a$ <> "" THEN + IF ssave > ssavel THEN disp + ssave = 0 +END IF + +IF a$ = CHR$(12) THEN + IF kblukk = 1 THEN kblukk = 0 ELSE kblukk = 1 + displukk +END IF +IF kblukk = 1 THEN + IF a$ <> "" THEN SOUND 3000, 1 + a$ = "" +END IF +IF a$ = "k" OR a$ = "K" THEN editor + +IF a$ = "s" OR a$ = "S" THEN kell 1 +IF a$ = "v" OR a$ = "V" THEN kell 2 + +IF a$ = "a" THEN + CLS + PRINT " vana aeg: " + TIME$ + INPUT "sisesta uus aeg (TT:MM:SS): ", b$ + IF LEN(b$) <> 8 THEN GOTO 12 + TIME$ = b$ + timo$ = "" + 12 + disp +END IF + +IF a$ = "d" OR a$ = "D" THEN + CLS + PRINT " vana daatum: " + DATE$ + INPUT "sisesta uus daatum (KK-PP-AAAA): ", b$ + IF LEN(b$) <> 10 THEN GOTO 13 + DATE$ = b$ + timo$ = "" + 13 + disp +END IF + +IF a$ = "7" OR a$ = "8" THEN + b = VAL(RIGHT$(LEFT$(TIME$, 5), 2)) + IF a$ = "7" THEN b = b - 1 + IF a$ = "8" THEN b = b + 1 + IF b < 0 THEN b = 0 + IF b > 59 THEN b = 59 + d$ = STR$(b) + IF LEFT$(d$, 1) = " " THEN d$ = RIGHT$(d$, LEN(d$) - 1) + IF LEN(d$) < 2 THEN d$ = "0" + d$ + e$ = LEFT$(TIME$, 3) + d$ + RIGHT$(TIME$, 3) + TIME$ = e$ +END IF + +IF a$ = "4" OR a$ = "5" THEN + b = VAL(LEFT$(TIME$, 2)) + IF a$ = "4" THEN b = b - 1 + IF a$ = "5" THEN b = b + 1 + IF b < 0 THEN b = 0 + IF b > 23 THEN b = 23 + d$ = STR$(b) + IF LEFT$(d$, 1) = " " THEN d$ = RIGHT$(d$, LEN(d$) - 1) + IF LEN(d$) < 2 THEN d$ = "0" + d$ + e$ = d$ + RIGHT$(TIME$, 6) + TIME$ = e$ +END IF + +IF a$ = "p" OR a$ = "P" THEN SHELL "EDIT juhend.txt": disp + +IF a$ = "r" OR a$ = "R" THEN rese +IF a$ = "q" OR a$ = "Q" THEN SYSTEM + +IF a$ = "j" OR a$ = "J" THEN + IF tunnidara = 0 THEN tunnidara = 1 ELSE tunnidara = 0 + dispt +END IF + +IF ssave <= ssavel THEN + LOCATE 11, 1 + PRINT TIME$ + LOCATE 12, 1 + PRINT DATE$ +ELSE + IF ABS(TIMER - timero) > 10 THEN + CLS + kblukk = 1 + FOR b = 1 TO 20 + LOCATE RND * 22 + 1, RND * 79 + 1 + IF RND * 100 < 50 THEN PRINT "*" ELSE PRINT "." + NEXT b + LOCATE RND * 22 + 1, RND * 50 + 1 + COLOR 0, 7 + PRINT "< " + LEFT$(TIME$, 2); + COLOR 16, 7 + PRINT ":"; + COLOR 0, 7 + PRINT RIGHT$(LEFT$(TIME$, 5), 2) + " >" + COLOR 15, 0 + timero = TIMER + END IF +END IF +GOTO 1 + +END SUB + +SUB rese +heli 4 +timo$ = "" +dato$ = "" +apl = 0 +END SUB + +SUB son (a$) + +FOR b = 1 TO 50 + sona$(b) = "" +NEXT b +mitus = 0 + +b = 1 +FOR c = 1 TO LEN(a$) + d$ = RIGHT$(LEFT$(a$, c), 1) + IF d$ = " " OR d$ = CHR$(9) THEN + b = 1 + ELSE + IF b = 1 THEN b = 0: mitus = mitus + 1 + sona$(mitus) = sona$(mitus) + d$ + END IF +NEXT c + +END SUB + +SUB start +CLS +COLOR 15 +pn$(1) = "esmasp�ev" +pn$(2) = "teisip�ev" +pn$(3) = "kolmap�ev" +pn$(4) = "neljap�ev" +pn$(5) = "reede" +pn$(6) = "laup�ev" +pn$(7) = "p�hap�ev" + +prt = &H378 + +ssavel = 2 +kblukk = 1 +tunnidara = 0 + +OUT prt, 0 +END SUB diff --git a/Miscellaneous/Automated school clock/v3/luhend.pp b/Miscellaneous/Automated school clock/v3/luhend.pp new file mode 100644 index 0000000..8c36fd4 --- /dev/null +++ b/Miscellaneous/Automated school clock/v3/luhend.pp @@ -0,0 +1,27 @@ +# 08:30 sis +# 09:00 val + +# 09:10 sis +# 09:40 val + +# 09:50 sis +# 10:20 val + +# 10:30 sis +# 11:00 val + +# 11:30 sis +# 12:00 val + +# 12:10 sis +# 12:40 val + +# 12:50 sis +# 13:20 val + +# 13:30 sis +# 14:00 val + +# 14:05 sis +# 14:35 val + diff --git a/Miscellaneous/Automated school clock/v3/reede.pp b/Miscellaneous/Automated school clock/v3/reede.pp new file mode 100644 index 0000000..b4c0e82 --- /dev/null +++ b/Miscellaneous/Automated school clock/v3/reede.pp @@ -0,0 +1,23 @@ +# 08:30 sis +# 09:15 val + +# 09:25 sis +# 10:10 val + +# 10:20 sis +# 11:05 val + +# 11:35 sis +# 12:20 val + +# 12:30 sis +# 13:15 val + +# 13:20 sis +# 14:05 val + +# 14:10 sis +# 14:55 val + +# 15:00 sis +# 15:45 val diff --git a/Miscellaneous/Automated school clock/v3/skeem.png b/Miscellaneous/Automated school clock/v3/skeem.png new file mode 100644 index 0000000..9c3e95b Binary files /dev/null and b/Miscellaneous/Automated school clock/v3/skeem.png differ diff --git a/Miscellaneous/Automated school clock/v3/tava.pp b/Miscellaneous/Automated school clock/v3/tava.pp new file mode 100644 index 0000000..e83ded7 --- /dev/null +++ b/Miscellaneous/Automated school clock/v3/tava.pp @@ -0,0 +1,29 @@ +# 08:30 sis +# 09:15 val + +# 09:25 sis +# 10:10 val + +# 10:20 sis +# 11:05 val + +# 11:35 sis +# 12:20 val + +# 12:30 sis +# 13:15 val + +# 13:25 sis +# 14:10 val + +# 14:20 sis +# 15:05 val + +# 15:10 sis +# 15:55 val + +# 16:00 sis +# 16:45 val + +# 16:50 sis +# 17:35 val \ No newline at end of file diff --git a/Miscellaneous/Automated school clock/v3/tuhi.pp b/Miscellaneous/Automated school clock/v3/tuhi.pp new file mode 100644 index 0000000..d3f5a12 --- /dev/null +++ b/Miscellaneous/Automated school clock/v3/tuhi.pp @@ -0,0 +1 @@ + diff --git a/Miscellaneous/Automated school clock/v3/tutorial.org b/Miscellaneous/Automated school clock/v3/tutorial.org new file mode 100644 index 0000000..19dd2dc --- /dev/null +++ b/Miscellaneous/Automated school clock/v3/tutorial.org @@ -0,0 +1,113 @@ +* Kooli Kell 3 programmi kasutusjuhend +- 2003.09 :: Esimene versioon. +- 2025 :: Parendatud juhendi sõnastus. + +- Programmi, juhendi ja skeemi autor :: Svjatoslav Agejenko +- E-post :: svjatoslav@svjatoslav.eu +- kodulehekülg :: https://www.svjatoslav.eu + +Ettevaatust: Siin tekstis olev info võib olla vananenud, vigane v6i +ebatäielik. Autor ei võta endale vastutust antud süsteemi kasutamisest +tekkinud otsese või kaudse kahju puhul! + +* Üldinfo + +Programm Kooli Kell on mõeldud kella laskmiseks koolis, tundi sisse ja +välja. + +- Tundi sisse minev kell on 1 pikk ning 1 lühem helin. +- Väljaminev kell on 1 tavaline pikk helin. + +Programm loeb aega arvuti süsteemsest kellast. Fail 'AASTA.AP' hoiab +aasta graafikut, kus saab määrata teatud päeva kohta käiva +päevaplaani. Päevaplaanid asuvad failides '*.PP'. + +Aasta või päevaplaani muutmiseks tuleb redigeerida vastavaid faile. +Failides on info esitatud programmile 'Kooli Kell' arusaadavate +käskudena. Kus ühel real on üks käsk, või tühi rida. Rea esimene sõna +peab olema käsk, ning järgnevad sõnad on selle käsu parameetrid. Sõnad +võivad olla eraldatud suvalise 0 suuremate tabulaatorite ja/või +tühikute arvuga. Programmi saab kasutada arvutil millele on ühendatud +spetsiaalne liides, või millel on see liides sisse +monteeritud. Liideses olev relee toimib lülitina, mis kella laskmise +ajaks sulgub. Liides vooluahelasse ise voolu ei anna. Seega on liides +mõeldud kella ja toiteallikaga vooluahelasse jadamisi +ühendamiseks. Või siis olemasoleva mehaanilise kella laskmis nupuga +paralleelselt, siis saab kella lasta nii endisest nupust kui ka +arvutiga. + +Programm on ettenähtud iseseisvalt töötama, kuid on ka võimalus +erandkorras k2sitsi kella lasta, aega muuta jne. Selleks tuleb +vajutada erinevaid klahve klaviatuuril. K2ivitudes kuvab programm +klahvide kirjeldused ekraanile. + +* faili AASTA.AP formaat + +Lõpp 'AP' tuleneb sõnadest Aasta plaan. + +: v - - + +Sõnast vahemik. Paneb paika p2evaplaani antud ajavahemikus. Esimene +daatum peab kindlasti olema v2iksem kui teine. St. kui on tõesti vaja: + +: v 10-4 2-1 eri + +tuleb kirjutada: + +: v 10-4 12-31 eri +: v 1-1 2-1 eri + +P2evaplaan kehtib vahemiku esimesest p2evast kuni vahemiku viimase p2evani. + +: n - - + +Sõnast n2dalap2ev. sama mis "v" kuid: paneb paika p2evaplaani antud +ajavahemikus, antud n2dalap2eval. N2dalap2eva kirjeldatakse numbriga. +n2dala esimene p2ev on esmasp2ev, talle vastab number 1. + +: e - + +Sõnast eripäevaplaan. Paneb paika antud kuupäevale antud päevaplaani. +Sobib hästi erakorraliste, lühendatud või uhekordselt kehtivate +päevaplaanide kehtestamiseks. Näiteks riigipühad, spordipäev jne. + +Kui teatud päeva kohta ei käinud ühtegi kirjet siis toimib vaikimisi "tuhi" +päevaplaan. Kui teatud päeva kohta käis mitu kirjet siis jääb peale viimane. + +* failide *.PP formaat + +Lõpp 'PP' tuleneb sõnadest Päeva Plaan. + +: # : + +Laseb antud ajal antud kella. Võimalikud kella helinad on: + +- sis :: -kell tundi sisse +- val :: -kell tunnist välja + +* Raudvara nõuded + +- 286 protsessoriga PC tüüpi arvuti. :: Peaks töötama ka 8086 protsessoril aga pole testinud. + +- 640 KB põhimälu :: Vähemaga pole testinud. + +- 500 KB vaba kettaruumi :: Kõvakettalt töö kiirendab oluliselt + programmi käivitumist, ja konfiguratsiooni redigeerimist. + +- LPT port. + +- Monitor :: Võib olla mustvalge + +- Klaviatuur. + +* Tarkvara nõuded + +- DOS 6.22 :: Võib ka varasem, kuid pole testinud. +- QB 4.5 :: Piisab 'QB.EXE' failist. Peaks t88tama ka MS QBasic-us. +- EDIT.EXE :: DOSi käsurealt käivituv teksti redaktor. + +* Nõuded inimesele + +Süsteemi kasutamiseks hädavajalik antud juhendist aru saamine. +Süsteemi paigaldamine nõuab elektriku oskusi. Programmi kasutamiseks +on vajalik vähemalt algaja tasemel arvutikasutaja oskus. diff --git a/Miscellaneous/Custom palette, 2.png b/Miscellaneous/Custom palette, 2.png new file mode 100644 index 0000000..9fe22b5 Binary files /dev/null and b/Miscellaneous/Custom palette, 2.png differ diff --git a/Miscellaneous/Custom palette, 3.png b/Miscellaneous/Custom palette, 3.png new file mode 100644 index 0000000..83065f1 Binary files /dev/null and b/Miscellaneous/Custom palette, 3.png differ diff --git a/Miscellaneous/Custom palette.bas b/Miscellaneous/Custom palette.bas new file mode 100644 index 0000000..332b85a --- /dev/null +++ b/Miscellaneous/Custom palette.bas @@ -0,0 +1,167 @@ +' An attempt to generate a universally reusable color palette for 256 color limit. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2001, Initial version. +' 2024.08, Enhance program readability + +DEFINT A-Y +SCREEN 13 +CLS + +' Initialize color index +colorIndex = 0 + +' Generate colors by varying red, green, and blue components from 0 to 5 +FOR redComponent = 0 TO 5 + FOR greenComponent = 0 TO 5 + FOR blueComponent = 0 TO 5 + ' Set the color for the next pixel + OUT &H3C8, colorIndex + colorIndex = colorIndex + 1 + + ' Output the RGB components to the palette registers + OUT &H3C9, redComponent * 12 + OUT &H3C9, greenComponent * 12 + OUT &H3C9, blueComponent * 12 + NEXT blueComponent + NEXT greenComponent +NEXT redComponent + +' Draw a grid of colored squares using the generated color palette +FOR colorIndex = 0 TO 5 + FOR blueComponent = 0 TO 5 + FOR redComponent = 0 TO 5 + ' Draw a square with the calculated color + LINE (redComponent * 5 + colorIndex * 30, blueComponent * 5)-_ + (redComponent * 5 + 4 + colorIndex * 30, blueComponent * 5 + 4), _ + colorIndex * 36 + blueComponent * 6 + redComponent, BF + NEXT redComponent + NEXT blueComponent +NEXT colorIndex + +' Wait for user input before proceeding +a$ = INPUT$(1) + +' Initialize coordinates for pattern drawing +patternEx = -100 +patternEy = 0 + +' Draw a series of patterns with varying colors +FOR patternZ = 0 TO 75 STEP 15 + ' Calculate the vertices of an equilateral triangle + x1 = 50 - (patternZ / 2) + y1 = 50 - (patternZ * .866025) + x2 = 50 + patternZ + y2 = 50 + x3 = x1 + y3 = 100 - y1 + + ' Move to the next starting position for the pattern + patternEx = patternEx + 100 + IF patternZ = 45 THEN + patternEx = patternEx - 300 + patternEy = patternEy + 101 + END IF + + ' Draw the pattern by calculating colors based on distance from triangle vertices + FOR x = 0 TO 100 + FOR y = 0 TO 100 + ' Calculate color components based on distance to each vertex + r = 7 - (SQR((x1 - x) ^ 2 + (y1 - y) ^ 2) / 15 + 1) + g = 7 - (SQR((x2 - x) ^ 2 + (y2 - y) ^ 2) / 15 + 1) + b = 7 - (SQR((x3 - x) ^ 2 + (y3 - y) ^ 2) / 15 + 1) + + ' Clamp color values within the range of 0 to 5 + IF r < 0 THEN r = 0 + IF g < 0 THEN g = 0 + IF b < 0 THEN b = 0 + IF r > 5 THEN r = 5 + IF g > 5 THEN g = 5 + IF b > 5 THEN b = 5 + + ' Calculate the final color index + colorIndex = r * 36 + g * 6 + b + + ' Plot the pixel with the calculated color + PSET (x + patternEx, y + patternEy), colorIndex + NEXT y + NEXT x +NEXT patternZ + +' Wait for user input before proceeding +a$ = INPUT$(1) + +' Reset starting position for the second pattern +patternEx = -100 +patternEy = 0 + +' Draw a second series of patterns using color dithering, to create +' seemingly smooth color transitions while still having only 8bit colors to work with +FOR patternZ = 0 TO 75 STEP 15 + ' Calculate the vertices of an equilateral triangle with different scaling + x1 = 50 - (patternZ / 2.5) + y1 = 50 - (patternZ * .566025) + x2 = 50 + patternZ / 1.5 + y2 = 50 + x3 = x1 + y3 = 100 - y1 + + ' Move to the next starting position for the pattern + patternEx = patternEx + 100 + IF patternZ = 45 THEN + patternEx = patternEx - 300 + patternEy = patternEy + 101 + END IF + + ' Initialize accumulators for dithering color components + rSum = 0 + gSum = 0 + bSum = 0 + + ' Draw the pattern by calculating average colors based on distance from triangle vertices + FOR x = 0 TO 100 + FOR y = 0 TO 100 + ' Calculate color components based on distance to each vertex + r = 30 - (SQR((x1 - x) ^ 2 + (y1 - y) ^ 2) / 2 + 1) + g = 30 - (SQR((x2 - x) ^ 2 + (y2 - y) ^ 2) / 2 + 1) + b = 30 - (SQR((x3 - x) ^ 2 + (y3 - y) ^ 2) / 2 + 1) + + ' Accumulate the color components + rSum = rSum + r + gSum = gSum + g + bSum = bSum + b + + ' Calculate the average color components over a span of 5 pixels + rAvg = rSum / 5 + gAvg = gSum / 5 + bAvg = bSum / 5 + + ' Reset the sums after calculating the averages + rSum = rSum - (rAvg * 5) + gSum = gSum - (gAvg * 5) + bSum = bSum - (bAvg * 5) + + ' Clamp average color values within the range of 0 to 5 + IF rAvg < 0 THEN rAvg = 0 + IF gAvg < 0 THEN gAvg = 0 + IF bAvg < 0 THEN bAvg = 0 + IF rAvg > 5 THEN rAvg = 5 + IF gAvg > 5 THEN gAvg = 5 + IF bAvg > 5 THEN bAvg = 5 + + ' Calculate the final color index + colorIndex = rAvg * 36 + gAvg * 6 + bAvg + + ' Plot the pixel with the calculated color + PSET (x + patternEx, y + patternEy), colorIndex + NEXT y + NEXT x +NEXT patternZ + +' Wait for user input before exiting +a$ = INPUT$(1) \ No newline at end of file diff --git a/Miscellaneous/Custom palette.png b/Miscellaneous/Custom palette.png new file mode 100644 index 0000000..8b62b42 Binary files /dev/null and b/Miscellaneous/Custom palette.png differ diff --git a/Miscellaneous/Database/auto.scr b/Miscellaneous/Database/auto.scr new file mode 100644 index 0000000..6716870 --- /dev/null +++ b/Miscellaneous/Database/auto.scr @@ -0,0 +1,3 @@ +fload data.ddb +chklin 1 |> s 1 +|> c \ No newline at end of file diff --git a/Miscellaneous/Database/data.ddb b/Miscellaneous/Database/data.ddb new file mode 100644 index 0000000..6094893 --- /dev/null +++ b/Miscellaneous/Database/data.ddb @@ -0,0 +1,11 @@ +// 1 First name +// 2 Last name +// 3 Postal address +// 4 Phone +// 5 Sex M / F +// 6 Registration number in the database +// 7 Birth year + +John |Doe |Marshmelow road 1-23 | +385 123123123 |M|0|1985 +Jane |Doe |Candy road 1-23 | +385 123123124 |F|1|1987 + diff --git a/Miscellaneous/Database/ddbase6.bas b/Miscellaneous/Database/ddbase6.bas new file mode 100755 index 0000000..3062e41 --- /dev/null +++ b/Miscellaneous/Database/ddbase6.bas @@ -0,0 +1,975 @@ +' Simple scriptable relational database engine. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2002, Initial version +' 2024, Improved program readability + +DECLARE SUB box (x1%, y1%, x2%, y2%) +DECLARE SUB ssort (s%, m%) +DECLARE SUB sort (s%, w%) +REM $DYNAMIC +DECLARE SUB cmp (a$, b$, r%) +DECLARE SUB boss () +DECLARE SUB std (a$) +DECLARE FUNCTION cnum$ (a%) +DECLARE SUB fload (a$, b%, c%, d%) +DECLARE SUB putfs (f%, l%, s%, c$) +DECLARE SUB gets (l%, s%, a$) +DECLARE SUB puts (l%, s%, a$) +DECLARE SUB runf (a$) +DECLARE SUB getfil (a%) +DEFINT A-Y +DECLARE SUB mkson (a$) +DECLARE SUB title (a$) +DECLARE SUB strip (a$, b$) +DECLARE SUB cmd (a$) +DECLARE SUB conkey (a$) +DECLARE SUB conn (a$) +DECLARE SUB ch () +DECLARE SUB chkey (a$) +DECLARE SUB getkey (a$) +DECLARE SUB conm (d$, c) +DECLARE SUB start () + +DIM SHARED con$(1 TO 50) +DIM SHARED conc(1 TO 50) +DIM SHARED concmd$ +DIM SHARED conx +DIM SHARED sona$(1 TO 20) +DIM SHARED mitus + +DIM SHARED buf$(1 TO 5000) +DIM SHARED bufu(1 TO 5000) +DIM SHARED bufl(1 TO 1000, 1 TO 30) +DIM SHARED buflu(1 TO 1000) +DIM SHARED lng +DIM SHARED opf(1 TO 30) +DIM SHARED hist$(1 TO 20) +DIM SHARED histp, histk +DIM SHARED buff(1 TO 30, 1 TO 1000) +DIM SHARED stack(1 TO 2000, 1 TO 10) +DIM SHARED stackl(1 TO 10) +DIM SHARED stdl + +start + +1 +ch +GOTO 1 + +REM $STATIC +SUB boss +y1 = 0 +yp1 = 100 +y2 = 0 +yp2 = 100 + +lx = 160 +ly = 100 +lxp = 1 +lyp = -1 + +SCREEN 13 + +GOSUB 18 +16 +a$ = INKEY$ +IF a$ = CHR$(0) + "H" THEN yp1 = yp1 - 25 +IF a$ = CHR$(0) + "P" THEN yp1 = yp1 + 25 +IF a$ = CHR$(27) THEN GOTO 17 + +LINE (10, y1 - 35)-(20, y1 + 35), 0, B +LINE (11, y1 - 34)-(19, y1 + 34), 15, B + +LINE (310, y2 - 35)-(300, y2 + 35), 0, B +LINE (309, y2 - 34)-(301, y2 + 34), 15, B + +LINE (lx - 10, ly - 10)-(lx + 10, ly + 10), 0, B +LINE (lx - 9, ly - 9)-(lx + 9, ly + 9), 15, B + +lx = lx + lxp +ly = ly + lyp +IF ly < 20 THEN lyp = 1 +IF ly > 180 THEN lyp = -1 +IF lx < 30 THEN + lxp = 1 + IF ly < y1 - 35 OR ly > y1 + 35 THEN SOUND 1000, 1 +END IF +IF lx > 290 THEN + lxp = -1 + GOSUB 18 +END IF + +IF yp1 > 0 THEN y1 = y1 + 1: yp1 = yp1 - 1 +IF yp1 < 0 THEN y1 = y1 - 1: yp1 = yp1 + 1 +IF yp2 > 0 THEN y2 = y2 + 1: yp2 = yp2 - 1 +IF yp2 < 0 THEN y2 = y2 - 1: yp2 = yp2 + 1 + +SOUND 0, .1 +GOTO 16 + +18 +tlx = lx +tly = ly +tlyp = lyp +tlxp = lxp + +19 +lx = lx + lxp +ly = ly + lyp +IF ly < 20 THEN lyp = 1 +IF ly > 180 THEN lyp = -1 +IF lx < 30 THEN lxp = 1 +IF lx > 290 THEN + yp2 = ly - y2 +ELSE + GOTO 19 +END IF + +SWAP lx, tlx +SWAP ly, tly +SWAP lyp, tlyp +SWAP lxp, tlxp +RETURN + +17 +SCREEN 0 +WIDTH 80, 50 +VIEW PRINT 1 TO 50 +END SUB + +SUB box (x1, y1, x2, y2) +b$ = "" +c$ = "" +FOR a = x1 TO x2 + b$ = b$ + " " + c$ = c$ + "-" +NEXT a + +b$ = "|" + b$ + "|" +c$ = "|" + c$ + "|" + +COLOR 14, 0 +LOCATE y1, x1 +PRINT c$ +LOCATE y2, x1 +PRINT c$ +FOR a = y1 + 1 TO y2 - 1 + LOCATE a, y1 + PRINT b$ +NEXT a + +END SUB + +SUB ch +chkey a$ +IF a$ <> "" THEN conkey a$ + +END SUB + +SUB chkey (a$) +a$ = INKEY$ +IF a$ <> "" THEN + IF a$ = CHR$(0) + "M" THEN a$ = "pa" + IF a$ = CHR$(0) + "K" THEN a$ = "va" + IF a$ = CHR$(0) + "H" THEN a$ = "ul" + IF a$ = CHR$(0) + "P" THEN a$ = "al" +END IF + +END SUB + +SUB cmd (a$) +IF a$ = SPACE$(LEN(a$)) THEN GOTO 5 +conm a$, 14 + +mkson a$ +IF mitus = 0 THEN GOTO 5 + +SELECT CASE sona$(1) +CASE "help" + title "help" + conm "help - for help", 7 + conm "quit - quit program", 7 + conm "b - boss screen", 7 + conm "memstat- show info about memory blocks", 7 + conm "memput - put data to specified memory block", 7 + conm "memlist - show memory blocks, starting from ", 7 + conm "runf - run script file", 7 + conm "lnstat - show info about memory lines", 7 + conm "lnput ... put data in starting from ", 7 + conm "lnlist - show contenc of memory lines", 7 + conm "fstat - show info about memory files", 7 + conm "fput ... put data in memory file", 7 + conm "fload - load data file into memory file", 7 + conm "cls - clear screen", 7 + conm "stclear - clear stack", 7 + conm "chklin - determine used line numbers to STDOUT", 7 + conm "stacksize - determine stack size to STDOUT", 7 + conm "filtand ... filters out lines to STDOUT", 7 + conm "filtor ... filters out lines to STDOUT", 7 + conm "disp ... display formatted selected cells to STDOUT", 7 + conm "sort - sort elements by value, lower first", 7 + conm "swap - swap stack elements (backwards)", 7 + conm "ssort - sort stack in alphabetical order", 7 + conm "memget - allocates memory block, and puts there -", 7 + conm "liststack - show stack values to STDOUT", 7 + conm "ask - asks question, and stores result", 7 + conm "flnget - get unused line in file", 7 +GOTO 5 + +CASE "quit" +SYSTEM + +CASE "memstat" +title "memory blocks summary" +c = 0 +lng = 0 +FOR b = 1 TO 5000 + IF bufu(b) > 0 THEN c = c + 1 + lng = lng + LEN(buf$(b)) +NEXT b +d$ = "memory blocks used:" + STR$(c) + " total 5000" +conm d$, 7 +d$ = "data size:" + STR$(lng) +conm d$, 7 +GOTO 5 + +CASE "memput" +b = VAL(sona$(2)) +strip sona$(3), c$ +IF c$ = "" THEN + bufu(b) = 0 + buf$(b) = "" +ELSE + bufu(b) = 1 + buf$(b) = sona$(3) +END IF +GOTO 5 + +CASE "memlist" +b = VAL(sona$(2)) +c = VAL(sona$(3)) +IF b = 0 THEN b = 1 +IF c = 0 THEN c = 1 + +FOR d = b TO 5000 + IF c = 0 THEN GOTO 5 + IF bufu(d) > 0 THEN + e$ = cnum(d) + ":" + SPACE$(5 - LEN(cnum(d))) + e$ = e$ + buf$(d) + conm e$, 7 + c = c - 1 + END IF +NEXT d +GOTO 5 + +CASE "runf" +runf sona$(2) +GOTO 5 + +CASE "lnstat" +title "memory lines summary" +c = 0 +d = 0 +FOR b = 1 TO 1000 + IF buflu(b) > 0 THEN c = c + 1: d = d + buflu(b) +NEXT b +d$ = "memory lines used:" + STR$(c) + " total 1000" +conm d$, 7 +d$ = "total number of words in lines:" + STR$(d) +conm d$, 7 +GOTO 5 + +CASE "lnput" +b = VAL(sona$(2)) +c = VAL(sona$(3)) +e = mitus +IF e < 4 THEN e = 4 +FOR d = 4 TO e + puts b, c + d - 4, sona$(d) +NEXT d +GOTO 5 + +CASE "lnlist" +b = VAL(sona$(2)) +c = VAL(sona$(3)) + +FOR d = b TO 1000 + IF c = 0 THEN GOTO 5 + IF buflu(d) > 0 THEN + e$ = cnum(d) + ":" + e$ = e$ + SPACE$(5 - LEN(e$)) + e$ = e$ + cnum(buflu(d)) + e$ = e$ + SPACE$(8 - LEN(e$)) + + FOR g = 1 TO 10 + gets d, g, f$ + e$ = e$ + " >" + f$ + NEXT g + conm e$, 7 + c = c - 1 + END IF +NEXT d +GOTO 5 + +CASE "fstat" +title "Memory files summary" +FOR b = 1 TO 30 + e = 0 + FOR c = 1 TO 1000 + IF buff(b, c) > -1 THEN + IF e = 0 THEN + d$ = "File number:" + STR$(b) + conm d$, 7 + e = e + 1 + END IF + d$ = "on line:" + STR$(c) + " allocated memory line: " + STR$(buff(b, c)) + conm d$, 7 + END IF + NEXT c +NEXT b +GOTO 5 + +CASE "fput" +b = VAL(sona$(2)) +c = VAL(sona$(3)) +d = VAL(sona$(4)) +f = mitus +IF f < 5 THEN f = 5 +FOR e = 5 TO f + putfs b, c, d + e - 5, sona$(e) +NEXT e +GOTO 5 + +CASE "cls" +FOR b = 1 TO 50 + conm " ", 7 +NEXT b +GOTO 5 + +CASE "fload" +b = VAL(sona$(3)) +c = VAL(sona$(4)) +d = VAL(sona$(5)) +IF b = 0 THEN b = 1 +IF c = 0 THEN c = 1 +IF d = 0 THEN d = 1 +fload sona$(2), b, c, d +GOTO 5 + +CASE "stclear" +b = VAL(sona$(2)) +IF b = 0 THEN b = 1 +stackl(b) = 0 +GOTO 5 + +CASE "chklin" +b = VAL(sona$(2)) +c = VAL(sona$(3)) +d = VAL(sona$(4)) +IF b = 0 THEN b = 1 +IF c = 0 THEN c = 1 +IF d = 0 THEN d = 1000 + +FOR e = c TO d + IF buff(b, e) > 0 THEN std cnum(buff(b, e)) +NEXT e +GOTO 5 + +CASE "stacksize" +b = VAL(sona$(2)) +IF b = 0 THEN b = 1 +std cnum(stackl(b)) +GOTO 5 + +CASE "b" +boss +conm "returning", 7 +GOTO 5 + +CASE "filtor" +b = VAL(sona$(2)) +FOR e = 1 TO stackl(b) + FOR c = 3 TO mitus STEP 2 + gets stack(e, b), VAL(sona$(c)), f$ + cmp f$, sona$(c + 1), d + IF d = 1 THEN + std cnum(stack(e, b)) + GOTO 20 + END IF + NEXT c +20 +NEXT e +GOTO 5 + +CASE "disp" +b = VAL(sona$(2)) +DIM tmp1(1 TO 100) +DIM tmp2(1 TO 100) + +FOR d = 1 TO 100 + tmp2(d) = 0 +NEXT d +d = 0 + +FOR e = 3 TO mitus + d = d + 1 + tmp1(d) = VAL(sona$(e)) +NEXT e + +FOR c = 1 TO stackl(b) + FOR e = 1 TO d + gets stack(c, b), tmp1(e), f$ + IF tmp2(e) < LEN(f$) THEN tmp2(e) = LEN(f$) + NEXT e +NEXT c + +FOR c = 1 TO stackl(b) + g$ = "" + FOR e = 1 TO d + gets stack(c, b), tmp1(e), f$ + f$ = f$ + SPACE$(tmp2(e) - LEN(f$)) + g$ = g$ + f$ + " # " + NEXT e + conm g$, 10 +NEXT c + +ERASE tmp2 +ERASE tmp1 +GOTO 5 + +CASE "filtand" +b = VAL(sona$(2)) +FOR e = 1 TO stackl(b) + FOR c = 3 TO mitus STEP 2 + gets stack(e, b), VAL(sona$(c)), f$ + cmp f$, sona$(c + 1), d + IF d = 0 THEN GOTO 21 + NEXT c + std cnum(stack(e, b)) +21 +NEXT e +GOTO 5 + +CASE "sort" +b = VAL(sona$(2)) +c = VAL(sona$(3)) +sort b, c +GOTO 5 + +CASE "swap" +b = VAL(sona$(2)) +c = stackl(b) +FOR d = 1 TO c / 2 + SWAP stack(d, b), stack(c - d + 1, b) +NEXT d +GOTO 5 + +CASE "ssort" +b = VAL(sona$(2)) +c = VAL(sona$(3)) +IF b = 0 THEN b = 1 +IF c = 0 THEN c = 1 +ssort b, c +GOTO 5 + +CASE "memget" +b = VAL(sona$(2)) +IF b = 0 THEN b = 1 +FOR c = 1 TO 5000 +IF bufu(c) = 0 THEN bufu(c) = 1: buf$(c) = "-": stack(b, 10) = c: GOTO 23 +NEXT c +23 +IF stackl(10) < b THEN stackl(10) = b +GOTO 5 + +CASE "liststack" +b = VAL(sona$(2)) +c = VAL(sona$(3)) +d = VAL(sona$(4)) +IF b = 0 THEN b = 1 +IF c = 0 THEN c = 1 +IF d = 0 THEN d = stackl(b) +FOR e = c TO d + std cnum(stack(e, b)) +NEXT e +GOTO 5 + +CASE "ask" +b$ = sona$(2) +IF b$ = "" THEN b$ = "input" +c = VAL(sona$(3)) +d = VAL(sona$(4)) +e = VAL(sona$(5)) +box 5, 5, 75, 11 +LOCATE 7, 7 +PRINT b$ +LOCATE 9, 7 +INPUT "", f$ +putfs c, d, e, f$ +conm "'" + f$ + "' accepted", 7 +GOTO 5 + +CASE "flnget" +b = VAL(sona$(2)) +c = VAL(sona$(3)) +FOR d = 1 TO 1000 + IF buff(b, d) = -1 THEN + stack(c, 10) = d + IF stackl(10) < c THEN stackl(10) = c + GOTO 24 + END IF +NEXT d +24 +GOTO 5 + +END SELECT + +conm "Invalid command", 12 +5 +END SUB + +SUB cmp (a$, b$, r%) +IF a$ = b$ THEN r% = 1 ELSE r% = 0 +END SUB + +FUNCTION cnum$ (a) +b$ = STR$(a) +cnum$ = RIGHT$(b$, LEN(b$) - 1) +END FUNCTION + +SUB conkey (a$) +b$ = concmd$ + SPACE$(85) +b$ = LEFT$(b$, 80) + +IF a$ = "va" THEN conx = conx - 1 +IF a$ = "pa" THEN conx = conx + 1 +IF a$ = "ul" THEN + b$ = hist$(histk) + histk = histk - 1 + IF histk < 1 THEN histk = 20 +END IF +IF a$ = "al" THEN + b$ = hist$(histk) + histk = histk + 1 + IF histk > 20 THEN histk = 1 +END IF + +IF LEN(a$) = 1 THEN + IF a$ = CHR$(13) THEN + strip b$, c$ + histp = histp + 1 + IF histp > 20 THEN histp = 1 + histk = histp + hist$(histp) = c$ + cmd c$ + b$ = "" + conx = 1 + GOTO 4 + END IF + + IF a$ = CHR$(8) THEN + IF conx > 1 THEN + b$ = LEFT$(b$, conx - 2) + RIGHT$(b$, 81 - conx) + conx = conx - 1 + END IF + GOTO 4 + END IF + + b$ = LEFT$(b$, conx - 1) + a$ + RIGHT$(b$, 81 - conx) + conx = conx + 1 +END IF +4 + +IF conx < 1 THEN conx = 1 +IF conx > 80 THEN conx = 80 + +b$ = b$ + SPACE$(85) +concmd$ = LEFT$(b$, 80) +LOCATE 50, 1 +COLOR 15, 1 +PRINT concmd$; +LOCATE 50, conx +COLOR 0, 14 +PRINT RIGHT$(LEFT$(concmd$, conx), 1); + + +END SUB + +SUB conm (d$, c) +a$ = d$ + +14 +IF LEN(a$) > 78 THEN + b$ = LEFT$(a$, 78) + conm b$, c + a$ = " >> " + RIGHT$(a$, LEN(a$) - 78) + GOTO 14 +END IF + +b$ = a$ + SPACE$(80 - LEN(a$)) +con$(50) = b$ +conc(50) = c + +FOR a = 1 TO 49 + con$(a) = con$(a + 1) + conc(a) = conc(a + 1) +NEXT a + +FOR a = 1 TO 49 + LOCATE a, 1 + COLOR conc(a), 0 + PRINT con$(a) +NEXT a + +END SUB + +SUB fload (a$, b, c, d) +getfil h + +j = c +l = 0 + +OPEN a$ FOR INPUT AS #h +12 +IF EOF(h) <> 0 THEN GOTO 13 +LINE INPUT #h, e$ + +IF LEFT$(e$, 3) = "// " THEN + conm e$, 10 + GOTO 12 +END IF +IF e$ = SPACE$(LEN(e$)) THEN GOTO 12 + +e$ = e$ + "|" +l = l + 1 +h$ = "" +i = d +FOR f = 1 TO LEN(e$) + g$ = RIGHT$(LEFT$(e$, f), 1) + IF g$ = "|" THEN + putfs b, j, i, h$ + h$ = "" + g$ = "" + i = i + 1 + END IF + IF g$ = CHR$(9) THEN g$ = "" + h$ = h$ + g$ +NEXT f + +j = j + 1 +GOTO 12 +13 +CLOSE #h + +opf(h) = 0 + +k$ = "file: " + a$ + " loaded." + STR$(l) + " lines in file" +conm k$, 7 +END SUB + +SUB getfil (a) +FOR b = 1 TO 30 + IF opf(b) = 0 THEN + opf(b) = 1 + a = b + GOTO 7 + END IF +NEXT b +7 +END SUB + +SUB gets (l, s, a$) + +b = bufl(l, s) + +IF b = -1 THEN + a$ = "" +ELSE + a$ = buf$(b) +END IF + +END SUB + +SUB mkson (a$) + +mitus = 0 + +d = 1 +FOR b = 1 TO LEN(a$) + c$ = RIGHT$(LEFT$(a$, b), 1) + IF c$ = " " THEN + d = 1 + ELSE + IF d = 1 THEN + mitus = mitus + 1 + sona$(mitus) = "" + d = 0 + END IF + sona$(mitus) = sona$(mitus) + c$ + END IF +NEXT b + +'conm "sonad_______", 10 +'FOR b = 1 TO mitus +'conm sona$(b), 14 +'NEXT b + +FOR a = 1 TO mitus + IF LEFT$(sona$(a), 2) = "|>" THEN + IF sona$(a + 1) = "c" THEN stdl = 1 + IF sona$(a + 1) = "s" THEN stdl = 10 + VAL(sona$(a + 2)) + mitus = a - 1 + GOTO 15 + END IF + IF LEFT$(sona$(a), 2) = "|@" THEN + sona$(a) = cnum(stack(VAL(RIGHT$(sona$(a), LEN(sona$(a)) - 2)), 10)) + END IF +NEXT a + +15 +FOR a = mitus + 1 TO 20 + sona$(a) = "" +NEXT a + +END SUB + +SUB putfs (f, l, s, c$) + +'DIM SHARED buff(1 TO 30, 1 TO 1000) + +la = buff(f, l) + +IF la = -1 THEN + FOR a = 1 TO 1000 + IF buflu(a) = 0 THEN + la = a + GOTO 10 + END IF + NEXT a +10 +END IF + +puts la, s, c$ +IF buflu(la) = 0 THEN + buff(f, l) = -1 +ELSE + buff(f, l) = la +END IF +END SUB + +SUB puts (l, s, a$) +'PRINT l, s +IF a$ = "|" THEN a$ = "" +IF a$ = "||" THEN GOTO 11 +'conm a$, 13 +b = bufl(l, s) + +IF b = -1 THEN + FOR c = 1 TO 10000 + IF bufu(c) = 0 THEN + GOTO 6 + END IF + NEXT c +6 + b = c + bufu(b) = 1 + buflu(l) = buflu(l) + 1 +END IF + +strip a$, c$ + +IF c$ = "" THEN + bufu(b) = 0 + buf$(b) = "" + bufl(l, s) = -1 + buflu(l) = buflu(l) - 1 +ELSE + buf$(b) = c$ + bufl(l, s) = b +END IF +11 + +END SUB + +SUB runf (a$) +getfil h + +OPEN a$ FOR INPUT AS #h +9 +IF EOF(h) <> 0 THEN GOTO 8 +LINE INPUT #h, b$ +cmd b$ +GOTO 9 +8 +CLOSE #h + +opf(h) = 0 + +END SUB + +SUB sort (s, w) +DIM tmp1(1 TO 10000) +DIM tmp2(1 TO 10000) + +b = stackl(s) + +FOR a = 1 TO b + gets stack(a, s), w, c$ + tmp1(a) = VAL(c$) + tmp2(a) = a +NEXT a + +d = 1 +FOR a = 1 TO b + e = 32000 + + FOR c = d TO b + IF tmp1(c) < e THEN + e = tmp1(c) + f = c + END IF + NEXT c + SWAP tmp1(a), tmp1(f) + SWAP tmp2(a), tmp2(f) + d = d + 1 +NEXT a + +FOR a = 1 TO b + stack(a, s) = tmp2(a) +NEXT a + +END SUB + +SUB ssort (s, m) +DIM tbti(1 TO 2000) +DIM tbtp(1 TO 2000) +DIM tbt$(1 TO 2000) + +FOR a = 1 TO stackl(s) + gets stack(a, s), m, b$ + tbt$(a) = b$ + tbtp(a) = a +NEXT a + +b = stackl(s) +FOR a = 1 TO stackl(s) +d$ = tbt$(1) +e = 1 +f = ASC(LEFT$(d$, 1)) +FOR c = 2 TO b +IF ASC(LEFT$(tbt$(c), 1)) = f THEN +IF d$ <> tbt$(c) THEN +g$ = d$ + CHR$(0) +h$ = tbt$(c) + CHR$(0) +i = LEN(g$) +IF LEN(h$) > i THEN i = LEN(h$) +FOR j = 1 TO i +k = ASC(RIGHT$(LEFT$(g$, j), 1)) +l = ASC(RIGHT$(LEFT$(h$, j), 1)) +IF k < l THEN GOTO 22 +IF l < k THEN e = c: d$ = tbt$(c): f = ASC(LEFT$(d$, 1)): GOTO 22 +NEXT j +END IF +END IF +IF ASC(LEFT$(tbt$(c), 1)) < f THEN f = ASC(LEFT$(tbt$(c), 1)): e = c: d$ = tbt$(c) +22 +NEXT c + + tbti(a) = tbtp(e) + tbt$(e) = tbt$(b) + tbtp(e) = tbtp(b) + b = b - 1 +NEXT a + +FOR a = 1 TO stackl(s) + stack(a, s) = tbti(a) +NEXT a + +conm "done", 7 + +END SUB + +SUB start +WIDTH 80, 50 +VIEW PRINT 1 TO 50 +CLS +conx = 1 +histp = 1 +histk = 1 +stdl = 1 + +conm "DDBASE, (Dos Data BASE) 0.0", 7 +conm "Copyright Svjatoslav Agejenko. All Rights Reserved.", 7 +conm "starting...", 7 +FOR a = 1 TO 5000 + bufu(a) = 0 + buf$(a) = "" +NEXT a + +FOR a = 1 TO 30 + FOR b = 1 TO 1000 + bufl(b, a) = -1 + buff(a, b) = -1 + NEXT b + opf(a) = 0 +NEXT a + +FOR a = 1 TO 1000 + buflu(a) = 0 +NEXT a + +FOR a = 1 TO 10 + stackl(a) = 0 +NEXT a + +a$ = "runf auto.scr" +FOR b = 1 TO LEN(a$) + c$ = RIGHT$(LEFT$(a$, b), 1) + conkey c$ +NEXT b +conkey CHR$(13) + +END SUB + +SUB std (a$) +'conm a$, 2 + +SELECT CASE stdl +CASE 1 + conm a$, 10 +CASE 11 TO 20 + b = stdl - 10 + stackl(b) = stackl(b) + 1 + stack(stackl(b), b) = VAL(a$) + + c$ = a$ + " > " + cnum(stackl(b)) + " ! " + cnum(b) +END SELECT + +END SUB + +SUB strip (a$, b$) +b$ = a$ +2 +IF LEFT$(b$, 1) = " " THEN + b$ = RIGHT$(b$, LEN(b$) - 1) + GOTO 2 +END IF +3 +IF RIGHT$(b$, 1) = " " THEN + b$ = LEFT$(b$, LEN(b$) - 1) + GOTO 3 +END IF + +END SUB + +SUB title (a$) +conm " ", 10 +conm "================> " + a$ + " <===============", 7 + +END SUB diff --git a/Miscellaneous/Database/lisa.scr b/Miscellaneous/Database/lisa.scr new file mode 100644 index 0000000..30e4900 --- /dev/null +++ b/Miscellaneous/Database/lisa.scr @@ -0,0 +1,11 @@ +flnget 1 1 +ask Eesnimi 1 |@1 1 +ask Perekonnanimi 1 |@1 2 +ask Aadress 1 |@1 3 +ask Telefon 1 |@1 4 +ask Sugu_M_voi_N 1 |@1 5 +ask Snniaasta 1 |@1 7 +stclear 1 +chklin 1 |> s 1 +stacksize 1 |> c + diff --git a/Miscellaneous/Mouse driver/index.html b/Miscellaneous/Mouse driver/index.html new file mode 100644 index 0000000..25a8c73 --- /dev/null +++ b/Miscellaneous/Mouse driver/index.html @@ -0,0 +1,16 @@ + +QBasic mouse extension + + +

QBasic mouse extension

+
+
+ +This TSR written in x86 assembler, allows QBasic programs to use mouse, +by writing mouse movement and button press info to memory, +referenced by INT 79h. +Afterwards QBasic programs can read mouse cursor position +directly from RAM by using PEEK command. + + + \ No newline at end of file diff --git a/Miscellaneous/Mouse driver/mousedrv.bas b/Miscellaneous/Mouse driver/mousedrv.bas new file mode 100755 index 0000000..92d177c --- /dev/null +++ b/Miscellaneous/Mouse driver/mousedrv.bas @@ -0,0 +1,146 @@ +' QBasic does not have mouse support. Here is demonstration of custom mouse driver. +' In order to use mouse, special custom TSR (Terminate and Stay Resident) mouse driver +' has to be loaded before running this demo. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2004.01, Initial version + +DECLARE SUB mousedemo () +DECLARE SUB putword (addr!, dat!) +DECLARE FUNCTION getword! (addr!) +DECLARE FUNCTION getbyte! (addr!) +DECLARE SUB start () + +DIM SHARED extSEG, extADDR + +start + +mousedemo + +FUNCTION getbyte (addr) + ' This function retrieves a byte from the specified address. + getbyte = PEEK(extADDR + addr) +END FUNCTION + +FUNCTION getword (addr) + ' This function retrieves a word (2 bytes) from the specified address. + a = PEEK(extADDR + addr) + b = PEEK(extADDR + addr + 1) + + c$ = HEX$(a) + IF LEN(c$) = 1 THEN c$ = "0" + c$ + IF LEN(c$) = 0 THEN c$ = "00" + + ' Combine the two bytes into a single word. + c = VAL("&H" + HEX$(b) + c$) + + getword = c +END FUNCTION + +SUB mousedemo + ' This subroutine demonstrates mouse movement and button clicks. + + cx = 150 + cy = 100 + maxmove = 50 + + 1 + frm = frm + 1 + + ' Check for user input on keyboard and exit if any key is pressed + IF INKEY$ <> "" THEN SYSTEM + + ' Print the current coordinates and frame number. + LOCATE 1, 1 + PRINT cx, cy + PRINT frm + + ' Draw a circle at the current mouse position. + CIRCLE (cx, cy), 10, 0 + + ' Retrieve the x and y movement values from the mouse. + xp = getword(2) + putword 2, 0 + yp = getword(4) + putword 4, 0 + + ' Retrieve the button status from the mouse. + butt = getword(6) + putword 6, 0 + + ' Print the button status if a button is pressed. + IF butt <> 0 THEN + LOCATE 5 + PRINT butt + END IF + + ' Limit the mouse movement to within maxmove. + IF xp < -maxmove THEN xp = -maxmove + IF xp > maxmove THEN xp = maxmove + cx = cx + xp + + IF yp < -maxmove THEN yp = -maxmove + IF yp > maxmove THEN yp = maxmove + cy = cy + yp + + ' Draw a circle at the new mouse position. + CIRCLE (cx, cy), 10, 10 + + ' Use sound command for adding short delay + SOUND 0, .05 + + ' Repeat the loop to continuously update the mouse position. + GOTO 1 + +END SUB + +SUB putword (addr, dat) + ' This subroutine stores a word (2 bytes) at the specified address. + + b$ = HEX$(dat) + + 2 + IF LEN(b$) < 4 THEN b$ = "0" + b$: GOTO 2 + + ' Split the word into two bytes. + n1 = VAL("&H" + LEFT$(b$, 2)) + n2 = VAL("&H" + RIGHT$(b$, 2)) + + ' Store the bytes at the specified address. + POKE (extADDR + addr), n2 + POKE (extADDR + addr + 1), n1 + +END SUB + +SUB start + ' This subroutine initializes the screen and retrieves the segment and address of the mouse driver. + + SCREEN 13 + + DEF SEG = 0 ' read first from interrupt table + + extSEG = PEEK(&H79 * 4 + 3) * 256 + extSEG = extSEG + PEEK(&H79 * 4 + 2) + + PRINT "Segment is: " + HEX$(extSEG) + + extADDR = PEEK(&H79 * 4 + 1) * 256 + extADDR = extADDR + PEEK(&H79 * 4 + 0) + + PRINT "relative address is:"; extADDR + + DEF SEG = extSEG + + ' Check if the mouse driver is loaded. + IF getword(0) <> 1983 THEN + PRINT "FATAL ERROR: you must load" + PRINT "QBasic extension TSR first!" + SYSTEM + END IF + +END SUB \ No newline at end of file diff --git a/Miscellaneous/Mouse driver/qbext.asm b/Miscellaneous/Mouse driver/qbext.asm new file mode 100644 index 0000000..57dd874 --- /dev/null +++ b/Miscellaneous/Mouse driver/qbext.asm @@ -0,0 +1,84 @@ +; TSR hack that allows QBasic programs to use mouse. +; Made by Svjatoslav Agejenko +; in 2004.01 +; Homepage: http://svjatoslav.eu + + +org 100h + +myint = 79h ; interrupt to hook, becomes pointer to data table + + + mov dx, msg + mov ah, 9 + int 21h + + mov ax, 0 ; Saves old interrupt vector + mov es, ax + mov eax, [es:32] + mov [oldVector], eax + + cli + mov ax, cs ; Set new interrupt vector for IRQ 0 + shl eax, 16 + mov ax, custom + mov [es:32], eax + mov ax, dataTable ; Set interrupt vector for INT 79 (default) + mov [es:4 * myint], eax + sti + + mov ax, endPointer ; Calculate needed memory size, become TSR + add ax, 32 + mov dx, 0 + mov bx, 16 + div bx + mov dx, ax + mov ax, 3100h + int 21h + +custom: + pushf ; Execute default code in old int vector + call dword [cs:oldVector] + + cmp [cs:isRunning], 0 ; Check if custom routine is already active + jne EndOfRoutine + + mov [cs:isRunning], 1 ; Set active flag + pusha + push ds + push es + + cli + mov ax, 0bh ; Read Mouse Motion Counters + int 33h + add [CS:mouseHorisontal], cx + add [CS:mouseVertical], dx + mov ax, 3 ; read mouse buttons + int 33h + or [CS:mouseButtons], bx + inc byte [CS:updated] + sti + + pop es + pop ds + popa + mov [cs:isRunning], 0 ; Terminate active flag + EndOfRoutine: + iret + +oldVector dd 0 +isRunning db 0 + +dataTable: + dw 1983 ; check number, indicates that module is loaded + mouseHorisontal dw 0 + mouseVertical dw 0 + mouseButtons dw 0 + updated db 0 + + +endPointer: + +msg: +file 'readme.txt' + db '$' diff --git a/Miscellaneous/Mouse driver/qbext.com b/Miscellaneous/Mouse driver/qbext.com new file mode 100755 index 0000000..ae54fc4 Binary files /dev/null and b/Miscellaneous/Mouse driver/qbext.com differ diff --git a/Miscellaneous/Password lock/passw.bas b/Miscellaneous/Password lock/passw.bas new file mode 100644 index 0000000..b47b4b7 --- /dev/null +++ b/Miscellaneous/Password lock/passw.bas @@ -0,0 +1,252 @@ +' Program tries to render fancy rocket control system with password protection. +' When entered password is wrong, program will halt in 3 attempts. +' When password is correct, program will exit and return control to the user. +' Password is stored in "passw.dat" file. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2002, Initial version. +' 2024, Improved program readability. + + +DECLARE SUB checkPassword (a$) +DECLARE SUB startProgram () +DECLARE SUB makeVerticalLines (s%, C%) +DECLARE SUB drawBox (x1%, y1%, x2%, y2%) + +DIM SHARED cha +DIM SHARED password$ + +startProgram + +' Initialize variables +x = 25 +x2 = 10 +x3 = 0 +B$ = "" + +1 +' Update position of the bouncing ball +x = x + xs +IF x > 0 THEN + ' Decrease speed if ball is moving right + xs = xs - .5 +ELSE + ' Increase speed if ball is moving left + xs = xs + .5 +END IF +' Gradually decrease the speed +xs = xs - (xs / 8) + +' Draw a vertical line and a dot +IF x2 > 100 THEN + ' Reset the position of the line + x2 = 10 +ELSE + LINE (x2, 10)-(x2, 60), 0 + PSET (x2, x + 35), 10 +END IF +' Draw another vertical line next to the first one +IF x2 < 99 THEN + LINE (x2 + 1, 10)-(x2 + 1, 60), 3 +END IF + +' Update position of the lines +x2 = x2 + 1 +x3 = x3 + 1 + +' Play a sound when the ball hits the right edge +IF x3 > 40 THEN + x3 = 0 + xs = xs - 5 + SOUND 1000, 1 +END IF + +SOUND 0, .5 + +a$ = INKEY$ +' Check if the Enter key is pressed +IF a$ = CHR$(13) THEN + ' Validate the entered password + checkPassword B$ + ' Clear the input buffer + B$ = "" + GOTO 2 +END IF + +' Check if any other key is pressed +IF a$ <> "" THEN + ' Handle backspace + IF a$ = CHR$(8) THEN + ' Remove the last character from the input buffer + IF LEN(B$) > 0 THEN + B$ = LEFT$(B$, LEN(B$) - 1) + END IF + GOTO 2 + END IF + ' Add the pressed key to the input buffer + B$ = B$ + a$ + ' Limit the length of the input buffer + IF LEN(B$) > 10 THEN + B$ = LEFT$(B$, 10) + END IF +2 + ' Draw the characters in the input buffer + FOR a = 1 TO 10 + ' Determine the color of the character + IF a <= LEN(B$) THEN + C = 5 + ELSE + C = 1 + END IF + ' Draw the character + CIRCLE (a * 15 + 20, 150), 6, C + PAINT (a * 15 + 20, 150), C + NEXT a +END IF + +GOTO 1 + +SUB checkPassword (a$) + cha = cha - 1 + + ' Check if the entered password is correct + IF a$ = password$ THEN + CLS + SCREEN 2 + SYSTEM + END IF + + ' Draw the background of the error message box + DIM buf(1 TO 3000) + GET (79, 80)-(241, 141), buf(1) + + ' Draw the borders of the error message box + drawBox 80, 90, 240, 140 + + ' Display the error message + LOCATE 14, 14 + COLOR 12 + PRINT "Wrong password" + + ' Display the number of remaining attempts + COLOR 5 + LOCATE 16, 13 + PRINT STR$(cha) + " chances left" + + ' Play a sound to indicate an error + FOR a = 1 TO 30 + SOUND 0, 1 + NEXT a + + ' Display the final message when all attempts are exhausted + IF cha = 0 THEN + DIM buf2(1000) + GET (79, 138)-(241, 140), buf2 + FOR a = 1 TO 40 + PUT (79, 138 + a), buf2, PSET + SOUND 0, .5 + NEXT a + + LOCATE 19, 14 + COLOR 12 + PRINT "SYSTEM HALTED" + LOCATE 21, 14 + PRINT "SUCCESSFULLY!!" +3 + GOTO 3 + END IF + + ' Restore the background of the error message box + PUT (79, 80), buf(1), PSET +END SUB + +DEFINT A-Z +SUB drawBox (x1%, y1%, x2%, y2%) + ' Draw the top border of the box + LINE (x1 + 1, y1 + 1)-(x2 - 1, y2 - 1), 0, BF + ' Draw the bottom border of the box + LINE (x1, y1)-(x2, y2), 10, B + ' Draw the left and right borders of the box + LINE (x1, y1)-(x2, y1 - 9), 14, BF + LINE (x1, y1)-(x2, y1 - 9), 10, B + + ' Draw the top left corner of the box + LINE (x2 - 2, y1 - 2)-(x2 - 7, y1 - 7), 7, BF + ' Draw the top right corner of the box + LINE (x2 - 9, y1 - 2)-(x2 - 14, y1 - 7), 7, BF + + ' Draw the diagonal lines in the top left corner + LINE (x2 - 2, y1 - 2)-(x2 - 7, y1 - 7), 0 + LINE (x2 - 2, y1 - 7)-(x2 - 7, y1 - 2), 0 + + ' Draw the horizontal line in the top left corner + LINE (x2 - 10, y1 - 3)-(x2 - 13, y1 - 3), 0 +END SUB + +SUB makeVerticalLines (s%, C%) + ' Draw vertical lines + FOR x = 160 TO 319 STEP s + LINE (x, 0)-(x, 199), C + LINE (320 - x, 0)-(320 - x, 199), C + NEXT x + + ' Draw horizontal lines + FOR y = 100 TO 199 STEP s + LINE (0, y)-(319, y), C + LINE (0, 200 - y)-(319, 200 - y), C + NEXT y +END SUB + +DEFSNG A-Z +SUB startProgram + ' Read the password from the file + OPEN "passw.dat" FOR INPUT AS #1 + LINE INPUT #1, password$ + CLOSE #1 + + ' Set the screen mode + SCREEN 13 + + ' Initialize the number of remaining attempts + cha = 3 + + ' Draw vertical lines with increasing spacing + s = 2 + FOR C = 16 TO 31 + s = s * 1.4 + makeVerticalLines INT(s), INT(C) + NEXT C + makeVerticalLines INT(s), 0 + + ' Draw the main box + drawBox 70, 20, 270, 90 + + ' Display the initial message + COLOR 5 + LOCATE 8, 10 + PRINT " stack dump:" + LOCATE 9, 10 + PRINT "010010010010010010010100" + + ' Display the running message + LOCATE 10, 10 + PRINT "Running rocket ground" + LOCATE 11, 10 + PRINT "control system..." + + ' Draw the input box + drawBox 9, 9, 101, 61 + + ' Draw the password input box + drawBox 20, 130, 300, 190 + + ' Display the password prompt + LOCATE 18, 5 + PRINT "ENTER PASSWORD:" +END SUB + diff --git a/Miscellaneous/Password lock/passw.dat b/Miscellaneous/Password lock/passw.dat new file mode 100644 index 0000000..6ea1900 --- /dev/null +++ b/Miscellaneous/Password lock/passw.dat @@ -0,0 +1 @@ +jerry \ No newline at end of file diff --git a/Miscellaneous/Password lock/screenshot, 1.png b/Miscellaneous/Password lock/screenshot, 1.png new file mode 100644 index 0000000..bada664 Binary files /dev/null and b/Miscellaneous/Password lock/screenshot, 1.png differ diff --git a/Miscellaneous/Password lock/screenshot, 2.png b/Miscellaneous/Password lock/screenshot, 2.png new file mode 100644 index 0000000..c5183c9 Binary files /dev/null and b/Miscellaneous/Password lock/screenshot, 2.png differ diff --git a/Miscellaneous/Pressed key test.bas b/Miscellaneous/Pressed key test.bas new file mode 100644 index 0000000..d4d8af3 --- /dev/null +++ b/Miscellaneous/Pressed key test.bas @@ -0,0 +1,26 @@ +' Utility to print information about pressed keyboard buttons. +' + +MainLoop: + ' Wait for a key press and store it in userInput$ + userInput$ = INKEY$ + + ' If no key has been pressed, jump back to the main loop + IF userInput$ = "" THEN GOTO MainLoop + + ' Print the character that was typed by the user + PRINT "You typed: "; userInput$ + + ' Calculate the ASCII value of the first character (if input is more than one character) + ' and print it + IF LEN(userInput$) > 0 THEN + PRINT "ASCII value of the first character ('"; LEFT$(userInput$, 1); "'): "; ASC(LEFT$(userInput$, 1)) + END IF + + ' Calculate the ASCII value of the last character and print it + IF LEN(userInput$) > 0 THEN + PRINT "ASCII value of the last character ('"; RIGHT$(userInput$, 1); "'): "; ASC(RIGHT$(userInput$, 1)) + END IF + + ' Jump back to the main loop to wait for another key press + GOTO MainLoop \ No newline at end of file diff --git a/Miscellaneous/Video modes detector.bas b/Miscellaneous/Video modes detector.bas new file mode 100644 index 0000000..9602423 --- /dev/null +++ b/Miscellaneous/Video modes detector.bas @@ -0,0 +1,54 @@ +' Utility to determine available video modes. +' +' Written by Svjatoslav Agejenko +' Homepage: svjatoslav.eu +' Email: svjatoslav@svjatoslav.eu + +' 2001, initial version +' 2024.08, used AI to enhance program readability + +DIM SHARED AvailableModes(1 TO 100) AS INTEGER +ON ERROR GOTO ErrorHandler + +' Initialize the video mode counter and the current mode number. +currentModeIndex = 1 +currentModeNumber = 0 + +' Start the loop to test each video mode. +DO + ' Attempt to set the screen to the current video mode. + SCREEN currentModeNumber + + ' Increment the mode number for the next iteration. + currentModeNumber = currentModeNumber + 1 + + ' Store the successful video mode in the array. + AvailableModes(currentModeIndex) = currentModeNumber - 1 + + ' Move to the next index in the array. + currentModeIndex = currentModeIndex + 1 + +LOOP + +' Error handling routine when an error occurs (e.g., invalid video mode). +ErrorHandler: +' Increment the mode number to continue testing after an error. +currentModeNumber = currentModeNumber + 1 + +' Check if we have reached the maximum number of modes to test. +IF currentModeNumber > 1000 THEN + ' Reset the screen to text mode (usually mode 1). + SCREEN 1 + + ' Display the list of available video modes. + PRINT "Available video modes on this computer:" + FOR modeIndex = 1 TO currentModeIndex - 1 + PRINT AvailableModes(modeIndex) + NEXT modeIndex + + ' End the program after displaying the results. + END +END IF + +' Resume execution after an error to continue testing modes. +RESUME \ No newline at end of file diff --git a/Miscellaneous/alarm 1.bas b/Miscellaneous/alarm 1.bas new file mode 100755 index 0000000..5e973a0 --- /dev/null +++ b/Miscellaneous/alarm 1.bas @@ -0,0 +1,57 @@ +' Program to play sound that resembles security alarm. +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' ?, Initial version +' 2024 - 2025, Enhanced program readability + +SCREEN 1 +CLS + +' Initialize main frequency control variable +' This will create the oscillating siren effect by increasing/decreasing value +currentFrequency = 40 + +StartLoop: + ' Play primary oscillating tone (main siren component) + ' Frequency sweeps up and down between thresholds + SOUND currentFrequency, .3 + + ' Add secondary fixed-frequency component (200Hz for 1 duration unit) + ' Creates layered audio effect that makes alarm more realistic + ' Duration parameter uses QBasic's time units (1 ≈ 0.05 seconds) + SOUND 200, 1 + + ' Rapidly increase frequency for ascending siren sweep + ' Jump amount (100) creates dramatic pitch jumps + currentFrequency = currentFrequency + 100 + + ' Check if we've exceeded upper frequency threshold (1000Hz) + ' If yes, switch to descending phase + IF currentFrequency > 1000 THEN GoTo DecreaseFrequency + + ' Repeat ascending sweep until reaching maximum threshold + GOTO StartLoop + +DecreaseFrequency: + ' Continue playing oscillating tone during descending phase + SOUND currentFrequency, .3 + + ' Add high-pitched pulse (500Hz for short duration) + ' Creates distinctive alarm "warble" pattern + ' Shorter duration (.2) adds rhythmic pulsing + SOUND 500, .2 + + ' Gradually decrease frequency for descending sweep + ' Smaller decrement (10) creates slower descent than ascent + currentFrequency = currentFrequency - 10 + + ' Check if we've dropped below lower threshold (200Hz) + ' If yes, restart ascending phase to complete siren cycle + IF currentFrequency < 200 THEN GoTo StartLoop + + ' Continue descending sweep until reaching minimum threshold + GOTO DecreaseFrequency diff --git a/Miscellaneous/alarm 1.mp3 b/Miscellaneous/alarm 1.mp3 new file mode 100644 index 0000000..eec2000 Binary files /dev/null and b/Miscellaneous/alarm 1.mp3 differ diff --git a/Miscellaneous/alarm 2.bas b/Miscellaneous/alarm 2.bas new file mode 100755 index 0000000..87f03c1 --- /dev/null +++ b/Miscellaneous/alarm 2.bas @@ -0,0 +1,34 @@ +' This program generates a security alarm sound effect with two alternating patterns + +DEFINT A-Z + +' Start of infinite alarm cycle +1 + + ' Pattern 1: Ascending frequency sweep with counterpoint tone + ' Increase primary frequency from 100Hz to 1000Hz in steps of 3Hz + FOR ascendingFrequency = 100 TO 1000 STEP 3 + ' Play main ascending tone + SOUND ascendingFrequency, .05 + + ' Generate counterpoint tone that decreases as primary increases + ' Formula creates complementary frequency by subtracting double current frequency + ' At 100Hz -> 5000-2*100=4800Hz; At 1000Hz -> 5000-2*1000=3000Hz + counterToneFrequency = 5000 - (ascendingFrequency * 2) + SOUND counterToneFrequency, .1 + NEXT ascendingFrequency + + ' Pattern 2: Descending frequency sweep with harmonic enhancement + ' Decrease frequency from 1000Hz back to 100Hz in larger steps (-5) + FOR descendingFrequency = 1000 TO 100 STEP -5 + ' Play main descending tone + SOUND descendingFrequency, .05 + + ' Add harmonic overtone at triple frequency plus small offset + ' Creates richer, more complex sound texture + harmonicFrequency = (descendingFrequency * 3) + 10 + SOUND harmonicFrequency, .05 + NEXT descendingFrequency + +' Continuously repeat between both sound patterns +GOTO 1 diff --git a/Miscellaneous/alarm 2.mp3 b/Miscellaneous/alarm 2.mp3 new file mode 100644 index 0000000..c00ecf5 Binary files /dev/null and b/Miscellaneous/alarm 2.mp3 differ diff --git a/Miscellaneous/windowing system.bas b/Miscellaneous/windowing system.bas new file mode 100755 index 0000000..ff0d067 --- /dev/null +++ b/Miscellaneous/windowing system.bas @@ -0,0 +1,274 @@ +' Text mode windowing system. Each window can display text file. +' Window content can be scrolled horizontally and vertically. +' Window can have arbitrary size and location on the screen. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu + +' Changelog: +' 2003, Initial version +' 2024-2025, Improved program readability + +DECLARE SUB demo () +DECLARE FUNCTION GetLineFromWindow$ (windowNum%, lineNum%) +DECLARE SUB LoadFileIntoWindow (fileName$, windowNum%) +DECLARE SUB SendLineToWindow (windowNum%, lineNum%, newString$) +DECLARE FUNCTION GetFreeLineIndex% () +DECLARE SUB RefreshAllWindows () +DECLARE FUNCTION AddWindow% (x%, y%, widt%, haigh%, title$) +DECLARE SUB DrawBox (x%, y%, widt%, haigh%, edgeStyle$) +DEFINT A-Z +DECLARE SUB ShowWindow (windowNum) +DECLARE SUB InitializeSystem () + +' Global variables for text storage +DIM SHARED maxStorage% +maxStorage% = 5000 +DIM SHARED textStorage$(1 TO maxStorage%) +DIM SHARED storagePointer% + +' Window-related global arrays +DIM SHARED windowData(1 TO 10, 1 TO 1000) ' Stores line indices for each window +DIM SHARED windowX(1 TO 10), windowY(1 TO 10) ' Position of each window +DIM SHARED windowWidth(1 TO 10), windowHeight(1 TO 10) ' Size of each window +DIM SHARED windowActiveStatus(1 TO 10) ' Whether window is active +DIM SHARED windowTitle$(1 TO 10) ' Title of each window + +' Window scrolling/shifting +DIM SHARED windowShiftX(1 TO 10) ' Horizontal shift +DIM SHARED windowShiftY(1 TO 10) ' Vertical shift + +DIM SHARED currentActiveWindow% ' Currently active window for display + +InitializeSystem + +demo + +FUNCTION AddWindow% (x%, y%, widt%, heigh%, title$) + ' Adds a new window to the system + + ' Find an empty window slot + FOR windowNum% = 1 TO 10 + IF windowActiveStatus(windowNum%) = 0 THEN + foundWindow% = windowNum% + GOTO FoundEmptySlot + END IF + NEXT windowNum% + +FoundEmptySlot: + ' Initialize the window properties + windowActiveStatus(foundWindow%) = 1 + windowX(foundWindow%) = x% + windowY(foundWindow%) = y% + windowWidth(foundWindow%) = widt% + windowHeight(foundWindow%) = heigh% + windowTitle$(foundWindow%) = title$ + + ' Return the window number + AddWindow% = foundWindow% +END FUNCTION + +SUB ClearWindowContent (windowNum%) + ' Clears all content from a window + + FOR lineNum% = 1 TO 1000 + IF windowData(windowNum%, lineNum%) > 0 THEN + textStorage$(windowData(windowNum%, lineNum%)) = "" + windowData(windowNum%, lineNum%) = 0 + END IF + NEXT lineNum% +END SUB + +SUB demo + ' Create three windows with different sizes and titles + window1% = AddWindow%(1, 1, 30, 10, "window 1.") + window2% = AddWindow%(1, 12, 80, 30, "second window") + window3% = AddWindow%(31, 2, 30, 10, "last window") + + ' Load the same file into all windows + LoadFileIntoWindow "wsystem.bas", window2% + LoadFileIntoWindow "wsystem.bas", window1% + LoadFileIntoWindow "wsystem.bas", window3% + +AnimateWindows: + ' Randomly select an active window to animate + currentActiveWindow% = INT(RND * 3) + 1 + RefreshAllWindows + + ' Animate the windows by shifting their content + FOR animationFrame% = 1 TO 100 + windowShiftX(currentActiveWindow%) = SIN(animationFrame% / 10) * 10 + 10 + windowShiftY(currentActiveWindow%) = animationFrame% + ShowWindow currentActiveWindow% + ' split-second delay + SOUND 0, 1 + IF INKEY$ <> "" THEN SYSTEM + NEXT animationFrame% + + GOTO AnimateWindows +END SUB + +FUNCTION GetFreeLineIndex% + ' Finds a free line in text storage + +FindNextLine: + IF storagePointer% > 1000 THEN + storagePointer% = 1 + END IF + + IF textStorage$(storagePointer%) = "" THEN + GetFreeLineIndex% = storagePointer% + storagePointer% = storagePointer% + 1 + ELSE + storagePointer% = storagePointer% + 1 + GOTO FindNextLine + END IF +END FUNCTION + +FUNCTION GetLineFromWindow$ (windowNum%, lineNum%) + ' Retrieve a line from a window's memory + + IF windowData(windowNum%, lineNum%) = 0 THEN + GetLineFromWindow$ = "" + ELSE + GetLineFromWindow$ = textStorage$(windowData(windowNum%, lineNum%)) + END IF +END FUNCTION + +SUB LoadFileIntoWindow (fileName$, windowNum%) + ' Load a file into a window's memory + + OPEN fileName$ FOR INPUT AS #1 + FOR lineNum% = 1 TO 1000 + IF EOF(1) <> 0 THEN + GOTO FileLoaded + END IF + LINE INPUT #1, lineContent$ + SendLineToWindow windowNum%, lineNum%, lineContent$ + NEXT lineNum% + +FileLoaded: + CLOSE #1 + + ' Fill the remaining lines with empty strings + FOR blankLineNum% = lineNum% TO 1000 + SendLineToWindow windowNum%, blankLineNum%, "" + NEXT blankLineNum% +END SUB + +SUB RefreshAllWindows + ' Redraw all active windows + + CLS + FOR windowNum% = 1 TO 10 + IF windowActiveStatus(windowNum%) > 0 THEN + ShowWindow windowNum% + END IF + NEXT windowNum% +END SUB + +SUB SendLineToWindow (windowNum%, lineNum%, newString$) + ' Stores a string in a window's memory + + lineContent$ = newString$ + + ' Remove trailing spaces from the string + IF lineContent$ = SPACE$(LEN(lineContent$)) THEN + lineContent$ = "" + END IF + + IF LEN(lineContent$) > 0 THEN +TrimRight: + IF RIGHT$(lineContent$, 1) = " " THEN + lineContent$ = LEFT$(lineContent$, LEN(lineContent$) - 1) + GOTO TrimRight + END IF + END IF + + ' Update the window memory with the new string + IF lineContent$ = "" THEN + IF windowData(windowNum%, lineNum%) > 0 THEN + textStorage$(windowData(windowNum%, lineNum%)) = "": windowData(windowNum%, lineNum%) = 0 + END IF + ELSE + IF windowData(windowNum%, lineNum%) = 0 THEN + windowData(windowNum%, lineNum%) = GetFreeLineIndex% + END IF + textStorage$(windowData(windowNum%, lineNum%)) = lineContent$ + END IF +END SUB + +SUB ShowWindow (windowNum%) + ' Draws a window on the screen + + ' Determine background color based on active window + IF windowNum% = currentActiveWindow% THEN + bgColor% = 1 + ELSE + bgColor% = 0 + END IF + + x% = windowX(windowNum%) + y% = windowY(windowNum%) + widt% = windowWidth(windowNum%) + heigh% = windowHeight(windowNum%) + title$ = windowTitle$(windowNum%) + + COLOR 11, bgColor% + + ' Create border components + FOR borderSegment% = 1 TO widt% - 2 + topBottom$ = topBottom$ + CHR$(205) + NEXT borderSegment% + borderTop$ = CHR$(201) + topBottom$ + CHR$(187) + borderBottom$ = CHR$(200) + topBottom$ + CHR$(188) + + ' Draw top border + LOCATE y%, x% + PRINT borderTop$ + + ' Draw bottom border + LOCATE y% + heigh% - 1, x% + PRINT borderBottom$ + + ' Draw window content + FOR lineNum% = 1 TO heigh% - 2 + LOCATE y% + lineNum%, x% + lineContent$ = GetLineFromWindow$(windowNum%, lineNum% + windowShiftY(windowNum%)) + lineContent$ = lineContent$ + SPACE$(300) + lineContent$ = RIGHT$(lineContent$, LEN(lineContent$) - windowShiftX(windowNum%)) + lineContent$ = LEFT$(lineContent$, widt% - 2) + PRINT CHR$(186) + lineContent$ + CHR$(186) + NEXT lineNum% + + ' Draw window title + titleX% = INT(x% + (widt% / 2) - (LEN(title$) / 2) - 2) + LOCATE y%, titleX% + PRINT "[ " + titleX% = titleX% + 2 + + COLOR 10 + LOCATE y%, titleX% + PRINT title$ + + titleX% = titleX% + LEN(title$) + COLOR 11 + LOCATE y%, titleX% + PRINT " ]" + COLOR 7, 0 +END SUB + +SUB InitializeSystem + ' Initialize the screen and shared memory + + WIDTH 80, 50 + VIEW PRINT 1 TO 50 + + FOR storageIndex% = 1 TO maxStorage% + textStorage$(storageIndex%) = "" + NEXT storageIndex% + + storagePointer% = 1 +END SUB \ No newline at end of file diff --git a/Miscellaneous/windowing system.webm b/Miscellaneous/windowing system.webm new file mode 100644 index 0000000..1a456bb Binary files /dev/null and b/Miscellaneous/windowing system.webm differ diff --git a/Networking/COM port terminal.bas b/Networking/COM port terminal.bas new file mode 100755 index 0000000..f60bb6e --- /dev/null +++ b/Networking/COM port terminal.bas @@ -0,0 +1,35 @@ +' Simple COM port terminal +' made by Svjatoslav Agejenko +' in 2003.12 +' H-Page: svjatoslav.eu +' E-Mail: svjatoslav@svjatoslav.eu + +CLS + +1 + ' Read the status of the COM port + portStatus = INP(&H3FD) + + ' Check if data is available + IF portStatus = 97 THEN + ' Read the data from the COM port + comData = INP(&H3F8) + + ' Print the character and its ASCII value + PRINT CHR$(comData); + PRINT comData; + END IF + + ' Get user input + userInput$ = INKEY$ + + ' If there is any input, print it and send to COM port + IF userInput$ <> "" THEN + PRINT userInput$; + + ' Send the ASCII value of the input character to the COM port + OUT &H3F8, ASC(userInput$) + END IF + +' Repeat the process +GOTO 1 diff --git a/Networking/Digital data over analog audio channel/INPUT.TXT b/Networking/Digital data over analog audio channel/INPUT.TXT new file mode 100644 index 0000000..9d26a9b --- /dev/null +++ b/Networking/Digital data over analog audio channel/INPUT.TXT @@ -0,0 +1 @@ +This is sample encoded message! diff --git a/Networking/Digital data over analog audio channel/OUTPUT.TXT b/Networking/Digital data over analog audio channel/OUTPUT.TXT new file mode 100644 index 0000000..9d26a9b --- /dev/null +++ b/Networking/Digital data over analog audio channel/OUTPUT.TXT @@ -0,0 +1 @@ +This is sample encoded message! diff --git a/Networking/Digital data over analog audio channel/SOUND.XI b/Networking/Digital data over analog audio channel/SOUND.XI new file mode 100644 index 0000000..60a4fcc Binary files /dev/null and b/Networking/Digital data over analog audio channel/SOUND.XI differ diff --git a/Networking/Digital data over analog audio channel/aver.bas b/Networking/Digital data over analog audio channel/aver.bas new file mode 100644 index 0000000..e984ed5 --- /dev/null +++ b/Networking/Digital data over analog audio channel/aver.bas @@ -0,0 +1,73 @@ +' Noise reduction +' made by Svjatoslav Agejenko +' in 2003.12 +' H-Page: svjatoslav.eu +' E-Mail: svjatoslav@svjatoslav.eu + + + +DECLARE SUB start () +DEFINT A-Y +DIM SHARED avb(1 TO 100) +DIM SHARED byte AS STRING * 1 +DIM SHARED po, pod +DIM SHARED file1$, file2$ + +start + +INPUT "average factor:", po +INPUT "divide factor:", pod + +OPEN file2$ FOR BINARY AS #1 +OPEN file1$ FOR BINARY AS #2 + +SCREEN 12 +px = 0 +1 +GET #1, , byte +c = ASC(byte) +IF c > 127 THEN c = c - 255 + +FOR a = 1 TO po - 1 +avb(a) = avb(a + 1) +NEXT a +avb(po) = c + +b = 0 +FOR a = 1 TO po +b = b + avb(a) +NEXT a + +b = b / pod +'LINE (px + 1, 0)-(px + 1, 260), 14 +LINE (px, 0)-(px, 260), 0 +PSET (px, c + 130), 12 +PSET (px, b + 130), 14 +px = px + 1 +IF px > 639 THEN px = 1 +IF b < 0 THEN b = b + 255 +IF b > 255 THEN b = 255 +byte = CHR$(b) +PUT #2, , byte +'c$ = INPUT$(1) +IF EOF(1) = 0 THEN GOTO 1 + +CLOSE #2 +CLOSE #1 + +SUB start + +IF COMMAND$ = "" THEN END +b$ = COMMAND$ +file2$ = b$ +file1$ = "" +FOR a = 1 TO LEN(b$) +c$ = RIGHT$(LEFT$(b$, a), 1) +IF c$ = "." OR c$ = " " THEN GOTO 2 +file1$ = file1$ + c$ +NEXT a +2 +file1$ = file1$ + ".awe" + +END SUB + diff --git a/Networking/Digital data over analog audio channel/index.org b/Networking/Digital data over analog audio channel/index.org new file mode 100755 index 0000000..83bf69b --- /dev/null +++ b/Networking/Digital data over analog audio channel/index.org @@ -0,0 +1,9 @@ +* data in sound + +Utility to encode/decode digital information into wave sound file. +You can later record it on the tape or send it acustically or +for example over telephone line. Decoding utility +is petty noise tolerant. + + +[[file:screenshot.png]] diff --git a/Networking/Digital data over analog audio channel/msg2xi.bas b/Networking/Digital data over analog audio channel/msg2xi.bas new file mode 100644 index 0000000..45c1c9b --- /dev/null +++ b/Networking/Digital data over analog audio channel/msg2xi.bas @@ -0,0 +1,163 @@ +' Utility that encodes arbitrary text message into 8 bit sound file. +' This audio can be now transferred over telephone line or recorded to magnetic tape. +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2001, Initial version +' 2024.09, Improved program readability + +DECLARE SUB StartProgram () +DECLARE SUB AddIWave () +DECLARE SUB AddOWave () +DECLARE SUB ByteToSound (soundByte AS SINGLE) + +DIM SHARED iwaveArray(1 TO 20) +DIM SHARED owaveArray(1 TO 41) +DIM SHARED iwaveData$ +DIM SHARED owaveData$ +DIM SHARED inputFile$ +DIM SHARED outputFile$ +DIM SHARED byte AS STRING * 1 + +StartProgram + +inputFile$ = "input.txt" +outputFile$ = "sound.xi" + +' Open the input and output files for binary access +OPEN inputFile$ FOR BINARY AS #2 +OPEN outputFile$ FOR BINARY AS #1 + +' Add data start header/marker to the audio file +FOR a = 1 TO 50 + AddIWave +NEXT a +AddOWave + +' Read each byte from the input file and convert it to sound +2 +GET #2, , byte +ByteToSound ASC(byte) +IF EOF(2) = 0 THEN GOTO 2 + +' Close the files after processing +CLOSE #2 +CLOSE #1 + +PRINT "Encoding of message into sound completed" + +SUB ByteToSound (soundByte AS SINGLE) +' Convert a byte to 8-bit wave sound data + soundByte = soundByte + 1 + + ' Check if the byte value is greater than 128. + ' If yes, set most significant bit to 1, otherwise 0 + IF soundByte > 128 THEN + soundByte = soundByte - 128 + AddIWave + ELSE + AddOWave + END IF + + ' Check if the byte value is greater than 64 to set next bit + IF soundByte > 64 THEN + soundByte = soundByte - 64 + AddIWave + ELSE + AddOWave + END IF + + IF soundByte > 32 THEN + soundByte = soundByte - 32 + AddIWave + ELSE + AddOWave + END IF + + IF soundByte > 16 THEN + soundByte = soundByte - 16 + AddIWave + ELSE + AddOWave + END IF + + IF soundByte > 8 THEN + soundByte = soundByte - 8 + AddIWave + ELSE + AddOWave + END IF + + IF soundByte > 4 THEN + soundByte = soundByte - 4 + AddIWave + ELSE + AddOWave + END IF + + IF soundByte > 2 THEN + soundByte = soundByte - 2 + AddIWave + ELSE + AddOWave + END IF + + ' Check if the byte value is greater than 1 + IF soundByte > 1 THEN + AddIWave + ELSE + AddOWave + END IF +END SUB + +SUB AddIWave +' Write iwaveData to the output file + PUT #1, , iwaveData$ +END SUB + +SUB AddOWave +' Write owaveData to the output file + PUT #1, , owaveData$ +END SUB + +SUB StartProgram +' Initialize wave data arrays + + pi = 3.141592653999996# + + ' Generate sine wave values to represent 1 + b = 0 + FOR a = pi / 2 TO 2.5 * pi STEP (2 * pi / 20) + b = b + 1 + iwaveArray(b) = SIN(a) * 100 + IF iwaveArray(b) < 0 THEN + iwaveArray(b) = iwaveArray(b) + 255 + END IF + NEXT a + + ' Generate sine wave values to represent 0 + b = 0 + FOR a = pi / 2 TO 2.5 * pi STEP (2 * pi / 40) + b = b + 1 + owaveArray(b) = SIN(a) * 100 + IF owaveArray(b) < 0 THEN + owaveArray(b) = owaveArray(b) + 255 + END IF + NEXT a + +' Convert wave arrays to string data + + ' Convert iwaveArray to string because strings are more computationally efficient to write into output file. + FOR a = 1 TO 20 + iwaveData$ = iwaveData$ + CHR$(iwaveArray(a)) + NEXT a + + ' Convert owaveArray to string + FOR a = 1 TO 40 + owaveData$ = owaveData$ + CHR$(owaveArray(a)) + NEXT a + +END SUB diff --git a/Networking/Digital data over analog audio channel/screenshot.png b/Networking/Digital data over analog audio channel/screenshot.png new file mode 100755 index 0000000..87a3a0a Binary files /dev/null and b/Networking/Digital data over analog audio channel/screenshot.png differ diff --git a/Networking/Digital data over analog audio channel/xi2msg.bas b/Networking/Digital data over analog audio channel/xi2msg.bas new file mode 100644 index 0000000..caa0b24 --- /dev/null +++ b/Networking/Digital data over analog audio channel/xi2msg.bas @@ -0,0 +1,332 @@ +' Utility that decodes text message from 8 bit audio recording. +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2001, Initial version +' 2024 - 2025, Improved program readability +' +' Data is encoded in the audio by using frequency modulation. +' When decoding data, program locates peaks between waveforms. +' Then it calculates distance between peaks. +' Long between peak distance is interpreted as 0 bit, short distance is 1 bit. +' Bits 0 and 1 are then sequentially added into bytes and complete +' message is decoded and shown on the screen. In addition, message is written out to +' the file. +' +' Frequency modulation was chosen over amplitude modulation because +' my tests with cassette tape recorder showed that distortions affect mostly +' signal amplitude, but do not affect signal frequency that much. +' +' Data carrying audio is preceded with special header tone. Program detects header tone +' and uses it to calculate baseline signal frequency that it will use later to decode bits. +' Also header allows to mark precise data starting point. + +DEFINT A-Y +DECLARE SUB bysf (a$, d) +DECLARE SUB messa (a$) +DECLARE SUB pfo (f, t, it) +DECLARE SUB anal () +DECLARE SUB start () +DECLARE SUB iadd () +DECLARE SUB oadd () +DECLARE SUB byt (a) + +DIM SHARED file1$ +DIM SHARED file2$ + +' Contains the actual audio waveform samples +DIM SHARED audioBuffer(-100 TO 10000) +DIM SHARED bus AS STRING * 1000 +DIM SHARED bufi +DIM SHARED bg +DIM SHARED sm +DIM SHARED beg +DIM SHARED wai +DIM SHARED old2 + +' Statistical Analysis Array (contains measured peak distances) +DIM SHARED statisticalArray(1 TO 10) +DIM SHARED statl +DIM SHARED aver +DIM SHARED byte AS STRING * 1 +DIM SHARED avv + +DIM SHARED li +DIM SHARED oc +DIM SHARED px + +start +messa "Searching for beginning..." + +OPEN "output.txt" FOR BINARY AS #1 +OPEN "sound.xi" FOR BINARY AS #2 +SEEK #2, 360 + +2 +GET #2, , bus +FOR a = 1 TO 1000 + b$ = RIGHT$(LEFT$(bus, a), 1) + bufi = bufi + 1 + c = ASC(b$) + IF c > 127 THEN c = c - 255 + audioBuffer(bufi) = c +NEXT a +IF (EOF(2) = 0) AND (bufi < 8000) THEN GOTO 2 +anal +IF EOF(2) = 0 THEN GOTO 2 + +CLOSE #2 +CLOSE #1 + +SYSTEM + +SUB anal + ' Draw a vertical line to represent the buffer data + LINE (1, 170)-(200, 430), 0, BF + + FOR a = 1 TO bufi - (avv - 1) + ' Draw horizontal lines at key points + LINE (100, 170)-(100, 430), 13 + LINE (old2 - a + 100, 170)-(old2 - a + 100, 430), 11 + LINE (0, 300)-(200, 300), 13 + + ' Plot the buffer data points + FOR b = 0 TO 200 + PSET (b, audioBuffer(b + a - 101) + 300), 0 + PSET (b, audioBuffer(b + a - 100) + 300), 14 + NEXT b + + LINE (old2 - a + 100, 170)-(old2 - a + 100, 430), 0 + + ' Calculate the average value of the buffer segment + c = 0 + FOR b = a TO a + (avv - 1) + c = c + audioBuffer(b) + NEXT b + c = c / (avv / 2) + + ' Determine if we are in a high or low state + IF c > oc THEN + IF li = -1 THEN + li = 1 + pfo a + ((avv - 1) / 2 - 1), 1, oc + GOTO 3 + END IF + END IF + + IF c < oc THEN + IF li = 1 THEN + li = -1 + pfo a + ((avv - 1) / 2 - 1), 2, oc + GOTO 3 + END IF + END IF + + 3 + ' Update the current average value + oc = c + NEXT a + + ' Shift the buffer data to the left + FOR a = bufi - (avv - 2) TO bufi + audioBuffer(a - (bufi - (avv - 2)) + 1) = audioBuffer(a) + NEXT a + + ' Update the starting index of the buffer + old2 = old2 - (bufi - (avv - 2)) + 1 + bufi = avv - 1 + +END SUB + +SUB bysf (a$, d) + ' Draw a horizontal line to represent the byte data + LINE (201, 170)-(639, 430), 1, B + + IF d = 10 THEN px = 0: a$ = "": GOTO 5 + + px = px + 1 + IF px > 53 THEN + px = 1 + 5 + DIM tempr(1 TO 32000) + GET (201, 186)-(639, 430), tempr(1) + PUT (201, 170), tempr(1), PSET + LINE (201, 414)-(639, 430), 0, BF + END IF + + ' Print the byte data to the screen + LOCATE 26, 26 + px + PRINT a$ + + ' Convert the byte value to a character and write it to the output file + byte = CHR$(d) + PUT #1, , byte + +END SUB + +SUB byt (a) + + ' Draw a horizontal line to represent the bit data + LINE (410, 0)-(639, 169), 1, B + + statl = statl + 1 + IF statl > 8 THEN + statl = 1 + b = 0 + IF statisticalArray(1) = 1 THEN b = b + 128 + IF statisticalArray(2) = 1 THEN b = b + 64 + IF statisticalArray(3) = 1 THEN b = b + 32 + IF statisticalArray(4) = 1 THEN b = b + 16 + IF statisticalArray(5) = 1 THEN b = b + 8 + IF statisticalArray(6) = 1 THEN b = b + 4 + IF statisticalArray(7) = 1 THEN b = b + 2 + IF statisticalArray(8) = 1 THEN b = b + 1 + + ' Print the byte value to the screen + LOCATE 10, 69 + PRINT b + + ' Print the hexadecimal representation of the byte value + LOCATE 10, 75 + PRINT HEX$(b) + + ' Print the character representation of the byte value + LOCATE 10, 79 + c$ = CHR$(b) + + ' Replace control characters with a space + IF b = 7 OR b = 8 OR b = 10 OR b = 12 OR b = 13 THEN c$ = " " + + PRINT c$ + + bysf c$, b + + DIM tempr(1 TO 10000) + GET (410, 16)-(639, 169), tempr(1) + PUT (410, 0), tempr(1), PSET + LINE (410, 153)-(639, 169), 0, BF + END IF + + ' Print the bit value to the screen + LOCATE 10, 50 + (statl * 2) + + statisticalArray(statl) = a + + PRINT a + +END SUB + +SUB messa (a$) + ' Draw a horizontal line to represent the message data + LINE (0, 0)-(409, 169), 1, B + + DIM tempr(1 TO 20000) + + GET (0, 16)-(409, 169), tempr(1) + + PUT (0, 0), tempr(1), PSET + + LINE (0, 153)-(409, 169), 0, BF + + ' Print the message to the screen + LOCATE 10, 1 + + PRINT a$ + +END SUB + +SUB pfo (f, t, it) + IF t = 2 THEN + bg = it + + IF wai > 0 THEN wai = wai - 1 + + ' Check if we have found data start header + IF (bg - sm > 6) AND (beg = 0) THEN + beg = 1 + wai = 10 + messa "Beginning point found!" + END IF + + ' Perform statistical analysis if needed + IF (wai = 0) AND (beg = 1) THEN + IF statl = 0 THEN messa "Beginning statistical analyze" + + statl = statl + 1 + + IF statl > 10 THEN + FOR a = 1 TO 10 + aver = aver + statisticalArray(a) + NEXT a + + aver = aver * 1.5 / 10 + + beg = 2 + + statl = 1 + + messa "Statistical analyze completed!" + END IF + + ' Store the current frame index + statisticalArray(statl) = f - old2 + END IF + + ' Decode the bits if we are in the decoding state + IF beg = 2 THEN + IF f - old2 >= aver THEN + beg = 3 + + statl = 0 + + FOR a = 1 TO 8 + statisticalArray(a) = 0 + NEXT a + + GOTO 4 + END IF + END IF + + ' Decode the bits based on the current state + IF beg = 3 THEN + IF f - old2 >= aver THEN + byt 0 + ELSE + byt 1 + END IF + END IF + + 4 + + old2 = f + ELSE + sm = it + END IF +END SUB + +SUB start + + ' Set the screen mode to graphics + SCREEN 12 + + ' Initialize buffer index and other variables + bufi = 0 + + beg = 0 + + statl = 0 + + aver = 0 + + px = 0 + + avv = 7 + + li = 1 + + oc = -9999 + +END SUB \ No newline at end of file diff --git a/Networking/LPT communication driver/lptdrv.asm b/Networking/LPT communication driver/lptdrv.asm new file mode 100644 index 0000000..599a545 --- /dev/null +++ b/Networking/LPT communication driver/lptdrv.asm @@ -0,0 +1,281 @@ +; Svjatoslav Agejenko +; 2002.08 +; compile with FASM - Flat Assembler + +; TSR driver for LPT1 communication. +; Functions by INT 63h: + +; Deactivate +; AH = 0 + +; Activate +; AH = 1 + +; Get downloaded data +; AH = 2 +; ES:DI - pointer where to place downloaded data +; on return: +; AX = Number of bytes downloaded + +; copies downloaded data from driver input buffers to +; specified place. + +; Upload data +; AH = 3 +; DS:SI - pointer for data to be uploaded +; CX - amount of bytes to upload + +; After interrupt, data will be immediately +; moved to communication driver own output buffer, +; and sent when line becomes avaiable. + +myint = 63h ; interrupt to hook +upbuf = 5000 ; upload buffer size +downbuf = 5000 ; download buffer size +InPort = 37ah ; input port, for Parallel Printer Port Control Register +defspd = 3 ; Default communication speed +upbufp = last + downbuf + + +org 100h + +;============================ TSR initialization ==================== + +mov dx, InPort ; reset line +mov al, 0 +out dx, al + +mov ax, 0 ; Saves old interrupt vector +mov es, ax +mov eax, [es:32] +mov [d2], eax + +cli +mov ax, cs ; Set new interrupt vector for IRQ 0 +shl eax, 16 +mov ax, custom +mov [es:32], eax +mov ax, int63 ; Set new interrupt vector for INT 63 +mov [es:4 * myint], eax +sti + + +mov ax, last ; Calculate needed memory size, begin TSR +add ax, upbuf + downbuf + 1000 +mov dx, 0 +mov bx, 16 +div bx +mov dx, ax +mov ax, 3100h +int 21h +d2 dd 0 + +;============================ IRQ 0 handler ========================= + +custom: +pushf ; Execute default code in old int vector +call dword [cs:d2] + +;pusha ; Write 1 character, for debugging +;mov ax, 0e01h +;mov bx, 0 +;int 10h +;popa + +inc byte [cs:tmr] ; Update timer + +cmp [cs:progress], 0 ; Check if custom routine is already active +jne EndOfRoutine +cmp [cs:enabled], 0 ; Check if driver is enabled +je EndOfRoutine + +mov [cs:progress], 1 ; Set active flag +pusha +push ds +push es + +mov dx, InPort +in al, dx +shl al, 4 +cmp al, 128 +jb checkdone + +;============================ download data from LPT ================ + +mov ax, cs +mov es, ax +mov ds, ax +mov di, last +add di, [dbufsiz] +mov bh, 0 + +SkipHeader: +in al, dx +shl al, 6 +cmp al, 128 +jae SkipHeader +mov ah, 255 +mov cx, 0 + +SkipBit: +inc cx +cmp cx, 30 +je MkHeader +in al, dx +cmp al, ah +je SkipBit +in al, dx + +mov cx, 0 +mov ah, al +shr al, 3 +or al, 254 +sub al, 254 + +shl bl, 1 +add bl, al +inc bh +cmp bh, 8 +jb SkipBit + +mov al, bl +stosb +mov bh, 0 +mov bl, bh +jmp SkipBit + +MkHeader: +mov ax, di +sub ax, last +sub ax, [dbufsiz] +stosw +mov ax, di +sub ax, last +mov [dbufsiz], ax + +checkdone: +cmp word [cs:ubufsiz], 0 +je alldone + +; =========================== send data to LPT ====================== + +mov ax, cs +mov ds, ax +mov byte [tmr], 0 + +mov dx, InPort +mov al, 255 +out dx, al +mov si, upbufp +mov cx, [ubufsiz] + +sti +SendHeader: +cmp byte [tmr], 2 +jb SendHeader +cli + +SendByte: +cmp cx, 0 +je sent + +mov bl, 0 +lodsb + +SendBit: +push ax +push cx +shr al, 4 +or al, 247 +sub al, 247 +mov bh, bl +or bh, 254 +sub bh, 254 +shl bh, 1 +add al, bh + +mov ch, 0 +mov cl, [spd] +WaitForBit: +out dx, al +loop WaitForBit +pop cx +pop ax +inc bl +shl al, 1 +cmp bl, 8 +jb SendBit + +dec cx +jmp SendByte +sent: + +mov al, 0 +out dx, al +mov word [ubufsiz], 0 + + +alldone: +pop es +pop ds +popa +mov [cs:progress], 0 ; Terminate active flag +EndOfRoutine: +iret + +progress db 0 +enabled db 0 +dbufsiz dw 0 +ubufsiz dw 0 +tmr db 0 +spd db defspd + +;============================ INT 63h handler ======================= + +int63: +cmp ah, 0 +je set_unactive +cmp ah, 1 +je set_active +cmp ah, 2 +je get_data +cmp ah, 3 +je send_data +jmp EndOfRoutine + +set_active: +mov dx, InPort ; reset line +mov al, 0 +out dx, al +mov [cs:enabled], 1 +jmp EndOfRoutine + +set_unactive: +mov [cs:enabled], 0 +jmp EndOfRoutine + +get_data: +push ds +mov ax, cs +mov ds, ax +mov si, last +mov cx, [dbufsiz] +rep movsb +pop ds +mov ax, [cs:dbufsiz] +mov [cs:dbufsiz], 0 +jmp EndOfRoutine + +send_data: +push es +mov dx, cx +mov bx, cs +mov es, bx +mov di, upbufp +add di, [cs:ubufsiz] +rep movsb +add [cs:ubufsiz], dx +pop es +jmp EndOfRoutine + +last: diff --git a/Networking/LPT communication driver/lptdrv.com b/Networking/LPT communication driver/lptdrv.com new file mode 100644 index 0000000..8abfb4e Binary files /dev/null and b/Networking/LPT communication driver/lptdrv.com differ diff --git a/Networking/LPT communication driver/lptdrv.txt b/Networking/LPT communication driver/lptdrv.txt new file mode 100644 index 0000000..d276f46 --- /dev/null +++ b/Networking/LPT communication driver/lptdrv.txt @@ -0,0 +1,23 @@ +LPT communications driver +made by Svjatoslav Agejenko +in 2002.08 +H-Page: svjatoslav.eu +E-Mail: svjatoslav@svjatoslav.eu + +LPTDRV is a memory resident driver for LPT network. +It hooks IRQ 0 and checks ca. 18 times per second LPT status. +If any activity found it reads and decodes recieved data, +and stores it into its 5000 bytes input buffer. It has also +5000 bytes output buffer for sending data. +Applications can communicate with this driver by INT 63h. +see LPTDRV.ASM for more details. + + +Parallel printer port pins 14, 17, 18 +must be connected on both computers directly, eg. one to one. + +pin 14 carries syncronisation signal. 0 1 0 1 0 1 ... +pin 17 is used for data input/output. +pin 18 is ground. + +Maximum transfer speed on my computer was ~ 12 Kb/s. diff --git a/Networking/LPT communication driver/test.ASM b/Networking/LPT communication driver/test.ASM new file mode 100644 index 0000000..e98e680 --- /dev/null +++ b/Networking/LPT communication driver/test.ASM @@ -0,0 +1,100 @@ +; simple driver test + +org 100h + +mov ah, 1 ; activate driver +int 63h + +l1: +mov di, last +mov ah, 2 +int 63h +cmp ax, 0 +je l2 + +cmp byte [last], 0 +jne l3 +call send4kb +jmp l2 +l3: + +add ax, last +mov di, ax +mov byte [ds:di], 36 + +mov ah, 9 +mov dx, d1 +int 21h + + +l2: + +mov ah, 0bh +int 21h +cmp al, 0 +je l1 + + +mov ah, 0 +int 16h +cmp al, 27 +je quit +cmp al, 13 +je send +cmp al, 32 +je TestSpeed + +jmp l1 + +quit: +mov ah, 0 ; deactivate driver +int 63h +ret + +send: +mov cx, d1 - d2 +mov si, d2 +mov ah, 3 +int 63h +jmp l1 + +send4kb: +mov cx, 4096 +mov si, last +mov ah, 3 +int 63h +ret + +TestSpeed: +mov byte [last], 0 +mov cx, 0 + +l5: +push cx +call send4kb +l4: +mov di, last + 1 +mov ah, 2 +int 63h +cmp ax, 0 +je l4 +pop cx + +mov dx, d3 +mov ah, 9 +int 21h + +inc cx +cmp cx, 100 +jb l5 + +mov dx, d4 +mov ah, 9 +int 21h +jmp l1 + +d3 db '. $' +d4 db 13, 10, 'done', 13, 10, '$' +d2 db 'Quick brown fox jumped over the lazy dogs. 0123456789ABCDEF' +d1 db 13,10,'Data recieved:' +last: diff --git a/Networking/LPT communication driver/test.COM b/Networking/LPT communication driver/test.COM new file mode 100644 index 0000000..1a4847f Binary files /dev/null and b/Networking/LPT communication driver/test.COM differ diff --git a/Networking/LPT morse.bas b/Networking/LPT morse.bas new file mode 100755 index 0000000..7527ae6 --- /dev/null +++ b/Networking/LPT morse.bas @@ -0,0 +1,132 @@ +' Svjatoslav Agejenko +' 2003.02, initial version +' 2024, fixing code readability + +' Program to control radio transmitter over LPT port, +' and send data in morse like code. + +DECLARE SUB sbit (a!) +DECLARE SUB msg (a$) +DECLARE SUB sb (a!) +DECLARE SUB quit () +DECLARE SUB tone (c!) +DECLARE SUB wai (a!) +DECLARE SUB echo () +DECLARE SUB lptsend () +DIM SHARED bit(0 TO 7) +DIM SHARED port + +CLS +port = &H378 +echo + +l = 0 +1 +IF timeStr$ <> TIME$ THEN + IF l > 60 THEN + echo + l = 0 + END IF + l = l + 1 + timeStr$ = TIME$ +END IF + +key$ = INKEY$ +IF key$ <> "" THEN quit +GOTO 1 + +SUB echo + +bit(5) = 1 +lptsend +wai 5 + +msg "Hello!" +' msg "Hello, world!" + +wai 1 +bit(5) = 0 +lptsend + +END SUB + +SUB lptsend + +b = 0 +FOR a = 0 TO 7 + b = b * 2 + IF bit(a) > 0 THEN + b = b + 1 + END IF +NEXT a + +OUT port, b + +END SUB + +SUB msg (message$) + +FOR a = 1 TO LEN(message$) + char$ = RIGHT$(LEFT$(message$, a), 1) + sb ASC(char$) + key$ = INKEY$ + IF key$ <> "" THEN quit +NEXT a + +END SUB + +SUB quit +bit(5) = 0 +lptsend +END +END SUB + +SUB sb (asciiVal) +d = asciiVal +c = 128 + +FOR b = 0 TO 7 + IF d >= c THEN + sbit 1 + d = d - c + ELSE + sbit 0 + END IF + c = c / 2 +NEXT b + +END SUB + +SUB sbit (value) +IF value = 1 THEN + tone 0 + tone 0 + tone 1 +ELSE + tone 0 + tone 1 + tone 1 +END IF +END SUB + +SUB tone (cValue) +' cValue = 1 +PRINT cValue; +FOR a = 1 TO 40 + bit(4) = cValue + lptsend + FOR b = 1 TO 500 + NEXT b + bit(4) = 0 + lptsend + FOR b = 1 TO 500 + NEXT b +NEXT a +END SUB + +SUB wai (aValue) +FOR b = 1 TO aValue * 10 + SOUND 0, .1 +NEXT b + +END SUB \ No newline at end of file diff --git a/Networking/LPT pin control.bas b/Networking/LPT pin control.bas new file mode 100755 index 0000000..c7f2cac --- /dev/null +++ b/Networking/LPT pin control.bas @@ -0,0 +1,61 @@ +' Program to control voltage on individual LPT port pins. +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2002, Initial version +' 2024.08, Improved program readability +' +' Use keyboard keys 1 - 8 to toggle on/off individual pins. + +DECLARE SUB display () +DECLARE SUB transmit () +DIM SHARED bit(1 TO 8) +DIM SHARED printerPort + +printerPort = &H378 +FOR a = 1 TO 8 + bit(a) = 0 +NEXT a +SCREEN 13 + +MainLoop: +display +transmit +keyInput$ = INPUT$(1) +IF VAL(keyInput$) > 0 THEN + keyValue = VAL(keyInput$) + IF bit(keyValue) = 0 THEN + bit(keyValue) = 1 + ELSE + bit(keyValue) = 0 + END IF +END IF + +GOTO MainLoop + +SUB display + + ' Display the current status of each pin + LOCATE 3, 1 + PRINT " 1 2 3 4 5 6 7 8" + + FOR a = 1 TO 8 + LINE (a * 16, 1)-(a * 16 + 8, 9), bit(a), BF + NEXT a + +END SUB + +SUB transmit + + ' Calculate the byte to be sent based on the status of each pin + outputByte = 0 + FOR a = 1 TO 8 + outputByte = outputByte * 2 + outputByte = outputByte + bit(a) + NEXT a + + OUT printerPort, outputByte +END SUB diff --git a/Networking/LPT to COM port data transfer.bas b/Networking/LPT to COM port data transfer.bas new file mode 100755 index 0000000..2896a79 --- /dev/null +++ b/Networking/LPT to COM port data transfer.bas @@ -0,0 +1,77 @@ +' This is quite unusual program. It sends data from LPT port (parallel +' printer port) to COM (serial mouse) port. It does it by bit-banging +' the data out of the LPT port. If you connect appropriate wire from +' LPT port output bit (pin #3) to COM port input bit, you can send +' data from LPT to COM. +' +' Note: +' - Ground wire must be connected between LPT and COM ports too. +' - Use this program at your own risk. It may not work on your system or may even damage it. +' +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2002, Initial version +' 2024, Improved program readability + +DEFINT A-Z +DECLARE SUB sendChar (char$) +DIM SHARED port +port = &H378 ' LPT port + +PRINT "Type something. All keyboard strokes will be transmitted." +PRINT "ESC to exit" + +1 +inputChar$ = INPUT$(1) +IF inputChar$ = CHR$(27) THEN SYSTEM +PRINT inputChar$; +sendChar inputChar$ +GOTO 1 + +SUB sendChar (char$) + ' Convert the character into its ASCII value + asciiValue = ASC(char$) + + DIM bitArray(0 TO 8) + bitArray(0) = 0 + bitArray(8) = 0 + + bValue = 64 + cIndex = 7 +2 + ' Convert the ASCII value into a binary representation + IF asciiValue >= bValue THEN + bitArray(cIndex) = 1 + asciiValue = asciiValue - bValue + ELSE + bitArray(cIndex) = 0 + END IF + + ' Divide the value by 2 and move to the next bit + bValue = bValue / 2 + cIndex = cIndex - 1 + + IF cIndex <> 0 GOTO 2 + + ' Send each bit of the character through the LPT port + FOR a = 0 TO 8 + IF bitArray(a) = 0 THEN + bValue = 255 + ELSE + bValue = 0 + END IF + + ' Adjust this loop based on your system and QBasic interpreter speed + FOR c = 0 TO 9 + OUT port, bValue + NEXT c + NEXT a + + ' Reset the LPT port to 0 after sending the character + OUT port, 0 + +END SUB diff --git a/Networking/morse.bas b/Networking/morse.bas new file mode 100755 index 0000000..7d8f3b9 --- /dev/null +++ b/Networking/morse.bas @@ -0,0 +1,89 @@ +' Plays entered text in morse code audio beeps using PC-speaker. +' This program is free software: released under Creative Commons Zero (CC0) license +' by Svjatoslav Agejenko. +' Email: svjatoslav@svjatoslav.eu +' Homepage: http://www.svjatoslav.eu +' +' Changelog: +' 2003, Initial version +' 2024.08, Improved program readability + +DECLARE SUB say() +DECLARE SUB laus(a$) +DECLARE SUB char(a!) +DIM SHARED mors(0 TO 255, 0 TO 9) +DIM SHARED spd +spd = 1 +CLS + +' Open the Morse code file for reading +OPEN "morse.txt" FOR INPUT AS #1 + +' Label to read each line from the file +2 +IF EOF(1) THEN GOTO 1 +LINE INPUT #1, a$ + +' Process each character in the current line +FOR b = 1 TO LEN(a$) + c = ASC(RIGHT$(LEFT$(a$, b), 1)) + IF b = 1 THEN m = c + IF b > 2 THEN + d = 0 + IF c = ASC(".") THEN d = 1 + IF c = ASC("-") THEN d = 2 + mors(m, b - 2) = d + END IF +NEXT b +GOTO 2 + +' Label to close the file +1 +CLOSE + +' Prompt user for input +PRINT "Type '.bye' to quit" + +' Main loop to read and process user input +3 +PRINT "" +INPUT "", a$ +IF a$ = ".bye" THEN SYSTEM +laus a$ +GOTO 3 + +' Subroutine to play Morse code for a single character +SUB char(a) + PRINT CHR$(a); + + ' Loop through each part of the Morse code sequence + FOR b = 0 TO 9 + IF mors(a, b) = 1 THEN + ' Play short beep for a dot + SOUND 1000, 1 * spd + SOUND 0, 1 * spd + END IF + + IF mors(a, b) = 2 THEN + ' Play long beep for a dash + SOUND 1000, 3 * spd + SOUND 0, 1 * spd + END IF + NEXT b + + ' Short pause between Morse code characters + FOR a = 0 TO 160 + SOUND 0, .1 + NEXT a +END SUB + +' Subroutine to process and play Morse code for an entire string +SUB laus(a$) + ' Loop through each character in the input string + FOR b = 1 TO LEN(a$) + c = ASC(RIGHT$(LEFT$(a$, b), 1)) + + ' Call char subroutine to play Morse code for the current character + char c + NEXT b +END SUB \ No newline at end of file diff --git a/Networking/morse.txt b/Networking/morse.txt new file mode 100644 index 0000000..d695202 --- /dev/null +++ b/Networking/morse.txt @@ -0,0 +1,36 @@ +a .- +b -... +c -.-. +d -.. +e . +f ..-. +g --. +h .... +i .. +j .--- +k -.- +l .-.. +m -- +n -. +o --- +p .--. +q --.- +r .-. +s ... +t - +u ..- +v ...- +w .-- +x -..- +y -.-- +z --.. +0 ----- +1 .---- +2 ..--- +3 ...-- +4 ....- +5 ..... +6 -.... +7 --... +8 ---.. +9 ----. \ No newline at end of file diff --git a/Tools/Commit and push b/Tools/Commit and push new file mode 100755 index 0000000..057b511 --- /dev/null +++ b/Tools/Commit and push @@ -0,0 +1,11 @@ +#!/bin/bash +cd "${0%/*}"; if [ "$1" != "T" ]; then gnome-terminal -e "'$0' T"; exit; fi; + +cd .. + +cola +git push + +echo "" +echo "Press ENTER to close this window." +read diff --git a/Tools/Open with IntelliJ IDEA b/Tools/Open with IntelliJ IDEA new file mode 100755 index 0000000..304bf94 --- /dev/null +++ b/Tools/Open with IntelliJ IDEA @@ -0,0 +1,54 @@ +#!/bin/bash + +# This script launches IntelliJ IDEA with the current project +# directory. The script is designed to be run by double-clicking it in +# the GNOME Nautilus file manager. + +# First, we change the current working directory to the directory of +# the script. + +# "${0%/*}" gives us the path of the script itself, without the +# script's filename. + +# This command basically tells the system "change the current +# directory to the directory containing this script". + +cd "${0%/*}" + +# Then, we move up one directory level. +# The ".." tells the system to go to the parent directory of the current directory. +# This is done because we assume that the project directory is one level up from the script. +cd .. + +# Now, we use the 'setsid' command to start a new session and run +# IntelliJ IDEA in the background. 'setsid' is a UNIX command that +# runs a program in a new session. + +# The command 'idea .' opens IntelliJ IDEA with the current directory +# as the project directory. The '&' at the end is a UNIX command that +# runs the process in the background. The '> /dev/null' part tells +# the system to redirect all output (both stdout and stderr, denoted +# by '&') that would normally go to the terminal to go to /dev/null +# instead, which is a special file that discards all data written to +# it. + +setsid idea . &>/dev/null & + +# The 'disown' command is a shell built-in that removes a shell job +# from the shell's active list. Therefore, the shell will not send a +# SIGHUP to this particular job when the shell session is terminated. + +# '-h' option specifies that if the shell receives a SIGHUP, it also +# doesn't send a SIGHUP to the job. + +# '$!' is a shell special parameter that expands to the process ID of +# the most recent background job. +disown -h $! + + +sleep 2 + +# Finally, we use the 'exit' command to terminate the shell script. +# This command tells the system to close the terminal window after +# IntelliJ IDEA has been opened. +exit diff --git a/Tools/Update web site b/Tools/Update web site new file mode 100755 index 0000000..13994de --- /dev/null +++ b/Tools/Update web site @@ -0,0 +1,55 @@ +#!/bin/bash +cd "${0%/*}"; if [ "$1" != "T" ]; then gnome-terminal -e "'$0' T"; exit; fi; +cd .. + +# Function to export org to html using emacs in batch mode +export_org_to_html() { + local dir=$1 + if [ -d "$dir" ]; then + ( + cd "$dir" || return 1 + if [ -f "index.html" ]; then + rm -f index.html + fi + if [ -f "index.org" ]; then + emacs --batch -l ~/.emacs --visit=index.org --funcall=org-html-export-to-html --kill + else + echo "Warning: index.org not found in $dir" + fi + ) + else + echo "Warning: Directory $dir not found, skipping..." + fi +} + + +# Export org to html for the main index +export_org_to_html "." + +# 2D graphics +export_org_to_html "2D GFX/Animations" +export_org_to_html "2D GFX/Fractals" +export_org_to_html "2D GFX/Spirals" +export_org_to_html "2D GFX/Textures" + +export_org_to_html "3D GFX/3D Synthezier/doc" +export_org_to_html "3D GFX/Miscellaneous" +export_org_to_html "3D GFX/Space" + +# Upload project homepage to the server. +rsync -avz --delete -e 'ssh -p 10006' ./ \ + --include="*/" \ + --include="*.html" \ + --include="*.png" \ + --include="*.bas" \ + --include="*.dat" \ + --include="*.webm" \ + --include="*.jpeg" \ + --include="*.blend" \ + --exclude="*" \ + n0@www3.svjatoslav.eu:/mnt/big/projects/qbasicapps/ + + +echo "" +echo "Press ENTER to close this window." +read diff --git a/Tutorial/Group 1/00.bas b/Tutorial/Group 1/00.bas new file mode 100755 index 0000000..fc62f12 --- /dev/null +++ b/Tutorial/Group 1/00.bas @@ -0,0 +1,10 @@ +' This program demonstrates a basic "Hello World" example in QuickBasic. +' It is designed to be simple and easy to understand for novice programmers. + +' The following line prints a greeting message to the console. +PRINT "Hello world!" + +' When you run this program, it will output the string "Hello world!" to the screen. +' This is a traditional first step in learning any new programming language. + +' To execute this program, press F5 while in the QuickBasic editor environment. diff --git a/Tutorial/Group 1/01.bas b/Tutorial/Group 1/01.bas new file mode 100755 index 0000000..0760259 --- /dev/null +++ b/Tutorial/Group 1/01.bas @@ -0,0 +1,24 @@ +' This QuickBasic program demonstrates basic arithmetic operations +' and the use of variables. It will perform a series of calculations +' on a single variable and print the results after each operation. + +CLS ' Clears the screen to provide a clean output area + +' Initialize a variable with the value 3 +DIM initialValue AS INTEGER +initialValue = 3 + +' Print the current value of initialValue +PRINT "The initial value is: "; initialValue + +' Perform multiplication and assign the result back to initialValue +initialValue = initialValue * 2 + +' Print the new value after multiplication +PRINT "After doubling, the value is: "; initialValue + +' Perform subtraction and decrease initialValue by 1 +initialValue = initialValue - 1 + +' Print the final value after subtraction +PRINT "After decrementing by 1, the value is: "; initialValue diff --git a/Tutorial/Group 1/02.bas b/Tutorial/Group 1/02.bas new file mode 100755 index 0000000..ccf5019 --- /dev/null +++ b/Tutorial/Group 1/02.bas @@ -0,0 +1,21 @@ +' This program demonstrates basic arithmetic operations in QuickBasic + +CLS ' Clears the screen to provide a clean output area + +' Declare a variable 'a' and assign it the value of 7 +DIM a AS INTEGER +a = 7 + +' Print the current value of 'a' to the console +PRINT "The value contained in variable 'a' is: "; a + +' Perform a series of arithmetic operations on the value of 'a' +' and print the result +PRINT "Performing some calculations with 'a':"; +PRINT (a + 2.1234) / 3 * 4 - 6 + +' Explanation of the calculation: +' 1. Add 2.1234 to 'a' +' 2. Divide the result by 3 +' 3. Multiply the new result by 4 +' 4. Subtract 6 from the final result diff --git a/Tutorial/Group 1/03.bas b/Tutorial/Group 1/03.bas new file mode 100755 index 0000000..6f6cebe --- /dev/null +++ b/Tutorial/Group 1/03.bas @@ -0,0 +1,34 @@ +' This program demonstrates how to use semicolon and comma as separators +' in PRINT statements within Microsoft QuickBasic. + +CLS ' Clears the screen before starting the program + +' Semicolon Separator Example + +' The semicolon is used to print multiple items on the same line, without +' advancing to a new line after each item. It is useful for formatting output +' in a single line of text. + +PRINT "Semicolon separator:" +PRINT 12; 314; 122; 1; 43 ' Prints numbers separated by semicolons on the same line +PRINT 312; 4; 1; 3111; 3 ' Continues printing more numbers on the next line +PRINT 3; 2344; 12231; 1; 12333 ' Final set of numbers printed on the last line + +' Print an empty line for better readability +PRINT ' This statement prints an empty line to separate different sections + +' Comma Separator Example + +' The comma is used as a separator in PRINT statements to print multiple items, +' each followed by a space and advancing to the next tab column (default is 14 +' characters apart). If there are more items than columns, it will start +' a new line. + +PRINT "Comma separator:" +PRINT 12, 314, 122, 1, 43 ' Prints numbers separated by commas, with spacing +PRINT 312, 4, 1, 3111, 3 ' Numbers are printed in tabular form +PRINT 3, 2344, 12231, 1, 12333 ' Continues the tabular output + +' End of program +END ' This statement marks the end of the QuickBasic program + diff --git a/Tutorial/Group 1/04.bas b/Tutorial/Group 1/04.bas new file mode 100755 index 0000000..dd1a43d --- /dev/null +++ b/Tutorial/Group 1/04.bas @@ -0,0 +1,17 @@ +' This program prompts the user to enter a number and then prints that number back to the screen. +' It demonstrates basic input/output operations in QuickBasic. + +DEFINT A-Z ' Declare all variables as integers for simplicity + +' Declare a variable to store the user's input +DIM num AS INTEGER + +' Use the INPUT statement to prompt the user and read their input +PRINT "Please enter a number:"; +INPUT num + +' Print a message to the screen along with the entered number +PRINT "You entered: "; num + +' End of program +END diff --git a/Tutorial/Group 1/05.bas b/Tutorial/Group 1/05.bas new file mode 100755 index 0000000..5d56b0c --- /dev/null +++ b/Tutorial/Group 1/05.bas @@ -0,0 +1,26 @@ +REM **** Guess a Number Game **** + +DEFINT A-Z ' Define all variables as integers for performance and clarity + +' Main game loop +DO + ' Prompt the user to enter a number + INPUT "Enter a number between 1 and 10: "; guess + + ' Check if the user guessed the correct number + IF guess = 5 THEN + ' If the guess is correct, congratulate the user and exit the loop + PRINT "Correct!!! You've guessed the secret number." + EXIT DO + ELSEIF guess < 5 THEN + ' If the guess is too low, prompt the user to try a higher number + PRINT "Try a bigger number." + ELSEIF guess > 5 THEN + ' If the guess is too high, prompt the user to try a lower number + PRINT "Try a smaller number." + END IF +LOOP + +' End of the program +PRINT "Thank you for playing! Goodbye." +END diff --git a/Tutorial/Group 1/06.bas b/Tutorial/Group 1/06.bas new file mode 100755 index 0000000..4237cf8 --- /dev/null +++ b/Tutorial/Group 1/06.bas @@ -0,0 +1,22 @@ +CLS ' Clear the screen + +' This program demonstrates a simple counting loop in QuickBasic. +' It will print the current value of 'a' and increment it by 1 each time. +' The loop continues until 'a' is no longer less than 10. + +DIM a AS INTEGER ' Declare variable 'a' as an integer + +' Initialize the counter variable 'a' to start at 1 +a = 1 + +' Start of the counting loop +DO WHILE a < 10 + ' Print the current value of 'a' with a label + PRINT "current:"; a + + ' Increment 'a' by 1 + a = a + 1 +LOOP + +' The program will end after the loop finishes +END diff --git a/Tutorial/Group 1/07.bas b/Tutorial/Group 1/07.bas new file mode 100755 index 0000000..9bb214b --- /dev/null +++ b/Tutorial/Group 1/07.bas @@ -0,0 +1,12 @@ +' This program demonstrates a simple FOR loop in Microsoft QuickBasic + +CLS ' Clears the screen, preparing it for output + +' We are about to use a FOR loop to print numbers from 1 to 10 +FOR i = 1 TO 10 ' Initialize a counter variable 'i' starting at 1 + ' For each iteration of the loop, print the current value of 'i' + PRINT "current: "; i ' Outputs the message with the current number +NEXT i ' Increment 'i' by 1 and repeat the loop until 'i' is no longer less than or equal to 10 + +' The program has now finished executing and will end +END ' This marks the end of the QuickBasic program diff --git a/Tutorial/Group 1/08.bas b/Tutorial/Group 1/08.bas new file mode 100755 index 0000000..8df64b6 --- /dev/null +++ b/Tutorial/Group 1/08.bas @@ -0,0 +1,23 @@ +' This program demonstrates how to use a FOR loop and the SOUND statement +' in QuickBasic. It plays a series of tones at increasing frequencies +' from 100 Hz to 1000 Hz, in steps of 50 Hz, with each tone lasting for +' one duration unit as defined by the SOUND statement. + +CLS ' Clears the screen before starting the program + +' Initialize the frequency variable to the starting value +LET frequency = 100 + +' Loop from the initial frequency (100 Hz) to the maximum frequency (1000 Hz), +' increasing by 50 Hz on each iteration +FOR frequency = 100 TO 1000 STEP 50 + ' Print the current frequency value to the console + PRINT "Current Frequency:"; frequency; " Hz" + + ' Play a sound at the specified frequency and duration + ' The SOUND statement takes two arguments: frequency and duration + SOUND frequency, 1 ' The duration is set to 1 (shortest possible sound) +NEXT frequency + +' End of program execution +END diff --git a/Tutorial/Group 1/09.bas b/Tutorial/Group 1/09.bas new file mode 100755 index 0000000..1b96f04 --- /dev/null +++ b/Tutorial/Group 1/09.bas @@ -0,0 +1,22 @@ +REM This program demonstrates how to generate random numbers +REM and use them to create sound effects in QuickBasic. + +CLS ' Clear the screen before starting the program + +' Define constants for the range of random numbers +FOR i = 1 TO 20 ' Loop 20 times to generate and play 20 random sounds + ' Generate a random floating-point number between LOWER_BOUND and UPPER_BOUND + n = RND * 1000 + ' Print the generated random number to the screen + PRINT "Random number: "; n + + ' Play a sound with a frequency based on the random number + ' The QuickBasic SOUND statement takes two arguments: frequency and duration + ' We add 40 to the random number to shift the frequency range + ' so that it is more audible + SOUND n + 40, 1 ' Play the sound for a short duration (1/89th of a second) + +NEXT i + +END ' End the program + diff --git a/Tutorial/Group 1/10.bas b/Tutorial/Group 1/10.bas new file mode 100755 index 0000000..ab4120b --- /dev/null +++ b/Tutorial/Group 1/10.bas @@ -0,0 +1,25 @@ +' This example program demonstrates how to use the WIDTH and COLOR +' statements in QuickBasic to change the text font size and text colors. + +' Set the text window to a smaller font size suitable for displaying +' 50 lines of text within an 80-column width. +WIDTH 80, 50 + +' Define constants for the number of colors available in standard +' QuickBasic color palette. +CONST NumColors = 32 + +' Loop through all possible colors (0 to 31) and display a message +' with each color to illustrate the different text color options. +FOR colorIndex = 0 TO NumColors - 1 + ' Set the current text color using the COLOR statement. + ' Colors range from 0 to 15 are solid, while colors 16 to 31 + ' will blink slowly or quickly depending on the terminal. + COLOR colorIndex + + ' Print a message indicating which color number is currently being used. + ' Note that color numbers 16 and above will produce blinking text. + PRINT "This is text color number "; colorIndex; "." + +NEXT colorIndex + diff --git a/Tutorial/Group 1/11.bas b/Tutorial/Group 1/11.bas new file mode 100755 index 0000000..e6f69e6 --- /dev/null +++ b/Tutorial/Group 1/11.bas @@ -0,0 +1,27 @@ +' This program demonstrates how to use the COLOR statement and LOCATE function +' in Microsoft QuickBasic to change the text color and cursor position +' on the console screen. + +CLS ' Clears the screen before starting + +' Set the text color to yellow (color code 14) and position the cursor +' at row 1, column 50. Then print a message at that location. +COLOR 14 +LOCATE 1, 50 ' Sets the cursor location to +PRINT "Yellow text at 1, 50" + +' Change the text color to pink (color code 12) and move the cursor +' to row 6, column 5. Print a message with the new color and position. +COLOR 12 +LOCATE 6, 5 ' Sets the cursor location to +PRINT "Pink text at 6, 5" + +' Update the text color to green (color code 10) and set the cursor +' to row 20, column 40. Display a message at this new location. +COLOR 10 +LOCATE 20, 40 ' Sets the cursor location to +PRINT "Green text at 20, 40" + +' The program finishes execution here. Users can add more statements +' below this line to experiment with different colors and positions. +END ' End of the program diff --git a/Tutorial/Group 1/12.bas b/Tutorial/Group 1/12.bas new file mode 100755 index 0000000..3aa9c36 --- /dev/null +++ b/Tutorial/Group 1/12.bas @@ -0,0 +1,24 @@ +' This program demonstrates the use of FOR loops, color manipulation, +' and string output in QuickBasic. It also shows how to prevent the +' cursor from moving to a new line after printing a string. + +CLS ' Clears the screen before starting the program + +' The first loop demonstrates changing text colors using the COLOR statement +' inside a FOR loop, which iterates from 1 to 15 (the number of available +' color attributes in QuickBasic). +FOR ColorIndex = 1 TO 15 + COLOR ColorIndex ' Set the current text color to the loop index + PRINT "This is a test" ' Print the string with the new color +NEXT ColorIndex + +PRINT ' Print a blank line for better readability + +' The second loop does the same as the first one, but it uses a semicolon +' at the end of the PRINT statement to prevent the cursor from moving +' to the start of a new line after each string output. This results in +' all strings being printed on the same line. +FOR ColorIndex = 1 TO 15 + COLOR ColorIndex ' Change the text color for each iteration + PRINT "This is a test"; ' Print the string and keep the cursor on the same line +NEXT ColorIndex diff --git a/Tutorial/Group 1/13.bas b/Tutorial/Group 1/13.bas new file mode 100755 index 0000000..c778556 --- /dev/null +++ b/Tutorial/Group 1/13.bas @@ -0,0 +1,19 @@ +' This example QuickBasic program demonstrates the difference between +' normal division and integer division with rounding. + +CLS ' Clears the screen to provide a clean output area + +' Perform normal division which results in a floating-point number +' and print the result +PRINT "Normal division (70 / 4):"; 70 / 4 + +' Explain the use of backslash (\) for integer division with rounding +' Perform integer division with rounding and print the result +PRINT "Integer division with rounding (70 \ 4):"; 70 \ 4 + +' Provide a brief conclusion to summarize what was demonstrated +PRINT +PRINT "In QuickBasic, '/' performs normal division, while '\' does integer division" +PRINT "and rounds the result to the nearest whole number." + +END ' End of program diff --git a/Tutorial/Group 1/15.bas b/Tutorial/Group 1/15.bas new file mode 100755 index 0000000..242c221 --- /dev/null +++ b/Tutorial/Group 1/15.bas @@ -0,0 +1,18 @@ +' This program demonstrates the use of nested FOR loops in QuickBasic +' to draw a simple pattern on the screen. + +CLS ' Clears the screen and prepares for output + +' Outer loop will run 15 times, representing rows +FOR row = 1 TO 15 + + ' Inner loop will run 60 times, representing columns within each row + FOR column = 1 TO 60 + PRINT "#"; ' Print a '#' character followed by no space to create a continuous line + NEXT column + + ' After completing one row, print a newline character to move to the next line + PRINT + +NEXT row + diff --git a/Tutorial/Group 1/16.bas b/Tutorial/Group 1/16.bas new file mode 100755 index 0000000..71f1eaf --- /dev/null +++ b/Tutorial/Group 1/16.bas @@ -0,0 +1,34 @@ +' QuickBasic example program to demonstrate the use of nested loops +' and how to control the flow of a loop using the STEP keyword. + +CLS ' Clears the screen before starting the program + +' This outer loop will iterate from 1 to 10 +FOR b = 1 TO 10 + ' The inner loop will print "A" b times, where b is the current + ' value of the outer loop iterator + FOR a = 1 TO b + PRINT "A"; ' Print "A" followed by a semicolon to prevent newline + NEXT a + + ' After each inner loop iteration, print a newline to start the next line + PRINT +NEXT b + +' Print a blank line to separate the two parts of the demonstration +PRINT + +' This outer loop will iterate from 60 to 0, decrementing by 8 each time +FOR b = 60 TO 0 STEP -8 + ' The inner loop will print "B" b times, where b is the current + ' value of the outer loop iterator + FOR a = 1 TO b + PRINT "B"; ' Print "B" followed by a semicolon to prevent newline + NEXT a + + ' After each inner loop iteration, print a newline to start the next line + PRINT +NEXT b + +' End of the program +END diff --git a/Tutorial/Group 1/17.bas b/Tutorial/Group 1/17.bas new file mode 100755 index 0000000..b5e5f35 --- /dev/null +++ b/Tutorial/Group 1/17.bas @@ -0,0 +1,31 @@ +' This example QuickBasic program demonstrates how to use the built-in +' timer, as well as how to display the current system time and date. +' It also shows a simple loop structure and the use of the CLS statement +' to clear the screen. + +' To stop the program, press CTRL + PAUSE/BREAK. + +DO + ' Clear the screen to provide a clean display for each iteration. + CLS + + ' Retrieve and print the current value of the system timer. + ' The TIMER function returns the number of seconds that have + ' elapsed since midnight, not counting leap seconds. + PRINT "System Timer: "; TIMER; " seconds since midnight." + + ' Retrieve and print the current system time using TIME$. + ' TIME$ returns a string in the format "HH:MM:SS". + PRINT "Current System Time: "; TIME$; "." + + ' Retrieve and print the current system date using DATE$. + ' DATE$ returns a string in the format "M/D/YYYY" or "DD/MM/YYYY" + ' depending on regional settings. + PRINT "Current System Date: "; DATE$; "." + + ' Pause for a moment to allow the user to see the output before + ' it is cleared again in the next iteration of the loop. + ' The Sleep statement requires including the QB.BI library. + SLEEP 1 + +LOOP diff --git a/Tutorial/Group 1/18.bas b/Tutorial/Group 1/18.bas new file mode 100755 index 0000000..0aec40a --- /dev/null +++ b/Tutorial/Group 1/18.bas @@ -0,0 +1,31 @@ +' This example program demonstrates the use of the RND function +' to generate random numbers in Microsoft QuickBasic. + +' Clear the screen before starting the program +CLS + +' The first loop will print ten random numbers. However, these +' numbers may not seem truly random because the random number +' generator needs to be seeded with a varying value. + +PRINT "First group of 'random' numbers without seeding:" +FOR b = 1 TO 10 + PRINT RND +NEXT b + +' Print an empty line for better readability between the two groups +PRINT + +' Seed the random number generator using the TIMER function, which +' returns the number of seconds since midnight. This ensures that +' subsequent calls to RND will yield different sequences of numbers +' each time the program is run after being restarted. +RANDOMIZE TIMER +PRINT "Second group of truly random numbers with seeding:" + +' Now, print another ten random numbers after seeding the generator +FOR b = 1 TO 10 + PRINT RND +NEXT b + +' End of program diff --git a/Tutorial/Group 1/19.bas b/Tutorial/Group 1/19.bas new file mode 100755 index 0000000..536364b --- /dev/null +++ b/Tutorial/Group 1/19.bas @@ -0,0 +1,31 @@ +' This program demonstrates how to use the QuickBasic functions RND (random number generator), +' COLOR (sets text and background color), LOCATE (positions the cursor on the screen), PRINT (displays text), +' SOUND (generates a tone through the PC speaker) + +CLS ' Clears the screen before starting the program + +' Generate random coordinates (x, y) for text placement on the screen +' and a random color (c) for the text. +' The screen has 80 columns (0-79) and 25 lines (0-24), but we start counting from 1. + + +' INKEY$ returns a string containing any keystroke; if no key is pressed, it returns an empty string +DO WHILE INKEY$ = "" + x = INT(RND * 80) + 1 ' Random column, ensuring it is within the screen width + y = INT(RND * 25) + 1 ' Random line, ensuring it is within the screen height + c = INT(RND * 16) ' Random color index (0-15), where 0 is black and 15 is white + + ' Set the text color to the randomly chosen color + COLOR c + + ' Position the cursor at the random coordinates + LOCATE y, x + + ' Print an "x" character at the current cursor position + PRINT "x"; ' The semicolon prevents advancing to the next line + + ' Generate a sound with a frequency based on the x coordinate and a duration of 0.1 seconds + SOUND x * 100 + 100, 1 + +LOOP + diff --git a/Tutorial/Group 2/01.bas b/Tutorial/Group 2/01.bas new file mode 100755 index 0000000..d3f31ae --- /dev/null +++ b/Tutorial/Group 2/01.bas @@ -0,0 +1,38 @@ +CLS + +' This program demonstrates how to use the SOUND statement in QuickBasic +' to play tones with varying frequency and duration. + +' Play a sequence of tones with increasing frequency +' Each tone has a fixed duration of 2 time units +PRINT "Playing tones with increasing frequency:" +SOUND 1000, 2 ' Play a tone at 1000 Hz for 2 time units +SOUND 2000, 2 ' Play a tone at 2000 Hz for 2 time units +SOUND 3000, 2 ' Play a tone at 3000 Hz for 2 time units + +' Wait for 10 time units to create a pause +PRINT "Pausing for 10 time units..." +SOUND 0, 10 ' Pause for 10 time units (silence) + +' Play a sequence of tones with a fixed frequency +' Each tone has an increasing duration +PRINT "Playing tones with fixed frequency and increasing length:" +SOUND 1000, 1 ' Play a tone at 1000 Hz for 1 time unit +SOUND 0, 10 ' Pause for 10 time units (silence) + +SOUND 1000, 2 ' Play a tone at 1000 Hz for 2 time units +SOUND 0, 10 ' Pause for 10 time units (silence) + +SOUND 1000, 4 ' Play a tone at 1000 Hz for 4 time units +SOUND 0, 10 ' Pause for 10 time units (silence) + +SOUND 1000, 8 ' Play a tone at 1000 Hz for 8 time units +SOUND 0, 10 ' Pause for 10 time units (silence) + +' Notes: +' - The SOUND statement takes two arguments: frequency and duration. +' - Frequency is specified in Hertz (Hz), and duration is specified in time units. +' - A frequency of 0 results in silence, which can be used to create pauses. +' - Time units are not precisely defined by QuickBasic and may vary depending +' on the hardware and system configuration. They provide a relative measure +' for timing musical tones. diff --git a/Tutorial/Group 2/02.bas b/Tutorial/Group 2/02.bas new file mode 100755 index 0000000..4495c79 --- /dev/null +++ b/Tutorial/Group 2/02.bas @@ -0,0 +1,26 @@ +' Simple Sound Sweep Program + +' Start label for infinite loop +beginLoop: + +' Increase speed on each pass - this controls how quickly frequencies change +speed = speed + 1 + +' Show current speed multiplier to user +PRINT speed; "x" + +' Forward frequency sweep from 100Hz to 1000Hz +FOR currentFrequency = 100 TO 1000 STEP speed + ' Create sound with current frequency for 0.1 seconds + ' SOUND format: SOUND frequency, duration + SOUND currentFrequency, .1 +NEXT currentFrequency + +' Reverse frequency sweep from 1000Hz to 100Hz +FOR currentFrequency = 1000 TO 100 STEP -speed + ' Create sound with current frequency for 0.1 seconds + SOUND currentFrequency, .1 +NEXT currentFrequency + +' Jump back to beginning for continuous effect +GOTO beginLoop diff --git a/Tutorial/Group 2/03.bas b/Tutorial/Group 2/03.bas new file mode 100755 index 0000000..c2bba1e --- /dev/null +++ b/Tutorial/Group 2/03.bas @@ -0,0 +1,16 @@ +' This program demonstrates basic user input and string manipulation in QuickBasic. +' It greets the user by name and asks how they are doing, using colors to enhance the output. + +CLS ' Clears the screen to provide a clean start for the program. + +' Prompt the user for their name and store it in a variable called userName$. +INPUT "Hi, what is your name: ", userName$ + +' Set the text color to a bright green (color code 10) for a pleasant visual effect. +COLOR 10 + +' Greet the user by printing "Hello" followed by their name and an exclamation mark. +PRINT "Hello " + userName$ + "!" + +' Ask the user how they are doing by appending their name to the question. +PRINT userName$ + ", how are you?" diff --git a/Tutorial/Group 2/04.bas b/Tutorial/Group 2/04.bas new file mode 100755 index 0000000..2ef6a57 --- /dev/null +++ b/Tutorial/Group 2/04.bas @@ -0,0 +1,13 @@ +CLS + +' Initialize the string variable with "-two-" +stringValue$ = "-two-" +PRINT stringValue$ + +' Append "three" to the existing string +stringValue$ = stringValue$ + "three" +PRINT stringValue$ + +' Prepend "one" to the string to form a complete sequence +stringValue$ = "one" + stringValue$ +PRINT stringValue$ diff --git a/Tutorial/Group 2/05.bas b/Tutorial/Group 2/05.bas new file mode 100755 index 0000000..031f8d4 --- /dev/null +++ b/Tutorial/Group 2/05.bas @@ -0,0 +1,52 @@ +CLS + +' This program creates a simple text-based box in the console window. +' The user specifies the horizontal and vertical size of the box within +' certain constraints to ensure it fits on the screen. + +' Prompt the user for the horizontal size of the box (between 2 and 79) +INPUT "Enter the Horizontal Size of the Box (2 to 79): ", hs + +' Validate the horizontal size input +WHILE hs < 2 OR hs > 79 + PRINT "Invalid input. Please enter a number between 2 and 79." + INPUT "Enter the Horizontal Size of the Box (2 to 79): ", hs +WEND + +' Prompt the user for the vertical size of the box (between 2 and 23) +INPUT "Enter the Vertical Size of the Box (2 to 23): ", vs + +' Validate the vertical size input +WHILE vs < 2 OR vs > 23 + PRINT "Invalid input. Please enter a number between 2 and 23." + INPUT "Enter the Vertical Size of the Box (2 to 23): ", vs +WEND + +' Draw the top line of the box +FOR i = 1 TO hs + PRINT "#"; +NEXT i +PRINT + +' Draw the middle section of the box +FOR y = 1 TO vs - 2 + ' Print the left side of the box + PRINT "#"; + + ' Print the interior of the box + FOR i = 1 TO hs - 2 + PRINT "."; + NEXT i + + ' Print the right side of the box + PRINT "#" +NEXT y + +' Draw the bottom line of the box +FOR i = 1 TO hs + PRINT "#"; +NEXT i +PRINT + +' The program has finished drawing the box and now ends +END diff --git a/Tutorial/Group 2/06.bas b/Tutorial/Group 2/06.bas new file mode 100755 index 0000000..d7f192d --- /dev/null +++ b/Tutorial/Group 2/06.bas @@ -0,0 +1,5 @@ +' several commans may be at the single line, when separated by colon. + +1 a = a + 1: PRINT a; "x 7 ="; a * 7: IF a < 10 THEN GOTO 1 + + diff --git a/Tutorial/Group 2/07.bas b/Tutorial/Group 2/07.bas new file mode 100755 index 0000000..afe3d37 --- /dev/null +++ b/Tutorial/Group 2/07.bas @@ -0,0 +1,36 @@ +REM This program demonstrates basic input/output and conditional logic in QuickBasic. +REM It prompts the user to enter a number and then evaluates that number +REM with respect to the value 5 using various comparison operators. + +PRINT "Please enter a number:" +INPUT n + +REM Check if the number is less than 5 +IF n < 5 THEN + PRINT "The number you entered is smaller than 5." +END IF + +REM Check if the number is greater than 5 +IF n > 5 THEN + PRINT "The number you entered is greater than 5." +END IF + +REM Check if the number is exactly equal to 5 +IF n = 5 THEN + PRINT "The number you entered is equal to 5." +END IF + +REM Check if the number is less than or equal to 5 +IF n <= 5 THEN + PRINT "The number you entered is 5, or less." +END IF + +REM Check if the number is greater than or equal to 5 +IF n >= 5 THEN + PRINT "The number you entered is 5, or greater." +END IF + +REM Check if the number is not equal to 5 +IF n <> 5 THEN + PRINT "The number you entered is not 5." +END IF diff --git a/Tutorial/Group 2/08.bas b/Tutorial/Group 2/08.bas new file mode 100755 index 0000000..930bea8 --- /dev/null +++ b/Tutorial/Group 2/08.bas @@ -0,0 +1,80 @@ +CLS + +' This program simulates a login prompt for a nuclear rocket control system. +' It asks the user to enter a password and checks if the entered password is correct. +' If the password is incorrect, it prompts the user again. + +' Define a constant for the correct password for better security practices +CONST CorrectPassword = "jerry" + +' Function to display the welcome message +SUB DisplayWelcomeMessage + LOCATE 1, 1 + COLOR 14 + PRINT " ========================================" + PRINT " Welcome to nuclear rocket control system" + PRINT " ========================================" +END SUB + +' Function to display the rocket artwork +SUB DisplayRocketArt + COLOR 10, 1 + PRINT "..............................................................." + PRINT ".....MMMMMM................MM...MMMMMMM.MMMMMM.MMM..MMMMMMM..MM" + PRINT "MMMMMMMMMMMMMMM...MM.M....MMMMM.MM.MMMMMMMMMMMMMMMMMMMMMMM.MM.." + PRINT ".MMMMMMMMMMM.M.....MMM...MM.....MMMMMMMMMMMMMMMMMMMMMM.M......." + PRINT "..MMMMMMMMMMMM..............MMMMMMMMMMMMMMMMMMMMMMMMMM..M ....." + PRINT "....MMMMMMMM...............MMMM..MMMMM.MMMMMMMMMMMMM.MM........" + PRINT ".....MMMMMMM.............MMMMMMMM..MMM..MMMMMM.MMMMM.M........." + PRINT "........MM...............MMMMMMMMMM.M.....MM...........M......." + PRINT "......MMMMMM................MMMMMMM....................M......." + PRINT ".....MMMMMMMM.................MMMMMM....................MMM...." + PRINT "......MMMMMMM.................MMMMM...................MMMMMM..." + PRINT "........MMMMMM..................MM....................MMMMMMM.." + PRINT "..........MMMMM ...........................................MM.." +END SUB + +' Function to play a simple tune +SUB PlayTune + FOR a = 9 TO 23 + SOUND 1.5 ^ a, 3 + NEXT a +END SUB + +' Main program execution starts here +DO + ' Clear the screen and prompt the user for the password + CLS + COLOR 7 + PRINT "Enter password: "; + + ' Temporarily set text color to black to hide the password input + COLOR 0 + INPUT "", UserPassword$ + + ' Restore original text color + COLOR 7 +LOOP UNTIL UserPassword$ = CorrectPassword + +' Clear the screen for the welcome message +CLS + +' Call the function to display the welcome message +DisplayWelcomeMessage + +' Call the function to display the rocket artwork +DisplayRocketArt + +' Locate and display our location with a special color +LOCATE 7, 34 +COLOR 12 + 16 +PRINT "*" + +' Play the simple tune using the sound command +PlayTune + +' Restore default text color +COLOR 7, 0 + +' End of the program +END diff --git a/Tutorial/Group 2/09.bas b/Tutorial/Group 2/09.bas new file mode 100755 index 0000000..2e99357 --- /dev/null +++ b/Tutorial/Group 2/09.bas @@ -0,0 +1,21 @@ +' This program demonstrates the use of string manipulation functions +' in Microsoft QuickBasic. It shows how to extract substrings from a +' given string using the LEFT$ and RIGHT$ functions. + +DEFSTR A-Z ' Define all variables as strings to avoid type mismatches + +' Initialize a string variable with the value "software" +SoftwareName$ = "software" + +' Print the full name of the software +PRINT "Full software name: "; SoftwareName$ + +' Extract and print the first four characters from the left of the string +LEFTPart$ = LEFT$(SoftwareName$, 4) ' Get the leftmost substring +PRINT "Left part (first 4 characters): "; LEFTPart$ + +' Extract and print the last four characters from the right of the string +RIGHTPart$ = RIGHT$(SoftwareName$, 4) ' Get the rightmost substring +PRINT "Right part (last 4 characters): "; RIGHTPart$ + +END ' End of program diff --git a/Tutorial/Group 2/10.bas b/Tutorial/Group 2/10.bas new file mode 100755 index 0000000..5df3e41 --- /dev/null +++ b/Tutorial/Group 2/10.bas @@ -0,0 +1,37 @@ +CLS + +' This program demonstrates basic user input and string manipulation in QuickBasic. + +' Prompt the user to enter some text and store it in a variable called 'userInput$'. +INPUT "Enter some text: ", userInput$ + +' Print the text that the user entered in three different ways: +' 1. Concatenating the prompt with the entered text using the '+' operator. +' 2. Using a comma to separate the prompt from the entered text, which is more efficient. +' 3. Using a colon to print on the same line without a space between the prompt and the input. +PRINT "You entered: " + userInput$ + +' Calculate the length of the entered text using the LEN function. +' Then, print out the length, formatting it as a sentence. +PRINT "Its length is" + STR$(LEN(userInput$)) + " characters." + +' Use a FOR loop to iterate from 1 to the length of the user input. +' In each iteration, extract a substring from the left using the LEFT$ function +' and print it to demonstrate string extraction from the beginning. +FOR index = 1 TO LEN(userInput$) + PRINT "Leftmost " + STR$(index) + " character(s): " + LEFT$(userInput$, index) +NEXT index + +' Print a blank line for better readability of the output. +PRINT + +' Similar to the previous loop, but now we use the RIGHT$ function to extract +' substrings from the right end of the user input, demonstrating string extraction +' from the end of the string. +FOR index = 1 TO LEN(userInput$) + PRINT "Rightmost " + STR$(index) + " character(s): " + RIGHT$(userInput$, index) +NEXT index + +' End of the program. +END + diff --git a/Tutorial/Group 2/11.bas b/Tutorial/Group 2/11.bas new file mode 100755 index 0000000..ef910ae --- /dev/null +++ b/Tutorial/Group 2/11.bas @@ -0,0 +1,19 @@ +' Simple Character Extractor Program +' This program takes user input and prints each character individually + +CLS + +' Get user input +INPUT "Enter some text:", userInput$ + +' Process each character in the input string +FOR charPosition = 1 TO LEN(userInput$) + ' Get the left portion of the string up to current position + leftPortion$ = LEFT$(userInput$, charPosition) + + ' Extract the current character (rightmost character of left portion) + currentChar$ = RIGHT$(leftPortion$, 1) + + ' Print the current character with label + PRINT "letter:"; currentChar$ +NEXT charPosition diff --git a/Tutorial/Group 2/12.bas b/Tutorial/Group 2/12.bas new file mode 100755 index 0000000..28b738d --- /dev/null +++ b/Tutorial/Group 2/12.bas @@ -0,0 +1,45 @@ +' This program demonstrates the basics of animation and control flow in QuickBasic. +' It shows a simple text bouncing up and down on the screen, simulating a "jumping" effect. + +' Declare variables with descriptive names to hold the position and movement direction +DIM yPosition AS INTEGER ' Current vertical position of the text +DIM ySpeed AS INTEGER ' Vertical speed (or direction) of the text + +' Initialize the starting position and speed +yPosition = 10 +ySpeed = 1 + +' Main animation loop +DO + ' Clear the screen before drawing the next frame + CLS + + ' Update the vertical position based on the current speed + yPosition = yPosition + ySpeed + + ' Check if the text has hit the top boundary and change direction if it has + IF yPosition > 20 THEN + ySpeed = -1 + ENDIF + + ' Check if the text has hit the bottom boundary and change direction if it has + IF yPosition < 2 THEN + ySpeed = 1 + ENDIF + + ' Set the cursor position to the current vertical position + LOCATE yPosition + + ' Print the "jumping" text at the new position + PRINT "This is jumping text"; + + ' Play a sound with a frequency that varies based on the vertical position + ' The frequency is calculated to give an audible effect as the text jumps + SOUND yPosition * 200 + 100, 1 + + ' Pause briefly before drawing the next frame (adjust this value for faster or slower animation) + DELAY 0.1 +LOOP + +' Note: The program will run indefinitely due to the DO LOOP structure. +' To stop the program, you can press Ctrl+Break on most systems. diff --git a/Tutorial/Group 2/13.bas b/Tutorial/Group 2/13.bas new file mode 100755 index 0000000..c7c507a --- /dev/null +++ b/Tutorial/Group 2/13.bas @@ -0,0 +1,54 @@ +' This program demonstrates basic animation and boundary checking in QuickBasic. +' It simulates a simple ball bouncing around the screen. + +CLS ' Clear the screen before starting the animation + +' Initialize variables representing the ball's position and velocity +DIM x AS INTEGER ' Ball's X coordinate +DIM y AS INTEGER ' Ball's Y coordinate +DIM xs AS INTEGER ' Ball's speed in the X direction +DIM ys AS INTEGER ' Ball's speed in the Y direction + +x = 12 ' Initial X position of the ball +y = 7 ' Initial Y position of the ball +xs = 1 ' Initial velocity in the X direction (rightward) +ys = 1 ' Initial velocity in the Y direction (downward) + +' Main animation loop +DO + ' Erase the ball at its current position by printing a space + LOCATE y, x: PRINT " "; + + ' Update the ball's position based on its velocities + x = x + xs + y = y + ys + + ' Draw the ball at its new position + LOCATE y, x: PRINT "O"; + + ' Check if the ball hits the right or left boundaries and reverse X velocity + IF x >= 79 THEN + xs = -1 + SOUND 1000, 1 ' Play a sound when hitting the boundary + END IF + IF x <= 1 THEN + xs = 1 + SOUND 1000, 1 ' Play a sound when hitting the boundary + END IF + + ' Check if the ball hits the bottom or top boundaries and reverse Y velocity + IF y >= 22 THEN + ys = -1 + SOUND 1000, 1 ' Play a sound when hitting the boundary + END IF + IF y <= 1 THEN + ys = 1 + SOUND 1000, 1 ' Play a sound when hitting the boundary + END IF + + ' Pause briefly to control the speed of the animation + SOUND 0, 1 +LOOP + +' The program will continue running indefinitely, creating an animated bouncing ball effect + diff --git a/Tutorial/Group 2/14.bas b/Tutorial/Group 2/14.bas new file mode 100755 index 0000000..4a0f1f9 --- /dev/null +++ b/Tutorial/Group 2/14.bas @@ -0,0 +1,54 @@ +' This program demonstrates how to use the SOUND statement in QuickBasic +' to produce different tones when pressing keys "0" through "9". +' It also shows how to exit the program by pressing the Escape key. + +CLS +PRINT "Press keys '0'-'9' for different sounds." +PRINT "Press Esc to exit the program." + +' Start an infinite loop to continuously check for user input +DO + ' Read a single character from the keyboard + a$ = INPUT$(1) + + ' Play a sound corresponding to the key pressed + SELECT CASE a$ + CASE "0" + ' Generate a low-pitched tone + SOUND 1900, 2 + CASE "1" + ' Generate a slightly higher pitched tone + SOUND 1000, 2 + CASE "2" + ' Generate a tone with a frequency of 1100 Hz + SOUND 1100, 2 + CASE "3" + ' Generate a tone with a frequency of 1200 Hz + SOUND 1200, 2 + CASE "4" + ' Generate a tone with a frequency of 1300 Hz + SOUND 1300, 2 + CASE "5" + ' Generate a tone with a frequency of 1400 Hz + SOUND 1400, 2 + CASE "6" + ' Generate a tone with a frequency of 1500 Hz + SOUND 1500, 2 + CASE "7" + ' Generate a high-pitched tone + SOUND 1600, 2 + CASE "8" + ' Generate a very high-pitched tone + SOUND 1700, 2 + CASE "9" + ' Generate the highest pitched tone available + SOUND 1800, 2 + CASE CHR$(27) + ' Check if the Escape key is pressed to exit the program + SYSTEM + CASE ELSE + ' If any other key is pressed, do nothing + END SELECT + + ' Loop indefinitely until the user decides to exit +LOOP diff --git a/Tutorial/Group 2/15.bas b/Tutorial/Group 2/15.bas new file mode 100755 index 0000000..0f8b2b8 --- /dev/null +++ b/Tutorial/Group 2/15.bas @@ -0,0 +1,26 @@ +' This program demonstrates how to use a FOR loop and the CHR$ function +' in QuickBasic to print out characters from the ASCII table. + +CLS ' Clears the screen before printing + +' The FOR loop iterates over ASCII values starting from 32 (space character) +' up to 255, which is beyond the standard ASCII range but includes extended +' ASCII characters in QuickBasic. +FOR a = 32 TO 255 + ' CHR$ function converts an ASCII value to its corresponding character + PRINT " " + CHR$(a); ' Prints each character with a leading space for readability +NEXT a + +' Print two new lines to separate the ASCII table from the greeting message +PRINT +PRINT + +' Greet the user in a friendly manner +' The CHR$(1) represents the Start of Header (SOH) control character, which is +' typically not visible and may be interpreted differently depending on the +' environment. It is used here for demonstration purposes to show how +' non-printable characters can be included in strings. +PRINT "Hi there! " + CHR$(1) + +' End of the program +END diff --git a/Tutorial/Group 2/16.bas b/Tutorial/Group 2/16.bas new file mode 100755 index 0000000..3ff22a5 --- /dev/null +++ b/Tutorial/Group 2/16.bas @@ -0,0 +1,40 @@ +' This program demonstrates how to capture and process keyboard input in QuickBASIC. +' It listens for a key press, then prints out the character and its ASCII code. +' Special keys like Escape, Enter, Backspace, Tabulator, and Space are given custom names. + +CLS ' Clears the screen before starting the program +PRINT "Press any key..." ' Prompts the user to press a key + +' Main loop starts here +DO + ' Capture a single character of input from the user + a$ = INPUT$(1) + + ' Print the pressed key, if it is a printable character (ASCII code > 32) + PRINT "Pressed key was: "; + IF ASC(a$) > 32 THEN + PRINT a$ + END IF + + ' Check for special keys and print their names + SELECT CASE ASC(a$) + CASE 27 ' ASCII code for Escape key + PRINT "Escape" + CASE 13 ' ASCII code for Enter key + PRINT "Enter" + CASE 8 ' ASCII code for Backspace key + PRINT "Backspace" + CASE 9 ' ASCII code for Tabulator key + PRINT "Tabulator" + CASE 32 ' ASCII code for Space key + PRINT "Space" + CASE ELSE + ' If the key is not special, print its ASCII character + IF ASC(a$) > 32 THEN + PRINT a$ + END IF + END SELECT + + ' Print the ASCII code of the pressed key + PRINT "ASCII code is: "; ASC(a$) +LOOP ' Continue listening for more key presses diff --git a/Tutorial/Group 2/17.bas b/Tutorial/Group 2/17.bas new file mode 100755 index 0000000..899390e --- /dev/null +++ b/Tutorial/Group 2/17.bas @@ -0,0 +1,58 @@ +' This program demonstrates how to handle keyboard input in QuickBasic +' and move a character around the screen using the numeric keypad. + +CLS + +' Inform the user about the controls and how to exit the program +PRINT "Use keys 4, 8, 6, 2 for movement, make sure the NumLock is on" +PRINT "ESC to exit" + +' Clear a line for better visibility +PRINT " " + +' Wait for the user to press any key to start +PRINT "Press any key to continue..." +a$ = INPUT$(1) + +' Set the text color to bright yellow +COLOR 14 + +' Initialize the starting position of the character +x = 40 +y = 10 + +' Main loop for handling input and drawing the character +DO + CLS ' Clear the screen before redrawing + + ' Set the cursor position to the current character coordinates + LOCATE y, x + + ' Print the character at the current position + PRINT CHR$(2); ' The semicolon prevents moving to the next line + + ' Read a single character of input without waiting + a$ = INPUT$(1) + + ' Check for movement inputs and update the character's position + SELECT CASE a$ + CASE "4" ' Left arrow + x = x - 1 + CASE "6" ' Right arrow + x = x + 1 + CASE "8" ' Up arrow + y = y - 1 + CASE "2" ' Down arrow + y = y + 1 + CASE CHR$(27) ' Escape key + ' Exit the program + SYSTEM + END SELECT + + ' Prevent the character from going off-screen + IF x < 1 THEN x = 1 + IF x > 80 THEN x = 80 + IF y < 1 THEN y = 1 + IF y > 25 THEN y = 25 + +LOOP ' Continue the main loop indefinitely diff --git a/Tutorial/Group 2/18.bas b/Tutorial/Group 2/18.bas new file mode 100755 index 0000000..9700d82 --- /dev/null +++ b/Tutorial/Group 2/18.bas @@ -0,0 +1,56 @@ +CLS + +' Main program loop starts here +DO + ' Clear the screen and print the menu options + CLS + PRINT "******** Select action: ********" + PRINT " " + PRINT "1 - Exit program" + PRINT "2 - Make a sound" + PRINT "3 - Draw a box" + + ' Prompt the user to enter their choice and store it in variable 'userChoice' + INPUT "Enter your choice (1-3): ", userChoice + + ' Exit the program if the user chooses option 1 + IF userChoice = 1 THEN + PRINT "Exiting program..." + EXIT DO + END IF + + ' Play a sound if the user chooses option 2 + IF userChoice = 2 THEN + ' Generate a sound with a frequency of 2000 Hz for 2 seconds + SOUND 2000, 2 + + ' Draw a box if the user chooses option 3 + ELSEIF userChoice = 3 THEN + ' Outer loop to draw the top and bottom edges of the box + FOR row = 1 TO 15 + ' Inner loop to draw the left and right edges of the box + FOR col = 1 TO 50 + PRINT "#"; + NEXT col + ' Move to the next line after drawing each row + PRINT + NEXT row + + ' Inform the user if they have entered a number greater than 3 + ELSEIF userChoice > 3 THEN + PRINT "Number too large. Please enter a value between 1 and 3." + + ' Inform the user if they have entered a number less than 1 + ELSEIF userChoice < 1 THEN + PRINT "Number too small. Please enter a value between 1 and 3." + END IF + + ' Wait for the user to press a key before continuing + PRINT "Press any key to continue..." + WHILE INKEY$ = "" + ' Do nothing, just wait for a key press + WEND + +LOOP WHILE TRUE + +' End of program diff --git a/Tutorial/Group 3/00.bas b/Tutorial/Group 3/00.bas new file mode 100755 index 0000000..c01682c --- /dev/null +++ b/Tutorial/Group 3/00.bas @@ -0,0 +1,21 @@ +' This program demonstrates how to set the video mode to 320x200 with 256 colors +' and how to draw a single point on the screen using QuickBasic. + +SCREEN 13 ' Set video mode to 320 x 200 with 256 colors + +' Greet the user with a simple message +PRINT "Hello..." + +' Define constants for the center of the screen for readability +CONST CenterX = 160 +CONST CenterY = 100 + +' Draw a point on the screen at the defined center coordinates +' with a specified color. +PSET (CenterX, CenterY), 10 ' Draws a point at (x=160, y=100) with color 10 + +' Wait for a key press before exiting the program +PRINT "Press any key to exit..." +WHILE INKEY$ = "" + ' Do nothing until a key is pressed +WEND diff --git a/Tutorial/Group 3/01.bas b/Tutorial/Group 3/01.bas new file mode 100755 index 0000000..2575df0 --- /dev/null +++ b/Tutorial/Group 3/01.bas @@ -0,0 +1,18 @@ +' QuickBasic example program to demonstrate drawing pixels on the screen +' and generating simple sound with varying frequency. + +SCREEN 13 ' Set the graphics mode to 320x200 resolution with 256 colors + +' Loop to draw a vertical line of pixels from y-coordinate 50 to 150 +FOR y = 50 TO 150 + ' Loop to draw a horizontal line of pixels from x-coordinate 100 to 200 + FOR x = 100 TO 200 + PSET (x, y), 10 ' Set the pixel at (x, y) to color 10 + NEXT x + + ' Generate a sound with a frequency corresponding to the y-coordinate + ' The SOUND statement takes two arguments: frequency and duration + ' Here, the frequency is set to the current value of y, and the duration + ' is set to 1 tick (approximately 1/18th of a second) + SOUND y, 1 +NEXT y diff --git a/Tutorial/Group 3/02.bas b/Tutorial/Group 3/02.bas new file mode 100755 index 0000000..adf3b10 --- /dev/null +++ b/Tutorial/Group 3/02.bas @@ -0,0 +1,27 @@ +' This program demonstrates how to create a simple drawing application +' using Microsoft QuickBasic. It defines a subroutine called 'box' that +' draws a rectangle on the screen with specified coordinates and color. + +' Declare the 'box' subroutine so it can be used in the main program +DECLARE SUB box (x1 AS SINGLE, y1 AS SINGLE, x2 AS SINGLE, y2 AS SINGLE, c AS INTEGER) + +' Set the screen mode to 13h which is a 320x200 pixel graphics mode with 256 colors +SCREEN 13 + +' Draw three boxes on the screen using the 'box' subroutine +' Each box has different starting and ending coordinates as well as color +box 10, 10, 100, 100, 15 +box 30, 80, 300, 120, 11 +box 140, 20, 180, 180, 10 + +' Define the 'box' subroutine +SUB box (x1 AS SINGLE, y1 AS SINGLE, x2 AS SINGLE, y2 AS SINGLE, c AS INTEGER) + ' Use nested FOR loops to iterate over every pixel within the rectangle + DIM x AS SINGLE, y AS SINGLE + FOR y = y1 TO y2 + FOR x = x1 TO x2 + ' Set the color of the current pixel to the specified color 'c' + PSET (x, y), c + NEXT x + NEXT y +END SUB diff --git a/Tutorial/Group 3/03.bas b/Tutorial/Group 3/03.bas new file mode 100755 index 0000000..ee7b9c2 --- /dev/null +++ b/Tutorial/Group 3/03.bas @@ -0,0 +1,15 @@ +' This program demonstrates how to use QuickBasic to draw a simple +' graphic on the screen. It initializes the graphics mode, draws a +' rectangle, and then draws a circle within that rectangle. + +' Set the graphics mode to 320x200 with 256 colors (mode 13) +SCREEN 13 + +' Draw a line +LINE (10, 10)-(200, 100), 14 + +' Draw a circle centered at (100, 100) with a radius of 80 pixels +' using color 10 (bright green). The circle is drawn within the +' previously defined rectangle. +CIRCLE (100, 100), 80, 10 + diff --git a/Tutorial/Group 3/04.bas b/Tutorial/Group 3/04.bas new file mode 100755 index 0000000..8408375 --- /dev/null +++ b/Tutorial/Group 3/04.bas @@ -0,0 +1,25 @@ +' This example program demonstrates how to draw different types of +' lines and boxes on the screen using Microsoft QuickBasic. + +' First, we set the screen mode to 13 which provides a graphics +' resolution of 320x200 with 256 colors available. +SCREEN 13 + +' Now we will draw three different objects using the LINE statement: + +' Draw an filled box from coordinates (10, 10) to (50, 50). +LINE (10, 10)-(50, 50), 14, BF + +' Draw an unfilled box with coordinates (100, 10) to (150, 50). +LINE (100, 10)-(150, 50), 14, B + +' Draw a line with coordinates (200, 10) to (250, 50). +LINE (200, 10)-(250, 50), 14 + +' To finish the program and allow users to see the drawn objects +' before the screen closes, we wait for a key press from the user. +PRINT "Press any key to exit..." +WHILE NOT INKEY$ <> "" + ' Loop until a key is pressed +WEND + diff --git a/Tutorial/Group 3/05.bas b/Tutorial/Group 3/05.bas new file mode 100755 index 0000000..296eb8d --- /dev/null +++ b/Tutorial/Group 3/05.bas @@ -0,0 +1,15 @@ +' QuickBasic example program to demonstrate drawing lines with varying colors + +SCREEN 13 ' Set the screen mode to 13h which provides 256 color graphics + +' Draw vertical lines across the screen with colors from 0 to 255 +FOR xPosition = 0 TO 255 + ' Draw a line from coordinates (xPosition, 50) to (xPosition, 100) using color xPosition + LINE (xPosition, 50)-(xPosition, 100), xPosition +NEXT xPosition + +' Keep the window open until the user presses a key +PRINT "Press any key to exit..." +WHILE INKEY$ = "" +WEND + diff --git a/Tutorial/Group 3/06.bas b/Tutorial/Group 3/06.bas new file mode 100755 index 0000000..e60ab45 --- /dev/null +++ b/Tutorial/Group 3/06.bas @@ -0,0 +1,27 @@ +' This program demonstrates basic graphics drawing in QuickBasic. +' It uses the SCREEN function to set the graphics mode, draws a circle +' and a line using CIRCLE and LINE commands respectively, waits for user +' input, and then uses the PAINT command to fill an area with a solid color. + +' Set the screen to mode 13 which is 320x200 pixels with 256 colors. +SCREEN 13 + +' Draw a circle centered at (160, 100) with a radius of 80 pixels +' and use color 15 for the outline of the circle. +CIRCLE (160, 100), 80, 15 + +' Draw a line from (100, 10) to (200, 180) using color 15. +LINE (100, 10)-(200, 180), 15 + +' Print a message to the screen prompting the user to press any key. +PRINT "Press any key to fill part of the circle..." + +' Wait for the user to press a key and store the input in variable 'a$'. +a$ = INPUT$(1) + +' Fill the area inside the circle with color 15 starting from point (180, 100). +' Note that PAINT fills an area bounded by the specified color at the start point. +PAINT (180, 100), 15 + +END ' End the program (although END is not strictly necessary in QuickBasic) + diff --git a/Tutorial/Group 3/07.bas b/Tutorial/Group 3/07.bas new file mode 100755 index 0000000..216341e --- /dev/null +++ b/Tutorial/Group 3/07.bas @@ -0,0 +1,25 @@ +' This program demonstrates how to use subroutines and drawing +' commands in QuickBasic. It draws a simple figure consisting of +' concentric circles and intersecting lines. + +DECLARE SUB DrawFigure (xCenter AS DOUBLE, yCenter AS DOUBLE) +SCREEN 13 ' Set the screen mode for high-resolution graphics + +' To see a list of subroutines, press F2 +' This is useful when navigating through larger programs + +' Draw figures at different locations on the screen +DrawFigure 100, 100 +DrawFigure 200, 50 +DrawFigure 180, 150 + +SUB DrawFigure (xCenter AS DOUBLE, yCenter AS DOUBLE) + ' Draw three concentric circles with a specified center point + CIRCLE (xCenter, yCenter), 10, 15 + CIRCLE (xCenter, yCenter), 20, 15 + CIRCLE (xCenter, yCenter), 30, 15 + + ' Draw two lines intersecting at the center point + LINE (xCenter, yCenter - 50)-(xCenter, yCenter + 50), 15 + LINE (xCenter - 50, yCenter)-(xCenter + 50, yCenter), 15 +END SUB diff --git a/Tutorial/Group 3/08.bas b/Tutorial/Group 3/08.bas new file mode 100755 index 0000000..56ba16e --- /dev/null +++ b/Tutorial/Group 3/08.bas @@ -0,0 +1,33 @@ +' This program demonstrates how to draw sine and cosine waves on the screen +' using Microsoft QuickBasic. It is intended for beginners learning +' programming in QuickBasic. + +' First, we set the graphics mode to 13 which provides a 320x200 pixel +' resolution with 256 colors. +SCREEN 13 + +' We will draw two waves: one for sine and another for cosine. The amplitude +' of both waves is scaled by a factor of 50, and they are vertically +' centered on the screen by adding 100 to the y-coordinate. + +' The FOR loop iterates over the x-axis from 0 to 319 pixels, which covers +' the entire width of the screen in this graphics mode. +FOR x = 0 TO 319 + ' Calculate the y-coordinate for the sine wave. We divide x by 10 to + ' reduce the frequency of the wave so it fits nicely on the screen. + ' The SIN function returns a value between -1 and 1, which we scale + ' and shift to get the desired waveform. + ysine = SIN(x / 10) * 50 + 100 + + ' Use PSET (Pixel SET) to plot a point on the screen for the sine wave + PSET (x, ysine), 14 + + ' Similarly, calculate and plot the cosine wave with color 12 + ycosine = COS(x / 10) * 50 + 100 + PSET (x, ycosine), 12 + + ' The loop continues to the next x-coordinate until it reaches 319. +NEXT x + +' After the loop completes, both sine and cosine waves will be drawn on +' the screen, with each point of the wave plotted in its respective color. diff --git a/Tutorial/Group 3/09.bas b/Tutorial/Group 3/09.bas new file mode 100755 index 0000000..31d9cb1 --- /dev/null +++ b/Tutorial/Group 3/09.bas @@ -0,0 +1,40 @@ +' This program demonstrates how to draw a simple circle using QuickBasic. +' It utilizes trigonometric functions SIN and COS to calculate the position of points on a circle. + +SCREEN 13 ' Set the screen mode to 13, which is 320x200 with 256 colors + +' Define pi (π) as a constant for calculations +CONST pi = 3.141592653589789# + +' Define the number of points to be drawn on the circular shape +DIM mi AS INTEGER +mi = 12 + +' Calculate the angle increment for each iteration of the loop +' This will determine how many points we draw on the circle +DIM angleStep AS SINGLE +angleStep = pi * 2 / mi + +' Loop through angles from 0 to 2π (360 degrees) with the calculated step +FOR a = 0 TO pi * 2 STEP angleStep + + ' Calculate the x-coordinate of the current point on the circle + ' We multiply by 50 to scale the radius and add 100 for centering + DIM x AS SINGLE + x = SIN(a) * 50 + 100 + + ' Calculate the y-coordinate of the current point on the circle + ' Similarly, we scale and center the point + DIM y AS SINGLE + y = COS(a) * 50 + 100 + + ' Set the pixel at coordinates (x, y) with color 10 + PSET (x, y), 10 + +NEXT a + +' Wait for a key press before ending the program +PRINT "Press any key to exit..." +WHILE INKEY$ = "" +WEND + diff --git a/Tutorial/Group 3/10.bas b/Tutorial/Group 3/10.bas new file mode 100755 index 0000000..ad15b02 --- /dev/null +++ b/Tutorial/Group 3/10.bas @@ -0,0 +1,53 @@ +' This program demonstrates basic QuickBasic graphics and sound capabilities. +' It is designed for novice programmers to learn about drawing lines, plotting points, +' handling user input, and generating simple sounds. + +' Set the graphics mode to 320x200 with 16 colors (mode 13). +SCREEN 13 + +' Draw a grid on the screen with horizontal and vertical lines every 10 pixels. +' This loop demonstrates the use of the LINE function to draw lines. +FOR i = 0 TO 320 STEP 10 + ' Draw a horizontal line from the left edge to the right edge at y-coordinate i. + LINE (0, i)-(319, i), 5 + ' Draw a vertical line from the top edge to the bottom edge at x-coordinate i. + LINE (i, 0)-(i, 199), 5 +NEXT i + +' Draw a horizontal line across the middle of the screen (y=100) +LINE (0, 100)-(319, 100), 10 + +' Prompt the user to press any key before continuing. +PRINT "Press any key to continue..." +' Wait for the user to press a key and store the input in variable a$. +a$ = INPUT$(1) + +' Initialize variables for the bouncing ball animation and sound. +DIM y AS SINGLE ' The vertical position of the ball, using single precision for smooth motion. +DIM ys AS SINGLE ' The vertical speed of the ball. +DIM t AS INTEGER ' A counter for the main animation loop. + +' Set the initial vertical position of the ball to the middle of the screen (y=100). +y = 100 +' Set the initial vertical speed of the ball to a negative value for upward motion. +ys = -1 + +' The main animation loop runs from t=0 to t=300, simulating the passage of time. +FOR t = 0 TO 300 + ' Plot the current position of the ball with a specific color (14). + PSET (t, y), 14 + + ' Update the vertical speed of the ball by adding gravity-like acceleration (ys = ys + .01). + ys = ys + .01 + ' Update the vertical position of the ball based on the current speed (y = y + ys). + y = y + ys + + ' Generate a sound with a frequency that varies inversely with the ball's vertical position. + ' As the ball falls, the pitch of the sound increases. + SOUND 300 - y, .1 +NEXT t + +' The program ends here; to exit, press any key. +PRINT "Press any key to exit..." +a$ = INPUT$(1) + diff --git a/Tutorial/Group 3/11.bas b/Tutorial/Group 3/11.bas new file mode 100755 index 0000000..6d1cfe9 --- /dev/null +++ b/Tutorial/Group 3/11.bas @@ -0,0 +1,26 @@ +' This program demonstrates basic mathematical operations in QuickBasic. +' It includes examples of rounding, taking the absolute value, +' and finding the remainder of a division operation. + +DIM a AS SINGLE ' Declare variable 'a' as type SINGLE for floating-point arithmetic + +' Assign a negative floating-point number to variable 'a' +a = -12.7 + +' Print the original value of 'a' +PRINT "Normal: "; a + +' Use the INT function to round down 'a' to the nearest whole number +' and print the result +PRINT "Rounded down (INT): "; INT(a) + +' Use the ABS function to get the absolute value of 'a', +' which is always non-negative, and print the result +PRINT "Absolute value: "; ABS(a) + +' Calculate the remainder of 10 divided by 4 using the MOD operator +' and store the result in an implicitly declared variable +' Then print the result +DIM reminder AS INTEGER +reminder = 10 MOD 4 +PRINT "Remainder of 10 / 4 is: "; reminder diff --git a/Tutorial/index.html b/Tutorial/index.html new file mode 100644 index 0000000..459b8ee --- /dev/null +++ b/Tutorial/index.html @@ -0,0 +1,16 @@ + +QBasic tutorial + + + +

QBasic tutorial

+
+
+
QBasic tutorial. +Is a good for those who like to learn by example. +Package contains a lot of tiny self explainatory +examples quiding you from simplest operations like printing +to console, functions and array access to 2D and 3D graphics. +
Used those successfully as examples when teaching programming for beginners. + + \ No newline at end of file diff --git a/Tutorial/qsort3.bas b/Tutorial/qsort3.bas new file mode 100644 index 0000000..edc6407 --- /dev/null +++ b/Tutorial/qsort3.bas @@ -0,0 +1,136 @@ +DECLARE SUB sort (x1!, x2!) +DECLARE SUB check () +DECLARE SUB di (r1!, r2!, c!) +DECLARE SUB disp () +DIM SHARED siz +siz = 15000 +DIM SHARED arr(1 TO siz) +DIM SHARED mark(1 TO siz) +DIM SHARED bck(1 TO siz) +DIM SHARED dbg +WIDTH 80, 50 + +dbg = 1 +CLS +FOR i = 1 TO 1000 +LOCATE 5, 40 +PRINT i +RANDOMIZE i +siz = 45 + +FOR a = 1 TO siz + arr(a) = INT(RND * 100) + bck(a) = arr(a) +NEXT a +11 + +sort 1, siz +disp + + +fail = 0 +FOR i2 = 1 TO siz - 1 + IF arr(i2) > arr(i2 + 1) THEN + PRINT "wrong!" + a$ = INPUT$(1) + fail = 1 + GOTO 10 + END IF +NEXT i2 +10 + +IF fail = 1 THEN + FOR i2 = 1 TO siz + arr(i2) = bck(i2) + NEXT i2 + dbg = 1 + GOTO 11 +END IF + +NEXT i + +SUB di (r1, r2, c) + +mark(r1) = c +mark(r2) = c +disp +mark(r1) = 0 +mark(r2) = 0 + + +END SUB + +SUB disp +FOR i = 1 TO siz + LOCATE i, 1 + COLOR 15, mark(i) + PRINT arr(i), " ", i +NEXT i + +IF dbg = 1 THEN a$ = INPUT$(1) +'SOUND 0, .05 +END SUB + +SUB sort (x1, x2) +min = 99999 +max = -99999 +FOR i = x1 TO x2 + IF arr(i) > max THEN max = arr(i) + IF arr(i) < min THEN min = arr(i) +NEXT i +sv = (max + min) / 2 +LOCATE 1, 50 +PRINT sv +'disp +di x1, x2, 4 +IF x1 >= x2 THEN GOTO 3 + +IF x1 + 1 = x2 THEN + IF arr(x1) > arr(x2) THEN SWAP arr(x1), arr(x2) + GOTO 3 +END IF + +xl1 = x1 +xl2 = x2 + + +1 +di xl1, xl2, 1 +IF arr(xl1) > sv THEN +2 + IF arr(xl2) < sv THEN + SWAP arr(xl1), arr(xl2) + xl1 = xl1 + 1 + xl2 = xl2 - 1 + ELSE + xl2 = xl2 - 1 + di xl1, xl2, 1 + IF xl1 = xl2 THEN GOTO 4 + GOTO 2 + END IF +ELSE + xl1 = xl1 + 1 +END IF + +IF xl1 < xl2 THEN GOTO 1 +'IF arr(xl1) < sv THEN xl1 = xl1 + 1 +'IF arr(xl1) < sv THEN xl1 = xl1 + 1 +4 +mark(xl1) = 14 +disp +mark(xl1) = 0 + +IF xl1 = x2 THEN + sort x1, xl1 - 1 +ELSE + IF arr(xl1) > sv THEN + sort x1, xl1 - 1 + sort xl1, x2 + ELSE + sort x1, xl1 + sort xl1 + 1, x2 + END IF +END IF +3 +END SUB + diff --git a/VC.EXT b/VC.EXT new file mode 100644 index 0000000..31271e4 --- /dev/null +++ b/VC.EXT @@ -0,0 +1 @@ +bas: c:\qb45\qb.exe !.! \ No newline at end of file diff --git a/index.org b/index.org new file mode 100644 index 0000000..239fef8 --- /dev/null +++ b/index.org @@ -0,0 +1,451 @@ +#+SETUPFILE: ~/.emacs.d/org-styles/html/darksun.theme +#+TITLE: BASIC applications collection +#+LANGUAGE: en +#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry} +#+LATEX_HEADER: \usepackage{parskip} +#+LATEX_HEADER: \usepackage[none]{hyphenat} + +#+OPTIONS: H:20 num:20 +#+OPTIONS: author:nil + +#+begin_export html + +#+end_export + + +* Overview +This collection contains lots of applications: + +- [[id:3587240c-1d50-478d-b850-04ebc8dc63c7][Miscellaneous]] + +- [[id:ebafd8a3-54d4-4834-a03d-a942b535a82f][2D Graphics]] + - [[file:2D%20GFX/Animations/index.html][Animations]] + +- [[id:63fd5d58-9bce-4c0a-99d4-ed2d025258f0][3D Graphics]] +- [[id:aa195f33-6d69-48ff-9af5-3f761a51dcb2][Games]] + +I wrote them at around year 2000, mostly in QBasic. + +* 2D GFX +:PROPERTIES: +:ID: ebafd8a3-54d4-4834-a03d-a942b535a82f +:END: +** Animations + +Collection of various 2D animations. Good for demonstrating various +algorithms and getting fun looking results quite easily. + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:2D%20GFX/Animations/index.html][file:2D%20GFX/Animations/logo.png]] + +[[file:2D%20GFX/Animations/index.html][See entire animations collection]] + +** Fractals + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:2D%20GFX/Fractals/index.html][file:2D%20GFX/Fractals/fractal%20squares,%202.png]] + +[[file:2D GFX/Fractals/index.html][See entire fractals collection]] + +** Spiral series + +Small collection of programs that are result of exploratory +programming, for fun. It started out from drawing spiral on the +screen. Every iteration built upon previous result. + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:2D%20GFX/Spirals/index.html][file:2D%20GFX/Spirals/logo.png]] + +[[file:2D%20GFX/Spirals/index.html][See entire spiral collection]] + +** Textures + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:2D%20GFX/Textures/index.html][file:2D%20GFX/Textures/logo.png]] + +[[file:2D%20GFX/Textures/index.html][See entire texture collection]] + +** Miscellaneous +*** Hello friend + +TODO: description goes here ... + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:2D%20GFX/Hello%20friend.bas][file:2D%20GFX/Hello%20friend.png]] + +[[file:2D%20GFX/Hello%20friend.bas][Hello friend.bas]] + +#+INCLUDE: "2D GFX/Hello friend.bas" src basic-qb45 + +*** People + +TODO: description goes here ... + +#+begin_export html +
+ +
+#+end_export + +[[file:2D%20GFX/People.bas][People.bas]] + +*** Stroboscope + +TODO: description goes here ... + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:2D%20GFX/Stroboscope.bas][file:2D%20GFX/Stroboscope.png]] + +[[file:2D%20GFX/Stroboscope.bas][Stroboscope.bas]] + +*** Truncated cone + +TODO: description goes here ... + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:2D%20GFX/Truncated%20cone.bas][file:2D%20GFX/Truncated%20cone.png]] + +[[file:2D%20GFX/Truncated%20cone.bas][Truncated cone.bas]] + +#+INCLUDE: "2D GFX/Truncated cone.bas" src basic-qb45 + +* 3D GFX +:PROPERTIES: +:ID: 63fd5d58-9bce-4c0a-99d4-ed2d025258f0 +:END: +** Miscellaneous 3D demos + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:3D%20GFX/Miscellaneous/index.html][file:3D%20GFX/Miscellaneous/logo.png]] + +[[file:3D GFX/Space/index.html][See entire miscellaneous 3D demo applications collection]] + +** Space + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:3D%20GFX/Space/index.html][file:3D%20GFX/Space/logo.png]] + +[[file:3D GFX/Space/index.html][See entire space themed applications collection]] + +** 3D Synthezier + +Parses scene definition language and creates 3D world based on +it. Result will be in a [[https://en.wikipedia.org/wiki/Wavefront_.obj_file][wavefront obj file]], witch can be then +visualized using external renderer. + +See directory: +: 3D GFX/3D Synthetizer/ + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:3D%20GFX/3D%20Synthezier/doc/index.html][file:3D%20GFX/3D%20Synthezier/doc/hexagonal%20city,%202.jpeg]] + +[[file:3D%20GFX/3D%20Synthezier/doc/index.html][Read more]] + +** Helicopter demo + +TODO: description goes here ... + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:3D%20GFX/Helicopter/demo,%201.png][file:3D%20GFX/Helicopter/demo,%201.png]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:3D%20GFX/Helicopter/demo,%202.png][file:3D%20GFX/Helicopter/demo,%202.png]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:3D%20GFX/Helicopter/demo,%203.png][file:3D%20GFX/Helicopter/demo,%203.png]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:3D%20GFX/Helicopter/demo,%204.png][file:3D%20GFX/Helicopter/demo,%204.png]] + +[[https://www2.svjatoslav.eu/gitweb/?p=qbasicapps.git;a=tree;f=3D+GFX/Helicopter;hb=HEAD][Project files]] + +** Swapping 3D engine + +TODO: description goes here ... + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:3D%20GFX/Swapping%203D%20engine/screenshot.png]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:3D%20GFX/Swapping%203D%20engine/screenshot,%202.png]] + +[[file:3D%20GFX/Swapping%203D%20engine/engine.bas][engine.bas]] + +** 3D land + +#+begin_export html +
+ +
+#+end_export + + +[[file:3D%20GFX/3D%20land.bas][3D land.bas]] + +#+INCLUDE: "3D GFX/3D land.bas" src basic-qb45 + +** Anaglyph + +TODO: description goes here ... + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:3D%20GFX/Anaglyph.bas][file:3D%20GFX/Anaglyph.png]] + +[[file:3D%20GFX/Anaglyph.bas][Anaglyph.bas]] + +** Ray casting engine + +TODO: description goes here ... + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:3D%20GFX/Ray%20casting%20engine.bas][file:3D%20GFX/Ray%20casting%20engine.png]] + +[[file:3D%20GFX/Ray%20casting%20engine.bas][Ray casting engine.bas]] + +* Misc +:PROPERTIES: +:ID: 3587240c-1d50-478d-b850-04ebc8dc63c7 +:END: +* Games +:PROPERTIES: +:ID: aa195f33-6d69-48ff-9af5-3f761a51dcb2 +:END: +** Multiplayer game of worms + +Game supports up to 5 players. Any amount of those players can be AI +controlled. Game has multiple levels. After worms have eaten certain +amount of fruits, game advances to the next level. Each worm has +limited amount of lives. When worm runs into the wall or another worm, +it loses one life. + +#+begin_export html +
+ +
+#+end_export + +[[file:Games/Worm/worm.bas][Source code]] + +Levels are stored in [[https://www2.svjatoslav.eu/gitweb/?p=qbasicapps.git;a=tree;f=Games/Worm;h=644d30adafb2621f34f6d2f3e43e026084092f60;hb=HEAD]['lvl' files]] that are directly editable using text +editor. + +** Checkers + +Play checkers against the computer with any board size and any amount +of caps. Does thinking by recursively testing many possible scenarios +with any depth. + +Since it is slow QBasic implementation, it isn't practical to play +with many caps or big thinking depth, for reasonable responce time. + +[[file:Games/Checkers 2/checkers2.bas][Source code]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Games/Checkers 2/checkers2.bas][file:Games/Checkers%202/screenshot.png]] + +* Download +** Getting the source code + +Programs author is Svjatoslav Agejenko +- Homepage: https://svjatoslav.eu (See also [[https://www.svjatoslav.eu/projects/][other software projects]].) +- Email: mailto://svjatoslav@svjatoslav.eu + +*These programs are free software: released under Creative Commons +Zero (CC0) license.* + +- [[https://www2.svjatoslav.eu/gitweb/?p=qbasicapps.git;a=summary][Browse Git repository online]]. +- [[https://www2.svjatoslav.eu/gitweb/?p=qbasicapps.git;a=snapshot;h=HEAD;sf=tgz][Download latest snapshot in TAR GZ format]]. +- You can clone Git repository using git: + : git clone https://www3.svjatoslav.eu/git/qbasicapps.git + +** Installation and Usage + +There are various ways to run legacy QBasic applications under Debian +GNU/Linux: + ++ Full system virtualization :: One way would be to use full system +virtualization with [[https://www.qemu.org/][QEMU]], [[https://www.virtualbox.org/][VirtualBox]] or [[https://www.vmware.com/products/desktop-hypervisor.html][VMware Workstation or +Player]]. After creating virtual machine, you need to obtain and +install some distribution of DOS like [[https://en.wikipedia.org/wiki/MS-DOS][MS-DOS]] or [[https://www.freedos.org/][FreeDOS]]. Within DOS +you can then use either Microsoft *QBasic* or Microsoft +*QuickBasic*. QBasic is already included in Microsoft DOS by +default. QuickBasic is more capable but must be obtained separately. + +- QB64 :: [[https://qb64.com][QB64]] is mostly compatible with Microsoft BASIC variants and + can be used too. + +- [[id:97ea6094-ade6-4c7d-aea9-9874acf9dc86][DOSBox + MS BASIC]] :: Easy to install and good compatibility. + +*** DOSBox + MS BASIC +:PROPERTIES: +:ID: 97ea6094-ade6-4c7d-aea9-9874acf9dc86 +:END: + +Following tutorial focuses on using DOSBox with original Microsoft +QBasic or QuickBasic. + +DOSBox is trivial to install and BASIC programs do not need to be +copied to virtual drive or operating system to run them. Using +original BASIC binaries ensures good compatibility. + + +Here is suggested installation and usage procedure: + +1. Install DOSBox by running the following command in your terminal: + : sudo apt-get install dosbox + +2. Obtain and place a copy of QuickBasic *QB.EXE* executable binary + into directory */QB45/* within project root directory. + + Optionally obtain [[https://en.wikipedia.org/wiki/Volkov_Commander][Volkov Commander]] executable VC.COM and place it + under project root directory. Volkov Commander simplifies + filesystem navigation and running arbitrary BASIC program by + selecting it and pressing ENTER key. For this to work, BAS file + extension is mapped to BASIC executable within VC.EXT file (already + available in the project root directory). In case you are using + QBasic instead, feel free to fix VC.EXT to point to appropriate + BASIC executable. + +3. Optionally check and apply [[id:13c7d873-f1aa-4061-88ac-dc9e43c6303d][DOSBox usage tips]]. + +4. Execute script that is located in the root directory of the + repository: + : ./run_dosbox.sh + +5. Now project root directory appears as root directory of virtual + *C:* drive. You can navigate around and start programs. + + +Here is suggested project directory layout with QuickBasic and Volkov +Commander installed: +#+begin_example + ├── COPYING + ├── index.org + ├── QB45 + │   ├── QB.EXE + │   └── QB.INI + ├── run_dosbox.sh + ├── (... other repository files and directories) + ├── VC.COM + ├── VC.EXT + └── VC.INI +#+end_example + +*** DOSBox usage tips +:PROPERTIES: +:ID: 13c7d873-f1aa-4061-88ac-dc9e43c6303d +:END: +**** How to change keyboard layout to Dvorak + +In case you want to use Dvorak keyboard layout and DOSBox fails to +auto-apply it, here is how you can set it manually: + +1. Edit file: + : ~/.dosbox/dosbox-.conf + +2. Disable scancodes usage: + : usescancodes=false + +3. Save the changes and restart DOSBox for the configuration to take + effect. + +**** Increase window size + +If you have big high-resolution screen, by default DOSBox window could +appear small. To make it bigger: + +1. Edit file: + : ~/.dosbox/dosbox-.conf + +2. Set windowresolution to either of those values: + : windowresolution=1366x768 + : windowresolution=1600x900 + +3. Save the changes and restart DOSBox for the configuration to take + effect. + +4. If scaling did not work, set output to opengl: + : output=opengl + +**** Exit mouse capture + +DOSBox detects when a game uses mouse control. When you click on the +screen, it should get locked (confined to the DOSBox window) and work. + +To release mouse lock, press: +: CTRL-F10 +**** Increase CPU speed for better animation smoothness + +Many applications benefit from as fast CPU as possible. Games and +animations that require limited frames per second always have their +own CPU independent mechanisms for limiting animation speed. So +setting CPU as fast as possible within emulator is beneficial. + +This is how I accomplished it in DOSBox: + + +1. Edit file: + : ~/.dosbox/dosbox-.conf + +2. Edit [cpu] section accordingly: + #+begin_src conf + [cpu] + core=normal + cputype=auto + cycles=fixed 100000 + #+end_src + +3. Save the changes and restart DOSBox for the configuration to take + effect. +** See also + +- Programs found in the March 1975 3rd printing of David Ahl's 101 + BASIC Computer Games, published by Digital Equipment Corp: + https://github.com/maurymarkowitz/101-BASIC-Computer-Games + +- QB64 is a modern extended BASIC programming language that retains + QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for + Windows, Linux, and macOS: https://qb64.com/ diff --git a/run_dosbox.sh b/run_dosbox.sh new file mode 100755 index 0000000..12c0b34 --- /dev/null +++ b/run_dosbox.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Run DOSBox with the current directory mounted as C: drive and switch to C: drive on startup. +dosbox -c "MOUNT C: $(pwd)" -c "C:"