Better documentation for 4D engine, Alarms and mouse driver.
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Wed, 30 Jul 2025 05:52:09 +0000 (08:52 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Wed, 30 Jul 2025 05:52:09 +0000 (08:52 +0300)
25 files changed:
2D GFX/Fractals/index.html
2D GFX/Spirals/index.html
2D GFX/Textures/index.html
3D GFX/3D Synthezier/doc/index.html
3D GFX/Miscellaneous/index.html
3D GFX/Space/index.html
Math/Plotting/index.html
Math/Simulation/index.html
Math/Truth table/index.html
Miscellaneous/4D engine.bas [new file with mode: 0755]
Miscellaneous/4D engine.png [new file with mode: 0644]
Miscellaneous/4D engine/index.html [deleted file]
Miscellaneous/4D engine/qeng.bas [deleted file]
Miscellaneous/4D engine/sshot.png [deleted file]
Miscellaneous/Alarm 1.bas [new file with mode: 0755]
Miscellaneous/Alarm 1.mp3 [new file with mode: 0644]
Miscellaneous/Alarm 2.bas [new file with mode: 0755]
Miscellaneous/Alarm 2.mp3 [new file with mode: 0644]
Miscellaneous/Mouse driver/index.html
Miscellaneous/Mouse driver/index.org
Miscellaneous/alarm 1.bas [deleted file]
Miscellaneous/alarm 1.mp3 [deleted file]
Miscellaneous/alarm 2.bas [deleted file]
Miscellaneous/alarm 2.mp3 [deleted file]
index.org

index 8b2fd16..f435ae9 100644 (file)
@@ -3,7 +3,7 @@
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-<!-- 2025-07-29 ti 17:31 -->
+<!-- 2025-07-30 ke 01:26 -->
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 <title>Fractals</title>
 <h2>Table of Contents</h2>
 <div id="text-table-of-contents" role="doc-toc">
 <ul>
-<li><a href="#org9a22df5">1. Fractal circles</a></li>
-<li><a href="#org5bb3cc4">2. Fractal circles animated</a></li>
-<li><a href="#org9dd12bc">3. Fractal of squares</a></li>
-<li><a href="#org14bf47b">4. Fractal of squares animated</a></li>
-<li><a href="#org1af537c">5. Fractal of trees</a></li>
+<li><a href="#org2fe1e79">1. Fractal circles</a></li>
+<li><a href="#org73755e2">2. Fractal circles animated</a></li>
+<li><a href="#orgf1a7d5c">3. Fractal of squares</a></li>
+<li><a href="#org621eb5a">4. Fractal of squares animated</a></li>
+<li><a href="#org5ccd9b9">5. Fractal of trees</a></li>
 </ul>
 </div>
 </div>
 </style>
 
 
-<div id="outline-container-org9a22df5" class="outline-2">
-<h2 id="org9a22df5"><span class="section-number-2">1.</span> Fractal circles</h2>
+<div id="outline-container-org2fe1e79" class="outline-2">
+<h2 id="org2fe1e79"><span class="section-number-2">1.</span> Fractal circles</h2>
 <div class="outline-text-2" id="text-1">
 <p>
 This QBasic program generates a visually captivating spiral fractal
@@ -247,7 +247,7 @@ geometry, recursive programming, and graphical design.
 </p>
 
 
-<div id="org82a86b5" class="figure">
+<div id="org8f2cc6f" class="figure">
 <p><a href="fractal circles.bas" class="responsive-img"><img src="fractal%20circles.png" alt="fractal%20circles.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -266,8 +266,8 @@ indefinitely.</dd>
 </div>
 </div>
 
-<div id="outline-container-org5bb3cc4" class="outline-2">
-<h2 id="org5bb3cc4"><span class="section-number-2">2.</span> Fractal circles animated</h2>
+<div id="outline-container-org73755e2" class="outline-2">
+<h2 id="org73755e2"><span class="section-number-2">2.</span> Fractal circles animated</h2>
 <div class="outline-text-2" id="text-2">
 <p>
 This QBasic program creates an animated fractal composed of circles,
@@ -287,29 +287,29 @@ system to control the animation's progression.
 </div>
 </div>
 
-<div id="outline-container-org9dd12bc" class="outline-2">
-<h2 id="org9dd12bc"><span class="section-number-2">3.</span> Fractal of squares</h2>
+<div id="outline-container-orgf1a7d5c" class="outline-2">
+<h2 id="orgf1a7d5c"><span class="section-number-2">3.</span> Fractal of squares</h2>
 <div class="outline-text-2" id="text-3">
 <p>
 This QBasic program generates and displays a fractal pattern composed of squares.
 </p>
 
 
-<div id="org937611e" class="figure">
+<div id="orgc270021" class="figure">
 <p><a href="fractal squares.bas" class="responsive-img"><img src="fractal%20squares,%201.png" alt="fractal%20squares,%201.png" class="responsive-img" /></a>
 </p>
 </div>
 
 
-<div id="org81311df" class="figure">
+<div id="org72f21bc" class="figure">
 <p><a href="fractal squares.bas" class="responsive-img"><img src="fractal%20squares,%202.png" alt="fractal%20squares,%202.png" class="responsive-img" /></a>
 </p>
 </div>
 </div>
 </div>
 
-<div id="outline-container-org14bf47b" class="outline-2">
-<h2 id="org14bf47b"><span class="section-number-2">4.</span> Fractal of squares animated</h2>
+<div id="outline-container-org621eb5a" class="outline-2">
+<h2 id="org621eb5a"><span class="section-number-2">4.</span> Fractal of squares animated</h2>
 <div class="outline-text-2" id="text-4">
 <p>
 This QBasic program generates an animated fractal pattern composed of
@@ -331,8 +331,8 @@ resulting in a dynamic and ever-changing geometric pattern.
 </div>
 </div>
 
-<div id="outline-container-org1af537c" class="outline-2">
-<h2 id="org1af537c"><span class="section-number-2">5.</span> Fractal of trees</h2>
+<div id="outline-container-org5ccd9b9" class="outline-2">
+<h2 id="org5ccd9b9"><span class="section-number-2">5.</span> Fractal of trees</h2>
 <div class="outline-text-2" id="text-5">
 <p>
 QBasic program that generates a visually appealing fractal tree
@@ -355,7 +355,7 @@ resembles a tree, with branches that grow and change over time.
 </div>
 </div>
 <div id="postamble" class="status">
-<p class="date">Created: 2025-07-29 ti 17:31</p>
+<p class="date">Created: 2025-07-30 ke 01:26</p>
 <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
 </div>
 </body>
index 5c2726b..1fe8864 100644 (file)
@@ -3,7 +3,7 @@
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-<!-- 2025-07-29 ti 17:31 -->
+<!-- 2025-07-30 ke 01:26 -->
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 <title>Spiral series</title>
 <h2>Table of Contents</h2>
 <div id="text-table-of-contents" role="doc-toc">
 <ul>
-<li><a href="#orge363268">1. Spiral with increasing density</a></li>
-<li><a href="#org459a79e">2. Spiral with varying height</a></li>
-<li><a href="#orgbf688a5">3. Shaded spiral</a></li>
-<li><a href="#orga385a99">4. Sphere forming spiral</a></li>
-<li><a href="#orgce56a9d">5. Textured spherical spiral</a></li>
-<li><a href="#orgf704e61">6. Textured and shaded spherical spiral</a></li>
+<li><a href="#org54f8ae1">1. Spiral with increasing density</a></li>
+<li><a href="#org6118e5d">2. Spiral with varying height</a></li>
+<li><a href="#org1d70e03">3. Shaded spiral</a></li>
+<li><a href="#org389ad3f">4. Sphere forming spiral</a></li>
+<li><a href="#orgf6c6e9b">5. Textured spherical spiral</a></li>
+<li><a href="#orgb58c1d6">6. Textured and shaded spherical spiral</a></li>
 </ul>
 </div>
 </div>
   }
 </style>
 
-<div id="outline-container-orge363268" class="outline-2">
-<h2 id="orge363268"><span class="section-number-2">1.</span> Spiral with increasing density</h2>
+<div id="outline-container-org54f8ae1" class="outline-2">
+<h2 id="org54f8ae1"><span class="section-number-2">1.</span> Spiral with increasing density</h2>
 <div class="outline-text-2" id="text-1">
 
-<div id="orgbe97d40" class="figure">
+<div id="org0585709" class="figure">
 <p><img src="spiral.png" alt="spiral.png" class="responsive-img" />
 </p>
 </div>
@@ -320,11 +320,11 @@ userInput$ = <span style="color: #88aaee;">INPUT$</span>(1)
 </div>
 </div>
 
-<div id="outline-container-org459a79e" class="outline-2">
-<h2 id="org459a79e"><span class="section-number-2">2.</span> Spiral with varying height</h2>
+<div id="outline-container-org6118e5d" class="outline-2">
+<h2 id="org6118e5d"><span class="section-number-2">2.</span> Spiral with varying height</h2>
 <div class="outline-text-2" id="text-2">
 
-<div id="org4709cc8" class="figure">
+<div id="org3dd6e24" class="figure">
 <p><img src="spiral, 2.png" alt="spiral, 2.png" class="responsive-img" />
 </p>
 </div>
@@ -391,11 +391,11 @@ a$ = <span style="color: #88aaee;">INPUT$</span>(1)
 </div>
 </div>
 
-<div id="outline-container-orgbf688a5" class="outline-2">
-<h2 id="orgbf688a5"><span class="section-number-2">3.</span> Shaded spiral</h2>
+<div id="outline-container-org1d70e03" class="outline-2">
+<h2 id="org1d70e03"><span class="section-number-2">3.</span> Shaded spiral</h2>
 <div class="outline-text-2" id="text-3">
 
-<div id="orgb08edde" class="figure">
+<div id="orgee00171" class="figure">
 <p><img src="spiral, 3.png" alt="spiral, 3.png" class="responsive-img" />
 </p>
 </div>
@@ -497,8 +497,8 @@ a$ = <span style="color: #88aaee;">INPUT$</span>(1)
 </div>
 </div>
 
-<div id="outline-container-orga385a99" class="outline-2">
-<h2 id="orga385a99"><span class="section-number-2">4.</span> Sphere forming spiral</h2>
+<div id="outline-container-org389ad3f" class="outline-2">
+<h2 id="org389ad3f"><span class="section-number-2">4.</span> Sphere forming spiral</h2>
 <div class="outline-text-2" id="text-4">
 <p>
 Similar to previous spiral, Line segments are connected between the
@@ -507,7 +507,7 @@ multiple linked spherical shapes. Initially point cloud in shown:
 </p>
 
 
-<div id="orgf5ce006" class="figure">
+<div id="orgbe7e9cf" class="figure">
 <p><img src="spiral, 4, 1.png" alt="spiral, 4, 1.png" class="responsive-img" />
 </p>
 </div>
@@ -517,7 +517,7 @@ In the next step, points are connected using lines:
 </p>
 
 
-<div id="org916d20d" class="figure">
+<div id="org4f104c6" class="figure">
 <p><img src="spiral, 4, 2.png" alt="spiral, 4, 2.png" class="responsive-img" />
 </p>
 </div>
@@ -622,11 +622,11 @@ a$ = <span style="color: #88aaee;">INPUT$</span>(1)
 </div>
 </div>
 
-<div id="outline-container-orgce56a9d" class="outline-2">
-<h2 id="orgce56a9d"><span class="section-number-2">5.</span> Textured spherical spiral</h2>
+<div id="outline-container-orgf6c6e9b" class="outline-2">
+<h2 id="orgf6c6e9b"><span class="section-number-2">5.</span> Textured spherical spiral</h2>
 <div class="outline-text-2" id="text-5">
 
-<div id="org5f8f0f7" class="figure">
+<div id="orgb8c2517" class="figure">
 <p><img src="spiral, 5.png" alt="spiral, 5.png" class="responsive-img" />
 </p>
 </div>
@@ -749,11 +749,11 @@ a$ = <span style="color: #88aaee;">INPUT$</span>(1)
 </div>
 </div>
 
-<div id="outline-container-orgf704e61" class="outline-2">
-<h2 id="orgf704e61"><span class="section-number-2">6.</span> Textured and shaded spherical spiral</h2>
+<div id="outline-container-orgb58c1d6" class="outline-2">
+<h2 id="orgb58c1d6"><span class="section-number-2">6.</span> Textured and shaded spherical spiral</h2>
 <div class="outline-text-2" id="text-6">
 
-<div id="orga301ca3" class="figure">
+<div id="org2bbe148" class="figure">
 <p><img src="spiral, 6.png" alt="spiral, 6.png" class="responsive-img" />
 </p>
 </div>
@@ -937,7 +937,7 @@ yStep2 = (oppositePointY2 - oppositePointY1) / stepCount
 </div>
 </div>
 <div id="postamble" class="status">
-<p class="date">Created: 2025-07-29 ti 17:31</p>
+<p class="date">Created: 2025-07-30 ke 01:26</p>
 <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
 </div>
 </body>
index fff135e..5673da2 100644 (file)
@@ -3,7 +3,7 @@
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-<!-- 2025-07-29 ti 17:31 -->
+<!-- 2025-07-30 ke 01:27 -->
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 <title>Algorithmic textures</title>
 <h2>Table of Contents</h2>
 <div id="text-table-of-contents" role="doc-toc">
 <ul>
-<li><a href="#org9e917f7">1. Circular waves</a></li>
-<li><a href="#org193d767">2. Diamond square clouds</a></li>
-<li><a href="#org2b12774">3. Old paper</a></li>
-<li><a href="#org9c0e3c1">4. Wood</a></li>
-<li><a href="#orgb66b8b0">5. Yellow flame</a></li>
+<li><a href="#org0c3cbb8">1. Circular waves</a></li>
+<li><a href="#org1794e9e">2. Diamond square clouds</a></li>
+<li><a href="#org678fcb5">3. Old paper</a></li>
+<li><a href="#org8bb43c5">4. Wood</a></li>
+<li><a href="#org4dd8abb">5. Yellow flame</a></li>
 </ul>
 </div>
 </div>
   }
 </style>
 
-<div id="outline-container-org9e917f7" class="outline-2">
-<h2 id="org9e917f7"><span class="section-number-2">1.</span> Circular waves</h2>
+<div id="outline-container-org0c3cbb8" class="outline-2">
+<h2 id="org0c3cbb8"><span class="section-number-2">1.</span> Circular waves</h2>
 <div class="outline-text-2" id="text-1">
 <p>
 This QBasic program creates visually captivating circular wave
@@ -313,8 +313,8 @@ algorithms can produce intricate and visually appealing results.
 </div>
 </div>
 
-<div id="outline-container-org193d767" class="outline-2">
-<h2 id="org193d767"><span class="section-number-2">2.</span> Diamond square clouds</h2>
+<div id="outline-container-org1794e9e" class="outline-2">
+<h2 id="org1794e9e"><span class="section-number-2">2.</span> Diamond square clouds</h2>
 <div class="outline-text-2" id="text-2">
 <p>
 This QBasic program demonstrates the Diamond-Square algorithm, a
@@ -429,8 +429,8 @@ WAITa$ = <span style="color: #88aaee;">INPUT$</span>(1)
 </div>
 </div>
 
-<div id="outline-container-org2b12774" class="outline-2">
-<h2 id="org2b12774"><span class="section-number-2">3.</span> Old paper</h2>
+<div id="outline-container-org678fcb5" class="outline-2">
+<h2 id="org678fcb5"><span class="section-number-2">3.</span> Old paper</h2>
 <div class="outline-text-2" id="text-3">
 <p>
 This QBasic program generates a procedural texture that simulates the
@@ -527,8 +527,8 @@ inputKey$ = <span style="color: #88aaee;">INPUT$</span>(1)
 </div>
 </div>
 
-<div id="outline-container-org9c0e3c1" class="outline-2">
-<h2 id="org9c0e3c1"><span class="section-number-2">4.</span> Wood</h2>
+<div id="outline-container-org8bb43c5" class="outline-2">
+<h2 id="org8bb43c5"><span class="section-number-2">4.</span> Wood</h2>
 <div class="outline-text-2" id="text-4">
 <p>
 This QBasic program creates a visually appealing simulation of a wood
@@ -622,8 +622,8 @@ exitKey$ = <span style="color: #88aaee;">INPUT$</span>(1)
 </div>
 </div>
 
-<div id="outline-container-orgb66b8b0" class="outline-2">
-<h2 id="orgb66b8b0"><span class="section-number-2">5.</span> Yellow flame</h2>
+<div id="outline-container-org4dd8abb" class="outline-2">
+<h2 id="org4dd8abb"><span class="section-number-2">5.</span> Yellow flame</h2>
 <div class="outline-text-2" id="text-5">
 <p>
 "Yellow Flame" is a visually captivating program written in QBasic
@@ -702,7 +702,7 @@ userInput$ = <span style="color: #88aaee;">INPUT$</span>(1)
 </div>
 </div>
 <div id="postamble" class="status">
-<p class="date">Created: 2025-07-29 ti 17:31</p>
+<p class="date">Created: 2025-07-30 ke 01:27</p>
 <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
 </div>
 </body>
index c1b6b97..3c57508 100644 (file)
@@ -3,7 +3,7 @@
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-<!-- 2025-07-29 ti 17:32 -->
+<!-- 2025-07-30 ke 01:28 -->
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 <title>3D Synthezier</title>
@@ -1103,39 +1103,39 @@ hsAddReviewPanels();
 <h2>Table of Contents</h2>
 <div id="text-table-of-contents" role="doc-toc">
 <ul>
-<li><a href="#orgf1b7289">1. Operating principle</a>
+<li><a href="#org78807ca">1. Operating principle</a>
 <ul>
-<li><a href="#org95f664d">1.1. Rectangular city</a></li>
-<li><a href="#orgd49910d">1.2. Hexagonal city</a></li>
+<li><a href="#org46eca90">1.1. Rectangular city</a></li>
+<li><a href="#org94c04e0">1.2. Hexagonal city</a></li>
 </ul>
 </li>
-<li><a href="#org3d452d2">2. Scene description language</a>
+<li><a href="#org48195f6">2. Scene description language</a>
 <ul>
-<li><a href="#org8c35439">2.1. here</a></li>
-<li><a href="#orgd4a951e">2.2. p</a></li>
-<li><a href="#org9ff2be1">2.3. f</a></li>
-<li><a href="#org60a4157">2.4. warn</a></li>
-<li><a href="#org7f6109e">2.5. end</a></li>
-<li><a href="#org715d682">2.6. mtl</a></li>
-<li><a href="#orga7c6609">2.7. mtlrnd</a></li>
-<li><a href="#org790cfca">2.8. obj</a></li>
-<li><a href="#org870a26b">2.9. rnd</a></li>
-<li><a href="#org55b9fbe">2.10. #</a></li>
-<li><a href="#orgead875d">2.11. out</a></li>
-<li><a href="#org9634c81">2.12. set</a></li>
-<li><a href="#orge74d322">2.13. variables usage</a></li>
-<li><a href="#orgba12fc1">2.14. cmp</a></li>
-<li><a href="#org648d4ad">2.15. ?</a></li>
-<li><a href="#orgdcb9efa">2.16. dum</a></li>
+<li><a href="#orgb7682d2">2.1. here</a></li>
+<li><a href="#org2c14946">2.2. p</a></li>
+<li><a href="#org565bbc0">2.3. f</a></li>
+<li><a href="#orgaad889e">2.4. warn</a></li>
+<li><a href="#orgdc1508d">2.5. end</a></li>
+<li><a href="#org38c48ba">2.6. mtl</a></li>
+<li><a href="#orgc83b2cb">2.7. mtlrnd</a></li>
+<li><a href="#orgf0b21fa">2.8. obj</a></li>
+<li><a href="#org14ccff1">2.9. rnd</a></li>
+<li><a href="#org2e86e29">2.10. #</a></li>
+<li><a href="#org56323b2">2.11. out</a></li>
+<li><a href="#org5fbc50a">2.12. set</a></li>
+<li><a href="#org1ed5ed3">2.13. variables usage</a></li>
+<li><a href="#org69e43cc">2.14. cmp</a></li>
+<li><a href="#org9461186">2.15. ?</a></li>
+<li><a href="#org1182375">2.16. dum</a></li>
 </ul>
 </li>
-<li><a href="#org85d203b">3. Installation</a>
+<li><a href="#orgd87df4f">3. Installation</a>
 <ul>
-<li><a href="#org2801213">3.1. System requirements</a></li>
-<li><a href="#org9d2c537">3.2. Directory layout</a></li>
+<li><a href="#org9830b9c">3.1. System requirements</a></li>
+<li><a href="#orgb652d95">3.2. Directory layout</a></li>
 </ul>
 </li>
-<li><a href="#org944e52f">4. Usage</a></li>
+<li><a href="#org66f534e">4. Usage</a></li>
 </ul>
 </div>
 </div>
@@ -1157,8 +1157,8 @@ hsAddReviewPanels();
 </style>
 
 
-<div id="outline-container-orgf1b7289" class="outline-2">
-<h2 id="orgf1b7289"><span class="section-number-2">1.</span> Operating principle</h2>
+<div id="outline-container-org78807ca" class="outline-2">
+<h2 id="org78807ca"><span class="section-number-2">1.</span> Operating principle</h2>
 <div class="outline-text-2" id="text-1">
 <p>
 Parses scene definition language and creates 3D world based on
@@ -1221,60 +1221,60 @@ They were produced by importing generated <a href="https://en.wikipedia.org/wiki
 </p>
 </div>
 
-<div id="outline-container-org95f664d" class="outline-3">
-<h3 id="org95f664d"><span class="section-number-3">1.1.</span> Rectangular city</h3>
+<div id="outline-container-org46eca90" class="outline-3">
+<h3 id="org46eca90"><span class="section-number-3">1.1.</span> Rectangular city</h3>
 <div class="outline-text-3" id="text-1-1">
 
-<div id="orgc4c8173" class="figure">
+<div id="org8745536" class="figure">
 <p><img src="rectangular city, 1.jpeg" alt="rectangular city, 1.jpeg" class="responsive-img" />
 </p>
 </div>
 
 
-<div id="orgefc3ad3" class="figure">
+<div id="org4ff5365" class="figure">
 <p><img src="rectangular city, 2.jpeg" alt="rectangular city, 2.jpeg" class="responsive-img" />
 </p>
 </div>
 
 
-<div id="orgadd710d" class="figure">
+<div id="org02ce698" class="figure">
 <p><img src="rectangular city, 3.jpeg" alt="rectangular city, 3.jpeg" class="responsive-img" />
 </p>
 </div>
 </div>
 </div>
-<div id="outline-container-orgd49910d" class="outline-3">
-<h3 id="orgd49910d"><span class="section-number-3">1.2.</span> Hexagonal city</h3>
+<div id="outline-container-org94c04e0" class="outline-3">
+<h3 id="org94c04e0"><span class="section-number-3">1.2.</span> Hexagonal city</h3>
 <div class="outline-text-3" id="text-1-2">
 
-<div id="orgf0f333c" class="figure">
+<div id="org70ad015" class="figure">
 <p><img src="hexagonal city, 1.jpeg" alt="hexagonal city, 1.jpeg" class="responsive-img" />
 </p>
 </div>
 
 
-<div id="org1247089" class="figure">
+<div id="org2524773" class="figure">
 <p><img src="hexagonal city, 2.jpeg" alt="hexagonal city, 2.jpeg" class="responsive-img" />
 </p>
 </div>
 
 
-<div id="orge7092db" class="figure">
+<div id="orgb3dfdcf" class="figure">
 <p><img src="hexagonal city, 3.jpeg" alt="hexagonal city, 3.jpeg" class="responsive-img" />
 </p>
 </div>
 </div>
 </div>
 </div>
-<div id="outline-container-org3d452d2" class="outline-2">
-<h2 id="org3d452d2"><span class="section-number-2">2.</span> Scene description language</h2>
+<div id="outline-container-org48195f6" class="outline-2">
+<h2 id="org48195f6"><span class="section-number-2">2.</span> Scene description language</h2>
 <div class="outline-text-2" id="text-2">
 <p>
 See also examples.
 </p>
 </div>
-<div id="outline-container-org8c35439" class="outline-3">
-<h3 id="org8c35439"><span class="section-number-3">2.1.</span> here</h3>
+<div id="outline-container-orgb7682d2" class="outline-3">
+<h3 id="orgb7682d2"><span class="section-number-3">2.1.</span> here</h3>
 <div class="outline-text-3" id="text-2-1">
 <pre class="example">
 here
@@ -1285,8 +1285,8 @@ defines new segment
 </p>
 </div>
 </div>
-<div id="outline-container-orgd4a951e" class="outline-3">
-<h3 id="orgd4a951e"><span class="section-number-3">2.2.</span> p</h3>
+<div id="outline-container-org2c14946" class="outline-3">
+<h3 id="org2c14946"><span class="section-number-3">2.2.</span> p</h3>
 <div class="outline-text-3" id="text-2-2">
 <pre class="example">
 p  x y z
@@ -1297,8 +1297,8 @@ defines new point
 </p>
 </div>
 </div>
-<div id="outline-container-org9ff2be1" class="outline-3">
-<h3 id="org9ff2be1"><span class="section-number-3">2.3.</span> f</h3>
+<div id="outline-container-org565bbc0" class="outline-3">
+<h3 id="org565bbc0"><span class="section-number-3">2.3.</span> f</h3>
 <div class="outline-text-3" id="text-2-3">
 <pre class="example">
 f  p1 p2 p3 p4
@@ -1309,8 +1309,8 @@ defines new polygon,  p4  may be unused
 </p>
 </div>
 </div>
-<div id="outline-container-org60a4157" class="outline-3">
-<h3 id="org60a4157"><span class="section-number-3">2.4.</span> warn</h3>
+<div id="outline-container-orgaad889e" class="outline-3">
+<h3 id="orgaad889e"><span class="section-number-3">2.4.</span> warn</h3>
 <div class="outline-text-3" id="text-2-4">
 <pre class="example">
 warn  &lt;message&gt;
@@ -1321,8 +1321,8 @@ displays warning message, and wait for key
 </p>
 </div>
 </div>
-<div id="outline-container-org7f6109e" class="outline-3">
-<h3 id="org7f6109e"><span class="section-number-3">2.5.</span> end</h3>
+<div id="outline-container-orgdc1508d" class="outline-3">
+<h3 id="orgdc1508d"><span class="section-number-3">2.5.</span> end</h3>
 <div class="outline-text-3" id="text-2-5">
 <pre class="example">
 end
@@ -1333,8 +1333,8 @@ terminates parser
 </p>
 </div>
 </div>
-<div id="outline-container-org715d682" class="outline-3">
-<h3 id="org715d682"><span class="section-number-3">2.6.</span> mtl</h3>
+<div id="outline-container-org38c48ba" class="outline-3">
+<h3 id="org38c48ba"><span class="section-number-3">2.6.</span> mtl</h3>
 <div class="outline-text-3" id="text-2-6">
 <pre class="example">
 mtl  material
@@ -1345,8 +1345,8 @@ selects material
 </p>
 </div>
 </div>
-<div id="outline-container-orga7c6609" class="outline-3">
-<h3 id="orga7c6609"><span class="section-number-3">2.7.</span> mtlrnd</h3>
+<div id="outline-container-orgc83b2cb" class="outline-3">
+<h3 id="orgc83b2cb"><span class="section-number-3">2.7.</span> mtlrnd</h3>
 <div class="outline-text-3" id="text-2-7">
 <pre class="example">
 mtlrnd  material ...
@@ -1357,8 +1357,8 @@ selects random material from list
 </p>
 </div>
 </div>
-<div id="outline-container-org790cfca" class="outline-3">
-<h3 id="org790cfca"><span class="section-number-3">2.8.</span> obj</h3>
+<div id="outline-container-orgf0b21fa" class="outline-3">
+<h3 id="orgf0b21fa"><span class="section-number-3">2.8.</span> obj</h3>
 <div class="outline-text-3" id="text-2-8">
 <pre class="example">
 obj  object xz45 xy20 x+3 y*2
@@ -1373,14 +1373,14 @@ directly from file, and not chached, to allow loading of greater than
 </p>
 
 
-<div id="org5a9f4f4" class="figure">
+<div id="org9a80874" class="figure">
 <p><img src="rotation.png" alt="rotation.png" />
 </p>
 </div>
 </div>
 </div>
-<div id="outline-container-org870a26b" class="outline-3">
-<h3 id="org870a26b"><span class="section-number-3">2.9.</span> rnd</h3>
+<div id="outline-container-org14ccff1" class="outline-3">
+<h3 id="org14ccff1"><span class="section-number-3">2.9.</span> rnd</h3>
 <div class="outline-text-3" id="text-2-9">
 <pre class="example">
 rnd  p^1^2^3 p^7^2^1
@@ -1391,8 +1391,8 @@ select random command to execute, ^ will be converted to spaces.
 </p>
 </div>
 </div>
-<div id="outline-container-org55b9fbe" class="outline-3">
-<h3 id="org55b9fbe"><span class="section-number-3">2.10.</span> #</h3>
+<div id="outline-container-org2e86e29" class="outline-3">
+<h3 id="org2e86e29"><span class="section-number-3">2.10.</span> #</h3>
 <div class="outline-text-3" id="text-2-10">
 <pre class="example">
 # whatever text
@@ -1403,8 +1403,8 @@ comment
 </p>
 </div>
 </div>
-<div id="outline-container-orgead875d" class="outline-3">
-<h3 id="orgead875d"><span class="section-number-3">2.11.</span> out</h3>
+<div id="outline-container-org56323b2" class="outline-3">
+<h3 id="org56323b2"><span class="section-number-3">2.11.</span> out</h3>
 <div class="outline-text-3" id="text-2-11">
 <pre class="example">
 out  file
@@ -1415,8 +1415,8 @@ specify output file name, must be first command
 </p>
 </div>
 </div>
-<div id="outline-container-org9634c81" class="outline-3">
-<h3 id="org9634c81"><span class="section-number-3">2.12.</span> set</h3>
+<div id="outline-container-org5fbc50a" class="outline-3">
+<h3 id="org5fbc50a"><span class="section-number-3">2.12.</span> set</h3>
 <div class="outline-text-3" id="text-2-12">
 <pre class="example">
 set  variable  contents
@@ -1428,8 +1428,8 @@ string. max variables is 100. first is 0.
 </p>
 </div>
 </div>
-<div id="outline-container-orge74d322" class="outline-3">
-<h3 id="orge74d322"><span class="section-number-3">2.13.</span> variables usage</h3>
+<div id="outline-container-org1ed5ed3" class="outline-3">
+<h3 id="org1ed5ed3"><span class="section-number-3">2.13.</span> variables usage</h3>
 <div class="outline-text-3" id="text-2-13">
 <pre class="example">
 anycommand %1 anything
@@ -1440,8 +1440,8 @@ inserts variable 1 contents info line
 </p>
 </div>
 </div>
-<div id="outline-container-orgba12fc1" class="outline-3">
-<h3 id="orgba12fc1"><span class="section-number-3">2.14.</span> cmp</h3>
+<div id="outline-container-org69e43cc" class="outline-3">
+<h3 id="org69e43cc"><span class="section-number-3">2.14.</span> cmp</h3>
 <div class="outline-text-3" id="text-2-14">
 <pre class="example">
 cmp  flag string1 string2
@@ -1452,8 +1452,8 @@ compares strings, and inserts TRUE to flag, if they are equal, else inserts FALS
 </p>
 </div>
 </div>
-<div id="outline-container-org648d4ad" class="outline-3">
-<h3 id="org648d4ad"><span class="section-number-3">2.15.</span> ?</h3>
+<div id="outline-container-org9461186" class="outline-3">
+<h3 id="org9461186"><span class="section-number-3">2.15.</span> ?</h3>
 <div class="outline-text-3" id="text-2-15">
 <pre class="example">
 ?flag anycommand
@@ -1468,8 +1468,8 @@ exapmle: ?3 obj car z*2 xy45
 </p>
 </div>
 </div>
-<div id="outline-container-orgdcb9efa" class="outline-3">
-<h3 id="orgdcb9efa"><span class="section-number-3">2.16.</span> dum</h3>
+<div id="outline-container-org1182375" class="outline-3">
+<h3 id="org1182375"><span class="section-number-3">2.16.</span> dum</h3>
 <div class="outline-text-3" id="text-2-16">
 <pre class="example">
 dum
@@ -1482,16 +1482,16 @@ dummy function, does notheing
 </div>
 </div>
 
-<div id="outline-container-org85d203b" class="outline-2">
-<h2 id="org85d203b"><span class="section-number-2">3.</span> Installation</h2>
+<div id="outline-container-orgd87df4f" class="outline-2">
+<h2 id="orgd87df4f"><span class="section-number-2">3.</span> Installation</h2>
 <div class="outline-text-2" id="text-3">
 <p>
 Edit <b>bin/3dparse.bas</b> file and update include path in there.
 </p>
 </div>
 
-<div id="outline-container-org2801213" class="outline-3">
-<h3 id="org2801213"><span class="section-number-3">3.1.</span> System requirements</h3>
+<div id="outline-container-org9830b9c" class="outline-3">
+<h3 id="org9830b9c"><span class="section-number-3">3.1.</span> System requirements</h3>
 <div class="outline-text-3" id="text-3-1">
 <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
 
@@ -1522,8 +1522,8 @@ Edit <b>bin/3dparse.bas</b> file and update include path in there.
 </div>
 </div>
 
-<div id="outline-container-org9d2c537" class="outline-3">
-<h3 id="org9d2c537"><span class="section-number-3">3.2.</span> Directory layout</h3>
+<div id="outline-container-orgb652d95" class="outline-3">
+<h3 id="orgb652d95"><span class="section-number-3">3.2.</span> Directory layout</h3>
 <div class="outline-text-3" id="text-3-2">
 <dl class="org-dl">
 <dt>bin</dt><dd><dl class="org-dl">
@@ -1540,8 +1540,8 @@ Edit <b>bin/3dparse.bas</b> file and update include path in there.
 </div>
 </div>
 
-<div id="outline-container-org944e52f" class="outline-2">
-<h2 id="org944e52f"><span class="section-number-2">4.</span> Usage</h2>
+<div id="outline-container-org66f534e" class="outline-2">
+<h2 id="org66f534e"><span class="section-number-2">4.</span> Usage</h2>
 <div class="outline-text-2" id="text-4">
 <p>
 Make sure you have QB binaries in your PATH.  Execute
@@ -1566,7 +1566,7 @@ Visualize scene with your favourite renderer.
 </div>
 </div>
 <div id="postamble" class="status">
-<p class="date">Created: 2025-07-29 ti 17:32</p>
+<p class="date">Created: 2025-07-30 ke 01:28</p>
 <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
 </div>
 </body>
index 7a61679..7b85e61 100644 (file)
@@ -3,7 +3,7 @@
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-<!-- 2025-07-29 ti 17:32 -->
+<!-- 2025-07-30 ke 01:28 -->
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 <title>Miscellaneous 3D graphics demos</title>
 <h2>Table of Contents</h2>
 <div id="text-table-of-contents" role="doc-toc">
 <ul>
-<li><a href="#orgaae5eaa">1. Rotating exclamation mark</a></li>
-<li><a href="#org7d41cb1">2. 3D bouncing ball</a></li>
-<li><a href="#orgad832ff">3. 3D text in a room</a></li>
-<li><a href="#orgf426f46">4. 3D bouncing cubes on grid floor</a></li>
-<li><a href="#org6ad1548">5. Matrix math for rotation in 3D space</a></li>
-<li><a href="#org5023bdf">6. Maze explorer</a></li>
-<li><a href="#org36e3fff">7. Tank animation</a></li>
-<li><a href="#orgd392132">8. Tiled room</a></li>
+<li><a href="#org25474e2">1. Rotating exclamation mark</a></li>
+<li><a href="#org2059fc3">2. 3D bouncing ball</a></li>
+<li><a href="#org610130b">3. 3D text in a room</a></li>
+<li><a href="#orgaad53b1">4. 3D bouncing cubes on grid floor</a></li>
+<li><a href="#org762cf9b">5. Matrix math for rotation in 3D space</a></li>
+<li><a href="#org3efb169">6. Maze explorer</a></li>
+<li><a href="#orgaef8001">7. Tank animation</a></li>
+<li><a href="#orga3b9efe">8. Tiled room</a></li>
 </ul>
 </div>
 </div>
   }
 </style>
 
-<div id="outline-container-orgaae5eaa" class="outline-2">
-<h2 id="orgaae5eaa"><span class="section-number-2">1.</span> Rotating exclamation mark</h2>
+<div id="outline-container-org25474e2" class="outline-2">
+<h2 id="org25474e2"><span class="section-number-2">1.</span> Rotating exclamation mark</h2>
 <div class="outline-text-2" id="text-1">
 <p>
 Wireframe 3D model of a rotating exclamation mark.
@@ -258,8 +258,8 @@ Wireframe 3D model of a rotating exclamation mark.
 </div>
 </div>
 
-<div id="outline-container-org7d41cb1" class="outline-2">
-<h2 id="org7d41cb1"><span class="section-number-2">2.</span> 3D bouncing ball</h2>
+<div id="outline-container-org2059fc3" class="outline-2">
+<h2 id="org2059fc3"><span class="section-number-2">2.</span> 3D bouncing ball</h2>
 <div class="outline-text-2" id="text-2">
 <p>
 This QBasic program creates a visually engaging 3D animation of a
@@ -280,8 +280,8 @@ of early computer graphics techniques.
 </div>
 </div>
 
-<div id="outline-container-orgad832ff" class="outline-2">
-<h2 id="orgad832ff"><span class="section-number-2">3.</span> 3D text in a room</h2>
+<div id="outline-container-org610130b" class="outline-2">
+<h2 id="org610130b"><span class="section-number-2">3.</span> 3D text in a room</h2>
 <div class="outline-text-2" id="text-3">
 <p>
 Wireframe 3D text hanging in a wireframe 3D room. User can look and
@@ -301,8 +301,8 @@ fly around in all directions.
 </div>
 </div>
 
-<div id="outline-container-orgf426f46" class="outline-2">
-<h2 id="orgf426f46"><span class="section-number-2">4.</span> 3D bouncing cubes on grid floor</h2>
+<div id="outline-container-orgaad53b1" class="outline-2">
+<h2 id="orgaad53b1"><span class="section-number-2">4.</span> 3D bouncing cubes on grid floor</h2>
 <div class="outline-text-2" id="text-4">
 <p>
 3D wireframe cubes bouncing on a grid floor, creating an immersive and
@@ -322,8 +322,8 @@ dynamic visual effect.
 </div>
 </div>
 
-<div id="outline-container-org6ad1548" class="outline-2">
-<h2 id="org6ad1548"><span class="section-number-2">5.</span> Matrix math for rotation in 3D space</h2>
+<div id="outline-container-org762cf9b" class="outline-2">
+<h2 id="org762cf9b"><span class="section-number-2">5.</span> Matrix math for rotation in 3D space</h2>
 <div class="outline-text-2" id="text-5">
 <p>
 Instead of combining simple 2D rotors, pixels in this 3D space are
@@ -343,8 +343,8 @@ rotated by using matrix multiplications.
 </div>
 </div>
 
-<div id="outline-container-org5023bdf" class="outline-2">
-<h2 id="org5023bdf"><span class="section-number-2">6.</span> Maze explorer</h2>
+<div id="outline-container-org3efb169" class="outline-2">
+<h2 id="org3efb169"><span class="section-number-2">6.</span> Maze explorer</h2>
 <div class="outline-text-2" id="text-6">
 <p>
 The Evolving 3D Maze Explorer is a QBasic program that generates and
@@ -355,7 +355,7 @@ changes as they navigate through it.
 </p>
 
 
-<div id="org5f19c62" class="figure">
+<div id="orgae27554" class="figure">
 <p><a href="Maze%20explorer.bas" class="responsive-img"><img src="Maze%20explorer.png" alt="Maze%20explorer.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -366,8 +366,8 @@ changes as they navigate through it.
 </div>
 </div>
 
-<div id="outline-container-org36e3fff" class="outline-2">
-<h2 id="org36e3fff"><span class="section-number-2">7.</span> Tank animation</h2>
+<div id="outline-container-orgaef8001" class="outline-2">
+<h2 id="orgaef8001"><span class="section-number-2">7.</span> Tank animation</h2>
 <div class="outline-text-2" id="text-7">
 <p>
 Animated tank driving through the bridge back and forward. User can
@@ -387,8 +387,8 @@ look and fly around in all directions.
 </div>
 </div>
 
-<div id="outline-container-orgd392132" class="outline-2">
-<h2 id="orgd392132"><span class="section-number-2">8.</span> Tiled room</h2>
+<div id="outline-container-orga3b9efe" class="outline-2">
+<h2 id="orga3b9efe"><span class="section-number-2">8.</span> Tiled room</h2>
 <div class="outline-text-2" id="text-8">
 <p>
 Room with some tiles on the wall and on the floor. User can freely fly
@@ -409,7 +409,7 @@ around.
 </div>
 </div>
 <div id="postamble" class="status">
-<p class="date">Created: 2025-07-29 ti 17:32</p>
+<p class="date">Created: 2025-07-30 ke 01:28</p>
 <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
 </div>
 </body>
index d3444ee..b4d79a4 100644 (file)
@@ -3,7 +3,7 @@
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-<!-- 2025-07-29 ti 17:32 -->
+<!-- 2025-07-30 ke 01:28 -->
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 <title>Space themed 3D graphics</title>
 <h2>Table of Contents</h2>
 <div id="text-table-of-contents" role="doc-toc">
 <ul>
-<li><a href="#org579e8fc">1. Galaxy explorer</a></li>
-<li><a href="#orgaa94078">2. Rocket simulator</a></li>
-<li><a href="#orgba65f6b">3. Stars</a></li>
-<li><a href="#org406c8b3">4. Universe explorer</a></li>
+<li><a href="#org30fd979">1. Galaxy explorer</a></li>
+<li><a href="#org88a2631">2. Rocket simulator</a></li>
+<li><a href="#org251d15f">3. Stars</a></li>
+<li><a href="#orge766e15">4. Universe explorer</a></li>
 </ul>
 </div>
 </div>
   }
 </style>
 
-<div id="outline-container-org579e8fc" class="outline-2">
-<h2 id="org579e8fc"><span class="section-number-2">1.</span> Galaxy explorer</h2>
+<div id="outline-container-org30fd979" class="outline-2">
+<h2 id="org30fd979"><span class="section-number-2">1.</span> Galaxy explorer</h2>
 <div class="outline-text-2" id="text-1">
 <p>
 This QBasic program renders a navigable 3D point cloud galaxy,
@@ -245,7 +245,7 @@ galaxy with stars distributed in a spiral pattern.
 </p>
 
 
-<div id="org63f0352" class="figure">
+<div id="org8075f21" class="figure">
 <p><a href="Galaxy%20explorer.bas" class="responsive-img"><img src="Galaxy%20explorer.png" alt="Galaxy%20explorer.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -256,8 +256,8 @@ galaxy with stars distributed in a spiral pattern.
 </div>
 </div>
 
-<div id="outline-container-orgaa94078" class="outline-2">
-<h2 id="orgaa94078"><span class="section-number-2">2.</span> Rocket simulator</h2>
+<div id="outline-container-org88a2631" class="outline-2">
+<h2 id="org88a2631"><span class="section-number-2">2.</span> Rocket simulator</h2>
 <div class="outline-text-2" id="text-2">
 <p>
 QBasic program that simulates the takeoff and flight of a rocket from
@@ -279,8 +279,8 @@ observe the rocket's trajectory from various angles.
 </div>
 </div>
 
-<div id="outline-container-orgba65f6b" class="outline-2">
-<h2 id="orgba65f6b"><span class="section-number-2">3.</span> Stars</h2>
+<div id="outline-container-org251d15f" class="outline-2">
+<h2 id="org251d15f"><span class="section-number-2">3.</span> Stars</h2>
 <div class="outline-text-2" id="text-3">
 <p>
 The 3D Starfield Simulation is a QBasic program that creates a
@@ -320,8 +320,8 @@ based on its distance, with closer stars appearing brighter.</dd>
 </div>
 </div>
 
-<div id="outline-container-org406c8b3" class="outline-2">
-<h2 id="org406c8b3"><span class="section-number-2">4.</span> Universe explorer</h2>
+<div id="outline-container-orge766e15" class="outline-2">
+<h2 id="orge766e15"><span class="section-number-2">4.</span> Universe explorer</h2>
 <div class="outline-text-2" id="text-4">
 <p>
 This QBasic program that simulates a navigable 3D universe. Users can
@@ -358,19 +358,19 @@ limiting the number of rendered objects based on distance.</dd>
 </dl>
 
 
-<div id="org4d67ee0" class="figure">
+<div id="org1d03aa9" class="figure">
 <p><a href="Universe%20explorer/Universe%20explorer.bas" class="responsive-img"><img src="Universe%20explorer/1.png" alt="1.png" class="responsive-img" /></a>
 </p>
 </div>
 
 
-<div id="org5ca4cf4" class="figure">
+<div id="orgfd4d2e7" class="figure">
 <p><a href="Universe%20explorer/Universe%20explorer.bas" class="responsive-img"><img src="Universe%20explorer/2.png" alt="2.png" class="responsive-img" /></a>
 </p>
 </div>
 
 
-<div id="orga48a349" class="figure">
+<div id="org5e18244" class="figure">
 <p><a href="Universe%20explorer/Universe%20explorer.bas" class="responsive-img"><img src="Universe%20explorer/3.png" alt="3.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -382,7 +382,7 @@ limiting the number of rendered objects based on distance.</dd>
 </div>
 </div>
 <div id="postamble" class="status">
-<p class="date">Created: 2025-07-29 ti 17:32</p>
+<p class="date">Created: 2025-07-30 ke 01:28</p>
 <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
 </div>
 </body>
index b4d8be5..13be060 100644 (file)
@@ -3,7 +3,7 @@
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-<!-- 2025-07-29 ti 17:33 -->
+<!-- 2025-07-30 ke 01:28 -->
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 <title>Plotting</title>
 <h2>Table of Contents</h2>
 <div id="text-table-of-contents" role="doc-toc">
 <ul>
-<li><a href="#org2502cf9">1. 2D graph</a></li>
-<li><a href="#org6a05e6a">2. 3D graph</a></li>
-<li><a href="#org1c92b68">3. Deriviative calculator</a></li>
-<li><a href="#orgdfab383">4. Sine and cosine table</a></li>
+<li><a href="#org65b8689">1. 2D graph</a></li>
+<li><a href="#org06c1f4f">2. 3D graph</a></li>
+<li><a href="#org6408b27">3. Deriviative calculator</a></li>
+<li><a href="#org0cf4d12">4. Sine and cosine table</a></li>
 </ul>
 </div>
 </div>
   }
 </style>
 
-<div id="outline-container-org2502cf9" class="outline-2">
-<h2 id="org2502cf9"><span class="section-number-2">1.</span> 2D graph</h2>
+<div id="outline-container-org65b8689" class="outline-2">
+<h2 id="org65b8689"><span class="section-number-2">1.</span> 2D graph</h2>
 <div class="outline-text-2" id="text-1">
 <p>
 The 2D Graph Plotter is a simple yet effective program written in
@@ -251,7 +251,7 @@ based on a user-defined mathematical function.
 </p>
 
 
-<div id="org176949c" class="figure">
+<div id="orgee145ab" class="figure">
 <p><a href="2D%20graph%20plot.bas" class="responsive-img"><img src="2D%20graph%20plot.png" alt="2D%20graph%20plot.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -262,8 +262,8 @@ based on a user-defined mathematical function.
 </div>
 </div>
 
-<div id="outline-container-org6a05e6a" class="outline-2">
-<h2 id="org6a05e6a"><span class="section-number-2">2.</span> 3D graph</h2>
+<div id="outline-container-org06c1f4f" class="outline-2">
+<h2 id="org06c1f4f"><span class="section-number-2">2.</span> 3D graph</h2>
 <div class="outline-text-2" id="text-2">
 <p>
 The 3D Heightmap Explorer is a QBasic program designed to visualize
@@ -299,7 +299,7 @@ grid.
 </p>
 
 
-<div id="org02ba301" class="figure">
+<div id="org644fa95" class="figure">
 <p><a href="3D%20graph.bas" class="responsive-img"><img src="3D%20graph.png" alt="3D%20graph.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -310,8 +310,8 @@ grid.
 </div>
 </div>
 
-<div id="outline-container-org1c92b68" class="outline-2">
-<h2 id="org1c92b68"><span class="section-number-2">3.</span> Deriviative calculator</h2>
+<div id="outline-container-org6408b27" class="outline-2">
+<h2 id="org6408b27"><span class="section-number-2">3.</span> Deriviative calculator</h2>
 <div class="outline-text-2" id="text-3">
 <p>
 This QBasic program is designed to compute and plot an arbitrary
@@ -324,7 +324,7 @@ visualized.
 </p>
 
 
-<div id="org306f9da" class="figure">
+<div id="org1bcfc49" class="figure">
 <p><a href="Deriviative%20calculator.bas" class="responsive-img"><img src="Deriviative%20calculator.png" alt="Deriviative%20calculator.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -335,8 +335,8 @@ visualized.
 </div>
 </div>
 
-<div id="outline-container-orgdfab383" class="outline-2">
-<h2 id="orgdfab383"><span class="section-number-2">4.</span> Sine and cosine table</h2>
+<div id="outline-container-org0cf4d12" class="outline-2">
+<h2 id="org0cf4d12"><span class="section-number-2">4.</span> Sine and cosine table</h2>
 <div class="outline-text-2" id="text-4">
 <p>
 The SIN &amp; COS Table Generator is a QBasic program designed to visually
@@ -346,7 +346,7 @@ visual representation of these fundamental trigonometric functions.
 </p>
 
 
-<div id="orgbd22404" class="figure">
+<div id="org79d6d5f" class="figure">
 <p><a href="Sine%20and%20cosine%20table.bas" class="responsive-img"><img src="Sine%20and%20cosine%20table.png" alt="Sine%20and%20cosine%20table.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -358,7 +358,7 @@ visual representation of these fundamental trigonometric functions.
 </div>
 </div>
 <div id="postamble" class="status">
-<p class="date">Created: 2025-07-29 ti 17:33</p>
+<p class="date">Created: 2025-07-30 ke 01:28</p>
 <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
 </div>
 </body>
index 46fbb93..9bf6f7a 100644 (file)
@@ -3,7 +3,7 @@
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-<!-- 2025-07-29 ti 17:33 -->
+<!-- 2025-07-30 ke 01:29 -->
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 <title>Simulation</title>
 <h2>Table of Contents</h2>
 <div id="text-table-of-contents" role="doc-toc">
 <ul>
-<li><a href="#org9670ce6">1. Explosion simulator</a></li>
-<li><a href="#orgf0fb10c">2. Gravity in 2D</a></li>
-<li><a href="#org5e4286b">3. Gravity in 3D</a></li>
-<li><a href="#org6c79c4d">4. Interference</a></li>
-<li><a href="#org1eb260d">5. Interferogram</a></li>
-<li><a href="#org4f22fbb">6. Surface tension</a></li>
-<li><a href="#orgce7433b">7. Wave 1</a></li>
-<li><a href="#org31a7a22">8. Wave 2</a></li>
+<li><a href="#orgc0dba4b">1. Explosion simulator</a></li>
+<li><a href="#org3ead4ff">2. Gravity in 2D</a></li>
+<li><a href="#org8e097c6">3. Gravity in 3D</a></li>
+<li><a href="#orgd16724c">4. Interference</a></li>
+<li><a href="#org313d23c">5. Interferogram</a></li>
+<li><a href="#org0fd9b44">6. Surface tension</a></li>
+<li><a href="#org1e3088a">7. Wave 1</a></li>
+<li><a href="#orgd5c33be">8. Wave 2</a></li>
 </ul>
 </div>
 </div>
   }
 </style>
 
-<div id="outline-container-org9670ce6" class="outline-2">
-<h2 id="org9670ce6"><span class="section-number-2">1.</span> Explosion simulator</h2>
+<div id="outline-container-orgc0dba4b" class="outline-2">
+<h2 id="orgc0dba4b"><span class="section-number-2">1.</span> Explosion simulator</h2>
 <div class="outline-text-2" id="text-1">
 <p>
 This QBasic program simulates the propagation of shock waves in a gas
@@ -265,7 +265,7 @@ conditions by setting velocities to zero at wall boundaries.
 </p>
 
 
-<div id="orgef649ac" class="figure">
+<div id="org48d720d" class="figure">
 <p><a href="Explosion%20simulator.bas" class="responsive-img"><img src="Explosion%20simulator.png" alt="Explosion%20simulator.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -276,8 +276,8 @@ conditions by setting velocities to zero at wall boundaries.
 </div>
 </div>
 
-<div id="outline-container-orgf0fb10c" class="outline-2">
-<h2 id="orgf0fb10c"><span class="section-number-2">2.</span> Gravity in 2D</h2>
+<div id="outline-container-org3ead4ff" class="outline-2">
+<h2 id="org3ead4ff"><span class="section-number-2">2.</span> Gravity in 2D</h2>
 <div class="outline-text-2" id="text-2">
 <p>
 The Gravitation Simulation program is a simple yet insightful QBasic
@@ -289,7 +289,7 @@ educational tool for understanding basic orbital mechanics.
 </p>
 
 
-<div id="org5cadf6d" class="figure">
+<div id="org2a562db" class="figure">
 <p><a href="Gravity%20in%202D.bas" class="responsive-img"><img src="Gravity%20in%202D.png" alt="Gravity%20in%202D.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -300,8 +300,8 @@ educational tool for understanding basic orbital mechanics.
 </div>
 </div>
 
-<div id="outline-container-org5e4286b" class="outline-2">
-<h2 id="org5e4286b"><span class="section-number-2">3.</span> Gravity in 3D</h2>
+<div id="outline-container-org8e097c6" class="outline-2">
+<h2 id="org8e097c6"><span class="section-number-2">3.</span> Gravity in 3D</h2>
 <div class="outline-text-2" id="text-3">
 <p>
 This QBasic program simulates the gravitational interactions between
@@ -335,8 +335,8 @@ will reach stable configuration.
 </div>
 </div>
 
-<div id="outline-container-org6c79c4d" class="outline-2">
-<h2 id="org6c79c4d"><span class="section-number-2">4.</span> Interference</h2>
+<div id="outline-container-orgd16724c" class="outline-2">
+<h2 id="orgd16724c"><span class="section-number-2">4.</span> Interference</h2>
 <div class="outline-text-2" id="text-4">
 <p>
 This QBasic program simulates the interference pattern created by two
@@ -364,8 +364,8 @@ displayed as a third waveform.
 </div>
 </div>
 
-<div id="outline-container-org1eb260d" class="outline-2">
-<h2 id="org1eb260d"><span class="section-number-2">5.</span> Interferogram</h2>
+<div id="outline-container-org313d23c" class="outline-2">
+<h2 id="org313d23c"><span class="section-number-2">5.</span> Interferogram</h2>
 <div class="outline-text-2" id="text-5">
 <p>
 This QBasic program simulates the interference pattern created by
@@ -375,7 +375,7 @@ used in physics and engineering to analyze wave interactions.
 </p>
 
 
-<div id="org0536985" class="figure">
+<div id="orgb25dfec" class="figure">
 <p><a href="Interferogram.bas" class="responsive-img"><img src="Interferogram.png" alt="Interferogram.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -386,8 +386,8 @@ used in physics and engineering to analyze wave interactions.
 </div>
 </div>
 
-<div id="outline-container-org4f22fbb" class="outline-2">
-<h2 id="org4f22fbb"><span class="section-number-2">6.</span> Surface tension</h2>
+<div id="outline-container-org0fd9b44" class="outline-2">
+<h2 id="org0fd9b44"><span class="section-number-2">6.</span> Surface tension</h2>
 <div class="outline-text-2" id="text-6">
 <p>
 This QBasic program simulates the behavior of water spills and the
@@ -411,7 +411,7 @@ water cell if surrounded by a high density of water cells.
 </p>
 
 
-<div id="org5ac0a7f" class="figure">
+<div id="orge93ab50" class="figure">
 <p><a href="Surface%20tension.bas" class="responsive-img"><img src="Surface%20tension.png" alt="Surface%20tension.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -422,8 +422,8 @@ water cell if surrounded by a high density of water cells.
 </div>
 </div>
 
-<div id="outline-container-orgce7433b" class="outline-2">
-<h2 id="orgce7433b"><span class="section-number-2">7.</span> Wave 1</h2>
+<div id="outline-container-org1e3088a" class="outline-2">
+<h2 id="org1e3088a"><span class="section-number-2">7.</span> Wave 1</h2>
 <div class="outline-text-2" id="text-7">
 <p>
 This QBasic program simulates the propagation of waves across a
@@ -439,7 +439,7 @@ loss.
 </p>
 
 
-<div id="orgd4f19c2" class="figure">
+<div id="org9edcbd1" class="figure">
 <p><a href="Wave%201.bas" class="responsive-img"><img src="Wave%201.png" alt="Wave%201.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -450,8 +450,8 @@ loss.
 </div>
 </div>
 
-<div id="outline-container-org31a7a22" class="outline-2">
-<h2 id="org31a7a22"><span class="section-number-2">8.</span> Wave 2</h2>
+<div id="outline-container-orgd5c33be" class="outline-2">
+<h2 id="orgd5c33be"><span class="section-number-2">8.</span> Wave 2</h2>
 <div class="outline-text-2" id="text-8">
 <p>
 This QBasic program simulates and visualizes the behavior of water
@@ -463,7 +463,7 @@ understanding wave mechanics.
 </p>
 
 
-<div id="org9545585" class="figure">
+<div id="orgc8f60e2" class="figure">
 <p><a href="Wave%202.bas" class="responsive-img"><img src="Wave%202.png" alt="Wave%202.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -475,7 +475,7 @@ understanding wave mechanics.
 </div>
 </div>
 <div id="postamble" class="status">
-<p class="date">Created: 2025-07-29 ti 17:33</p>
+<p class="date">Created: 2025-07-30 ke 01:29</p>
 <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
 </div>
 </body>
index a993d50..27ee4b5 100644 (file)
@@ -3,7 +3,7 @@
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-<!-- 2025-07-29 ti 17:34 -->
+<!-- 2025-07-30 ke 01:30 -->
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 <title>Truth table calculator</title>
@@ -1103,20 +1103,20 @@ hsAddReviewPanels();
 <h2>Table of Contents</h2>
 <div id="text-table-of-contents" role="doc-toc">
 <ul>
-<li><a href="#org105c311">1. Implemented logical operations</a>
+<li><a href="#org06f3ac8">1. Implemented logical operations</a>
 <ul>
-<li><a href="#org8aab038">1.1. Equivalent ( ⇔ , 1 )</a></li>
-<li><a href="#orgcb7a1e2">1.2. Implies ( ⇒ , 2 )</a></li>
-<li><a href="#org8b3b1fd">1.3. OR ( ∨ , 3 )</a></li>
-<li><a href="#org7b058a1">1.4. AND ( ∧ , 4 )</a></li>
-<li><a href="#orgf76a804">1.5. NOT ( ¬ , 5 )</a></li>
+<li><a href="#org1be7922">1.1. Equivalent ( ⇔ , 1 )</a></li>
+<li><a href="#org2bc5a82">1.2. Implies ( ⇒ , 2 )</a></li>
+<li><a href="#org786924e">1.3. OR ( ∨ , 3 )</a></li>
+<li><a href="#org876a1ea">1.4. AND ( ∧ , 4 )</a></li>
+<li><a href="#orgcb43e80">1.5. NOT ( ¬ , 5 )</a></li>
 </ul>
 </li>
-<li><a href="#org8345257">2. Examples</a>
+<li><a href="#org1f8faea">2. Examples</a>
 <ul>
-<li><a href="#orgb303480">2.1. Example: (A ∧ B) ∨ ¬C</a></li>
-<li><a href="#orgeb7b5e6">2.2. Example: A ⇒ (B ∨ ¬C)</a></li>
-<li><a href="#org1506d34">2.3. Example: (A ⇔ B) ∧ C</a></li>
+<li><a href="#org70d21cc">2.1. Example: (A ∧ B) ∨ ¬C</a></li>
+<li><a href="#orgdb6b43c">2.2. Example: A ⇒ (B ∨ ¬C)</a></li>
+<li><a href="#org221a1e2">2.3. Example: (A ⇔ B) ∧ C</a></li>
 </ul>
 </li>
 </ul>
@@ -1133,12 +1133,12 @@ the input variables, with the corresponding output value. Truth tables are cruci
 designing and understanding digital circuits, Boolean algebra, and logical expressions.
 </p>
 
-<div id="outline-container-org105c311" class="outline-2">
-<h2 id="org105c311"><span class="section-number-2">1.</span> Implemented logical operations</h2>
+<div id="outline-container-org06f3ac8" class="outline-2">
+<h2 id="org06f3ac8"><span class="section-number-2">1.</span> Implemented logical operations</h2>
 <div class="outline-text-2" id="text-1">
 </div>
-<div id="outline-container-org8aab038" class="outline-3">
-<h3 id="org8aab038"><span class="section-number-3">1.1.</span> Equivalent ( ⇔ , 1 )</h3>
+<div id="outline-container-org1be7922" class="outline-3">
+<h3 id="org1be7922"><span class="section-number-3">1.1.</span> Equivalent ( ⇔ , 1 )</h3>
 <div class="outline-text-3" id="text-1-1">
 <p>
 The equivalent operation, also known as logical biconditional, is true if and only if
@@ -1196,8 +1196,8 @@ Truth Table:
 </div>
 </div>
 
-<div id="outline-container-orgcb7a1e2" class="outline-3">
-<h3 id="orgcb7a1e2"><span class="section-number-3">1.2.</span> Implies ( ⇒ , 2 )</h3>
+<div id="outline-container-org2bc5a82" class="outline-3">
+<h3 id="org2bc5a82"><span class="section-number-3">1.2.</span> Implies ( ⇒ , 2 )</h3>
 <div class="outline-text-3" id="text-1-2">
 <p>
 An implication asserts that if the first proposition is true, the
@@ -1255,8 +1255,8 @@ Truth table:
 </div>
 </div>
 
-<div id="outline-container-org8b3b1fd" class="outline-3">
-<h3 id="org8b3b1fd"><span class="section-number-3">1.3.</span> OR ( ∨ , 3 )</h3>
+<div id="outline-container-org786924e" class="outline-3">
+<h3 id="org786924e"><span class="section-number-3">1.3.</span> OR ( ∨ , 3 )</h3>
 <div class="outline-text-3" id="text-1-3">
 <p>
 The OR operation, also known as logical disjunction, is true if at
@@ -1314,8 +1314,8 @@ Truth table:
 </div>
 </div>
 
-<div id="outline-container-org7b058a1" class="outline-3">
-<h3 id="org7b058a1"><span class="section-number-3">1.4.</span> AND ( ∧ , 4 )</h3>
+<div id="outline-container-org876a1ea" class="outline-3">
+<h3 id="org876a1ea"><span class="section-number-3">1.4.</span> AND ( ∧ , 4 )</h3>
 <div class="outline-text-3" id="text-1-4">
 <p>
 The AND operation, also known as logical conjunction, is true if and
@@ -1372,8 +1372,8 @@ Truth table:
 </div>
 </div>
 
-<div id="outline-container-orgf76a804" class="outline-3">
-<h3 id="orgf76a804"><span class="section-number-3">1.5.</span> NOT ( ¬ , 5 )</h3>
+<div id="outline-container-orgcb43e80" class="outline-3">
+<h3 id="orgcb43e80"><span class="section-number-3">1.5.</span> NOT ( ¬ , 5 )</h3>
 <div class="outline-text-3" id="text-1-5">
 <p>
 The NOT operation, also known as logical negation, inverts the value
@@ -1414,12 +1414,12 @@ Truth Table:
 </div>
 </div>
 </div>
-<div id="outline-container-org8345257" class="outline-2">
-<h2 id="org8345257"><span class="section-number-2">2.</span> Examples</h2>
+<div id="outline-container-org1f8faea" class="outline-2">
+<h2 id="org1f8faea"><span class="section-number-2">2.</span> Examples</h2>
 <div class="outline-text-2" id="text-2">
 </div>
-<div id="outline-container-orgb303480" class="outline-3">
-<h3 id="orgb303480"><span class="section-number-3">2.1.</span> Example: (A ∧ B) ∨ ¬C</h3>
+<div id="outline-container-org70d21cc" class="outline-3">
+<h3 id="org70d21cc"><span class="section-number-3">2.1.</span> Example: (A ∧ B) ∨ ¬C</h3>
 <div class="outline-text-3" id="text-2-1">
 <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
 
@@ -1502,8 +1502,8 @@ Truth Table:
 </div>
 </div>
 
-<div id="outline-container-orgeb7b5e6" class="outline-3">
-<h3 id="orgeb7b5e6"><span class="section-number-3">2.2.</span> Example: A ⇒ (B ∨ ¬C)</h3>
+<div id="outline-container-orgdb6b43c" class="outline-3">
+<h3 id="orgdb6b43c"><span class="section-number-3">2.2.</span> Example: A ⇒ (B ∨ ¬C)</h3>
 <div class="outline-text-3" id="text-2-2">
 <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
 
@@ -1586,8 +1586,8 @@ Truth Table:
 </div>
 </div>
 
-<div id="outline-container-org1506d34" class="outline-3">
-<h3 id="org1506d34"><span class="section-number-3">2.3.</span> Example: (A ⇔ B) ∧ C</h3>
+<div id="outline-container-org221a1e2" class="outline-3">
+<h3 id="org221a1e2"><span class="section-number-3">2.3.</span> Example: (A ⇔ B) ∧ C</h3>
 <div class="outline-text-3" id="text-2-3">
 <p>
 Truth Table:
@@ -1676,7 +1676,7 @@ Truth Table:
 </div>
 </div>
 <div id="postamble" class="status">
-<p class="date">Created: 2025-07-29 ti 17:34</p>
+<p class="date">Created: 2025-07-30 ke 01:30</p>
 <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
 </div>
 </body>
diff --git a/Miscellaneous/4D engine.bas b/Miscellaneous/4D engine.bas
new file mode 100755 (executable)
index 0000000..1f87299
--- /dev/null
@@ -0,0 +1,350 @@
+' 4D engine. It renders a 5-cell (aka. pentachoron) as a series\r
+' of 3D tetrahedrons with varying brightness. Brightness is used\r
+' to indicate shift in the fourth dimension.\r
+'\r
+' In essence, you can look at a 3D object as a series of 2D\r
+' cross-sections along the third dimension. Here we look at\r
+' a 4D object as a series of 3D cross-sections with varying\r
+' brightness (to distinguish between them).\r
+'\r
+' 4 dimensions also make it possible to rotate the object along\r
+' 6 different axes. Interestingly, the shape of the object changes\r
+' in 3D space when it is rotated along any of the axes that\r
+' involve the fourth dimension.\r
+'\r
+' This program is free software: released under Creative Commons Zero (CC0) license\r
+' by Svjatoslav Agejenko.\r
+' Email: svjatoslav@svjatoslav.eu\r
+' Homepage: http://www.svjatoslav.eu\r
+'\r
+' Changelog:\r
+' 2003.08, Initial version\r
+' 2024 - 2025, Improved program readability\r
+\r
+' Declare subroutines and functions that will be used in the program\r
+DECLARE SUB CalculateInterpolatedLine (originalX1!, originalY1!, originalZ1!, originalQ1!, originalX2!, originalY2!, originalZ2!, originalQ2!)\r
+DECLARE SUB RotatePoint (x1!, y1!, z1!, q1!, x4!, y4!, z4!, q4!)\r
+DECLARE SUB SetupPalette ()\r
+DECLARE SUB GetPointAtDistance (x1!, y1!, z1!, q1!, x2!, y2!, z2!, q2!, distanceFactor!, rx!, ry!, rz!, rq!)\r
+DECLARE SUB RenderPentachoron (ox1!, oy1!, oz1!, oq1!, ox2!, oy2!, oz2!, oq2!, ox3!, oy3!, oz3!, oq3!, ox4!, oy4!, oz4!, oq4!, ox5!, oy5!, oz5!, oq5!)\r
+DECLARE FUNCTION CalculateDistance (x1!, y1!, z1!, q1!, x2!, y2!, z2!, q2!)\r
+\r
+' Shared variables that can be accessed from any subroutine\r
+DIM SHARED screenSize\r
+DIM SHARED angleXZ, angleYZ, angleXY, angleQX, angleQY, angleQZ\r
+DIM SHARED cameraX, cameraY, cameraZ, cameraQ\r
+DIM SHARED pi\r
+DIM SHARED sineXZ, sineYZ, sineXY, sineQX, sineQY, sineQZ\r
+DIM SHARED cosineXZ, cosineYZ, cosineXY, cosineQX, cosineQY, cosineQZ\r
+\r
+' Arrays to store projected points and other drawing information\r
+DIM SHARED projectedX(1 TO 10)\r
+DIM SHARED projectedY(1 TO 10)\r
+DIM SHARED pointCount\r
+DIM SHARED frame\r
+\r
+' Display control instructions to the user\r
+PRINT ""\r
+PRINT " Use keys:"\r
+PRINT "       Rotate:"\r
+PRINT "               qw - XZ"\r
+PRINT "               as - YZ"\r
+PRINT "               zx - XY"\r
+PRINT "               er - QX"\r
+PRINT "               df - QY"\r
+PRINT "               cv - QZ"\r
+PRINT "       Move:"\r
+PRINT "               46 - x"\r
+PRINT "               82 - y"\r
+PRINT "               71 - z"\r
+PRINT "               -+ - q"\r
+PRINT\r
+PRINT "       ESC - to quit program"\r
+PRINT\r
+PRINT " Press any key to continue..."\r
+in$ = INPUT$(1)\r
+\r
+' Initialize pi value for rotation calculations\r
+pi = 3.1415\r
+\r
+' Initialize rotation angles for each axis\r
+angleXZ = pi * .5\r
+angleYZ = angleXZ\r
+angleXY = angleXZ\r
+angleQX = angleXZ\r
+angleQY = angleXZ\r
+angleQZ = angleXZ\r
+\r
+' Set initial camera position in 4D space\r
+cameraX = 0\r
+cameraY = 0\r
+cameraZ = 0\r
+cameraQ = .5\r
+\r
+' Set graphics mode to 640x480 with 16 colors\r
+SCREEN 12\r
+' Setup the color palette for rendering\r
+SetupPalette\r
+\r
+MainLoop:\r
+' Clear screen for new frame\r
+CLS\r
+\r
+' Calculate sine and cosine values for each rotation angle\r
+sineXZ = SIN(angleXZ): cosineXZ = COS(angleXZ)\r
+sineYZ = SIN(angleYZ): cosineYZ = COS(angleYZ)\r
+sineXY = SIN(angleXY): cosineXY = COS(angleXY)\r
+sineQX = SIN(angleQX): cosineQX = COS(angleQX)\r
+sineQY = SIN(angleQY): cosineQY = COS(angleQY)\r
+sineQZ = SIN(angleQZ): cosineQZ = COS(angleQZ)\r
+\r
+' Render multiple frames of the pentachoron with varying depth\r
+FOR frame = 1 TO 15 STEP 3\r
+  ' Render a pentachoron (5-cell) with the current camera position and rotation\r
+  RenderPentachoron -10, -10, -10, 0, 10, -10, -10, 0, 0, -10, 10, 0, 0, 10, 0, 0, 0, 0, 0, 10\r
+NEXT frame\r
+\r
+' Get user input for camera control\r
+in$ = INPUT$(1)\r
+\r
+' Handle user input for rotation and movement\r
+SELECT CASE in$\r
+CASE CHR$(27)\r
+  ' ESC key pressed - exit program\r
+  SYSTEM\r
+CASE "q"\r
+  ' Increase rotation angle along XZ axis\r
+  angleXZ = angleXZ + .1\r
+CASE "w"\r
+  ' Decrease rotation angle along XZ axis\r
+  angleXZ = angleXZ - .1\r
+CASE "a"\r
+  ' Increase rotation angle along YZ axis\r
+  angleYZ = angleYZ + .1\r
+CASE "s"\r
+  ' Decrease rotation angle along YZ axis\r
+  angleYZ = angleYZ - .1\r
+CASE "z"\r
+  ' Increase rotation angle along XY axis\r
+  angleXY = angleXY + .1\r
+CASE "x"\r
+  ' Decrease rotation angle along XY axis\r
+  angleXY = angleXY - .1\r
+CASE "e"\r
+  ' Increase rotation angle along QX axis\r
+  angleQX = angleQX + .1\r
+CASE "r"\r
+  ' Decrease rotation angle along QX axis\r
+  angleQX = angleQX - .1\r
+CASE "d"\r
+  ' Increase rotation angle along QY axis\r
+  angleQY = angleQY + .1\r
+CASE "f"\r
+  ' Decrease rotation angle along QY axis\r
+  angleQY = angleQY - .1\r
+CASE "c"\r
+  ' Increase rotation angle along QZ axis\r
+  angleQZ = angleQZ + .1\r
+CASE "v"\r
+  ' Decrease rotation angle along QZ axis\r
+  angleQZ = angleQZ - .1\r
+\r
+' Handle user input for movement in the 4D space\r
+CASE "4"\r
+  ' Move camera left along X axis\r
+  cameraX = cameraX - 3\r
+CASE "6"\r
+  ' Move camera right along X axis\r
+  cameraX = cameraX + 3\r
+CASE "8"\r
+  ' Move camera forward along Z axis\r
+  cameraZ = cameraZ + 3\r
+CASE "2"\r
+  ' Move camera backward along Z axis\r
+  cameraZ = cameraZ - 3\r
+CASE "7"\r
+  ' Move camera up along Y axis\r
+  cameraY = cameraY + 3\r
+CASE "1"\r
+  ' Move camera down along Y axis\r
+  cameraY = cameraY - 3\r
+CASE "+"\r
+  ' Move camera forward along Q axis (4th dimension)\r
+  cameraQ = cameraQ + .3\r
+CASE "-"\r
+  ' Move camera backward along Q axis (4th dimension)\r
+  cameraQ = cameraQ - .3\r
+\r
+END SELECT\r
+\r
+' Loop back to render next frame\r
+GOTO MainLoop\r
+\r
+' Function to calculate the distance between two points in 4D space\r
+FUNCTION CalculateDistance (x1, y1, z1, q1, x2, y2, z2, q2)\r
+  ' Calculate Euclidean distance in 4D space\r
+  CalculateDistance = SQR((x1 - x2) ^ 2 + (y1 - y2) ^ 2 + (z1 - z2) ^ 2 + (q1 - q2) ^ 2)\r
+END FUNCTION\r
+\r
+' Subroutine to calculate the linear interpolation between two points\r
+SUB CalculateInterpolatedLine (originalX1, originalY1, originalZ1, originalQ1, originalX2, originalY2, originalZ2, originalQ2)\r
+  ' Local variables to store coordinates of the two points\r
+  x1 = originalX1: y1 = originalY1: z1 = originalZ1: q1 = originalQ1\r
+  x2 = originalX2: y2 = originalY2: z2 = originalZ2: q2 = originalQ2\r
+\r
+  ' If the first point is in front of the camera and the second is behind,\r
+  ' swap them to ensure proper rendering order\r
+  IF (q1 > cameraQ) AND (q2 < cameraQ) THEN\r
+    SWAP x1, x2\r
+    SWAP y1, y2\r
+    SWAP z1, z2\r
+    SWAP q1, q2\r
+  END IF\r
+\r
+  ' If the first point is in front of the camera and the second is behind,\r
+  ' calculate the intersection point where the line segment crosses the camera plane\r
+  IF (q1 < cameraQ) AND (q2 > cameraQ) THEN\r
+    ' Calculate the difference in Q coordinates\r
+    qDifference = q2 - q1\r
+    ' Calculate how far along the line segment we need to go to reach the camera plane\r
+    qToCamera = cameraQ - q1\r
+    ' Calculate the interpolation factor\r
+    interpolationFactor = qToCamera / qDifference\r
+    ' Increment point counter\r
+    pointCount = pointCount + 1\r
+    ' Calculate interpolated coordinates\r
+    interpolatedX = (x2 - x1) * interpolationFactor + x1\r
+    interpolatedY = (y2 - y1) * interpolationFactor + y1\r
+    interpolatedZ = (z2 - z1) * interpolationFactor + z1 + 50\r
+    ' Project 3D coordinates to 2D screen coordinates and store them\r
+    projectedX(pointCount) = interpolatedX / interpolatedZ * 700 + 320\r
+    projectedY(pointCount) = interpolatedY / interpolatedZ * 700 + 240\r
+  END IF\r
+END SUB\r
+\r
+' Subroutine to get a point at a specific distance along the line segment\r
+SUB GetPointAtDistance (x1, y1, z1, q1, x2, y2, z2, q2, distanceFactor, rx, ry, rz, rq)\r
+  ' Calculate the vector between the two points\r
+  xVector = x2 - x1\r
+  yVector = y2 - y1\r
+  zVector = z2 - z1\r
+  qVector = q2 - q1\r
+\r
+  ' Calculate the coordinates of the point at the specified distance along the line segment\r
+  rx = x1 + (xVector * distanceFactor)\r
+  ry = y1 + (yVector * distanceFactor)\r
+  rz = z1 + (zVector * distanceFactor)\r
+  rq = q1 + (qVector * distanceFactor)\r
+END SUB\r
+\r
+' Subroutine to render a 3D tetrahedron with varying brightness\r
+SUB RenderPentachoron (originalX1, originalY1, originalZ1, originalQ1, originalX2, originalY2, originalZ2, originalQ2, originalX3, originalY3, originalZ3, originalQ3, originalX4, originalY4, originalZ4, originalQ4, originalX5, originalY5, originalZ5 _\r
+, originalQ5)\r
+\r
+  ' Adjust coordinates based on camera position and frame depth\r
+  originalX1 = originalX1 - cameraX\r
+  originalY1 = originalY1 - cameraY\r
+  originalZ1 = originalZ1 - cameraZ\r
+  originalQ1 = originalQ1 - cameraQ - frame\r
+\r
+  originalX2 = originalX2 - cameraX\r
+  originalY2 = originalY2 - cameraY\r
+  originalZ2 = originalZ2 - cameraZ\r
+  originalQ2 = originalQ2 - cameraQ - frame\r
+\r
+  originalX3 = originalX3 - cameraX\r
+  originalY3 = originalY3 - cameraY\r
+  originalZ3 = originalZ3 - cameraZ\r
+  originalQ3 = originalQ3 - cameraQ - frame\r
+\r
+  originalX4 = originalX4 - cameraX\r
+  originalY4 = originalY4 - cameraY\r
+  originalZ4 = originalZ4 - cameraZ\r
+  originalQ4 = originalQ4 - cameraQ - frame\r
+\r
+  originalX5 = originalX5 - cameraX\r
+  originalY5 = originalY5 - cameraY\r
+  originalZ5 = originalZ5 - cameraZ\r
+  originalQ5 = originalQ5 - cameraQ - frame\r
+\r
+  ' Rotate all points based on current rotation angles\r
+  RotatePoint originalX1, originalY1, originalZ1, originalQ1, x1, y1, z1, q1\r
+  RotatePoint originalX2, originalY2, originalZ2, originalQ2, x2, y2, z2, q2\r
+  RotatePoint originalX3, originalY3, originalZ3, originalQ3, x3, y3, z3, q3\r
+  RotatePoint originalX4, originalY4, originalZ4, originalQ4, x4, y4, z4, q4\r
+  RotatePoint originalX5, originalY5, originalZ5, originalQ5, x5, y5, z5, q5\r
+\r
+  ' Initialize point counter\r
+  pointCount = 0\r
+\r
+  ' Calculate interpolated points for all edges of the pentachoron\r
+  CalculateInterpolatedLine x1, y1, z1, q1, x2, y2, z2, q2\r
+  CalculateInterpolatedLine x1, y1, z1, q1, x3, y3, z3, q3\r
+  CalculateInterpolatedLine x1, y1, z1, q1, x4, y4, z4, q4\r
+  CalculateInterpolatedLine x1, y1, z1, q1, x5, y5, z5, q5\r
+\r
+  CalculateInterpolatedLine x2, y2, z2, q2, x3, y3, z3, q3\r
+  CalculateInterpolatedLine x2, y2, z2, q2, x4, y4, z4, q4\r
+  CalculateInterpolatedLine x2, y2, z2, q2, x5, y5, z5, q5\r
+\r
+  CalculateInterpolatedLine x3, y3, z3, q3, x4, y4, z4, q4\r
+  CalculateInterpolatedLine x3, y3, z3, q3, x5, y5, z5, q5\r
+\r
+  CalculateInterpolatedLine x4, y4, z4, q4, x5, y5, z5, q5\r
+\r
+  ' Draw lines between each pair of interpolated points\r
+  FOR pointA = 1 TO pointCount\r
+    FOR pointB = pointA + 1 TO pointCount\r
+      ' Draw line with color based on frame depth (for varying brightness)\r
+      LINE (projectedX(pointA), projectedY(pointA))-(projectedX(pointB), projectedY(pointB)), 15 - frame\r
+    NEXT pointB\r
+  NEXT pointA\r
+\r
+END SUB\r
+\r
+' Subroutine to rotate a point along the specified axes\r
+SUB RotatePoint (x1, y1, z1, q1, x4, y4, z4, q4)\r
+\r
+  ' Rotate the point along the QX axis\r
+  q2 = q1 * sineQX - x1 * cosineQX\r
+  x2 = q1 * cosineQX + x1 * sineQX\r
+\r
+  ' Rotate the point along the QY axis\r
+  q3 = q2 * sineQY - y1 * cosineQY\r
+  y2 = q2 * cosineQY + y1 * sineQY\r
+\r
+  ' Rotate the point along the QZ axis\r
+  q4 = q3 * sineQZ - z1 * cosineQZ\r
+  z2 = q3 * cosineQZ + z1 * sineQZ\r
+\r
+  ' Rotate the point along the XZ axis\r
+  x3 = x2 * sineXZ - z2 * cosineXZ\r
+  z3 = x2 * cosineXZ + z2 * sineXZ\r
+\r
+  ' Rotate the point along the YZ axis\r
+  y3 = y2 * sineYZ - z3 * cosineYZ\r
+  z4 = y2 * cosineYZ + z3 * sineYZ\r
+\r
+  ' Rotate the point along the XY axis\r
+  y4 = y3 * sineXY - x3 * cosineXY\r
+  x4 = y3 * cosineXY + x3 * sineXY\r
+\r
+END SUB\r
+\r
+' Subroutine to set up the color palette\r
+SUB SetupPalette\r
+\r
+  ' Set up a grayscale color palette\r
+  FOR colorIndex = 0 TO 15\r
+    ' Set palette register\r
+    OUT &H3C8, colorIndex\r
+    ' Set RGB values (all equal for grayscale)\r
+    OUT &H3C9, colorIndex * 4\r
+    OUT &H3C9, colorIndex * 4\r
+    OUT &H3C9, colorIndex * 4\r
+    ' Draw a vertical line with this color to visualize the palette\r
+    LINE (colorIndex, 0)-(colorIndex, 400), colorIndex\r
+  NEXT colorIndex\r
+\r
+END SUB\r
+\r
diff --git a/Miscellaneous/4D engine.png b/Miscellaneous/4D engine.png
new file mode 100644 (file)
index 0000000..03e6e3e
Binary files /dev/null and b/Miscellaneous/4D engine.png differ
diff --git a/Miscellaneous/4D engine/index.html b/Miscellaneous/4D engine/index.html
deleted file mode 100644 (file)
index 67998b4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<HTML>\r
-<HEAD><TITLE>4D engine</TITLE></HEAD>\r
-\r
-<BODY>\r
-\r
-<CENTER><H1>4D engine</H1></CENTER>\r
-<BR>\r
-<BR>\r
-Implementation of 4 dimensional (4D) engine.\r
-It's like 3D but with additional extra dimension.\r
-\r
-It's possible to define objects from 4D polygons.\r
-In 4D world minimum amount of points to define 4D\r
-shape is 5. Each point will be defined by 4 coordinates (X, Y, Z, Q).\r
-\r
-You can rotate object around any axis\r
-(4D world has 6 rotation axes!)\r
-Program allows you to move along any dimension.\r
-\r
-<BR><IMG SRC="sshot.png">\r
-</BODY>\r
-</HTML>
\ No newline at end of file
diff --git a/Miscellaneous/4D engine/qeng.bas b/Miscellaneous/4D engine/qeng.bas
deleted file mode 100755 (executable)
index 1f87299..0000000
+++ /dev/null
@@ -1,350 +0,0 @@
-' 4D engine. It renders a 5-cell (aka. pentachoron) as a series\r
-' of 3D tetrahedrons with varying brightness. Brightness is used\r
-' to indicate shift in the fourth dimension.\r
-'\r
-' In essence, you can look at a 3D object as a series of 2D\r
-' cross-sections along the third dimension. Here we look at\r
-' a 4D object as a series of 3D cross-sections with varying\r
-' brightness (to distinguish between them).\r
-'\r
-' 4 dimensions also make it possible to rotate the object along\r
-' 6 different axes. Interestingly, the shape of the object changes\r
-' in 3D space when it is rotated along any of the axes that\r
-' involve the fourth dimension.\r
-'\r
-' This program is free software: released under Creative Commons Zero (CC0) license\r
-' by Svjatoslav Agejenko.\r
-' Email: svjatoslav@svjatoslav.eu\r
-' Homepage: http://www.svjatoslav.eu\r
-'\r
-' Changelog:\r
-' 2003.08, Initial version\r
-' 2024 - 2025, Improved program readability\r
-\r
-' Declare subroutines and functions that will be used in the program\r
-DECLARE SUB CalculateInterpolatedLine (originalX1!, originalY1!, originalZ1!, originalQ1!, originalX2!, originalY2!, originalZ2!, originalQ2!)\r
-DECLARE SUB RotatePoint (x1!, y1!, z1!, q1!, x4!, y4!, z4!, q4!)\r
-DECLARE SUB SetupPalette ()\r
-DECLARE SUB GetPointAtDistance (x1!, y1!, z1!, q1!, x2!, y2!, z2!, q2!, distanceFactor!, rx!, ry!, rz!, rq!)\r
-DECLARE SUB RenderPentachoron (ox1!, oy1!, oz1!, oq1!, ox2!, oy2!, oz2!, oq2!, ox3!, oy3!, oz3!, oq3!, ox4!, oy4!, oz4!, oq4!, ox5!, oy5!, oz5!, oq5!)\r
-DECLARE FUNCTION CalculateDistance (x1!, y1!, z1!, q1!, x2!, y2!, z2!, q2!)\r
-\r
-' Shared variables that can be accessed from any subroutine\r
-DIM SHARED screenSize\r
-DIM SHARED angleXZ, angleYZ, angleXY, angleQX, angleQY, angleQZ\r
-DIM SHARED cameraX, cameraY, cameraZ, cameraQ\r
-DIM SHARED pi\r
-DIM SHARED sineXZ, sineYZ, sineXY, sineQX, sineQY, sineQZ\r
-DIM SHARED cosineXZ, cosineYZ, cosineXY, cosineQX, cosineQY, cosineQZ\r
-\r
-' Arrays to store projected points and other drawing information\r
-DIM SHARED projectedX(1 TO 10)\r
-DIM SHARED projectedY(1 TO 10)\r
-DIM SHARED pointCount\r
-DIM SHARED frame\r
-\r
-' Display control instructions to the user\r
-PRINT ""\r
-PRINT " Use keys:"\r
-PRINT "       Rotate:"\r
-PRINT "               qw - XZ"\r
-PRINT "               as - YZ"\r
-PRINT "               zx - XY"\r
-PRINT "               er - QX"\r
-PRINT "               df - QY"\r
-PRINT "               cv - QZ"\r
-PRINT "       Move:"\r
-PRINT "               46 - x"\r
-PRINT "               82 - y"\r
-PRINT "               71 - z"\r
-PRINT "               -+ - q"\r
-PRINT\r
-PRINT "       ESC - to quit program"\r
-PRINT\r
-PRINT " Press any key to continue..."\r
-in$ = INPUT$(1)\r
-\r
-' Initialize pi value for rotation calculations\r
-pi = 3.1415\r
-\r
-' Initialize rotation angles for each axis\r
-angleXZ = pi * .5\r
-angleYZ = angleXZ\r
-angleXY = angleXZ\r
-angleQX = angleXZ\r
-angleQY = angleXZ\r
-angleQZ = angleXZ\r
-\r
-' Set initial camera position in 4D space\r
-cameraX = 0\r
-cameraY = 0\r
-cameraZ = 0\r
-cameraQ = .5\r
-\r
-' Set graphics mode to 640x480 with 16 colors\r
-SCREEN 12\r
-' Setup the color palette for rendering\r
-SetupPalette\r
-\r
-MainLoop:\r
-' Clear screen for new frame\r
-CLS\r
-\r
-' Calculate sine and cosine values for each rotation angle\r
-sineXZ = SIN(angleXZ): cosineXZ = COS(angleXZ)\r
-sineYZ = SIN(angleYZ): cosineYZ = COS(angleYZ)\r
-sineXY = SIN(angleXY): cosineXY = COS(angleXY)\r
-sineQX = SIN(angleQX): cosineQX = COS(angleQX)\r
-sineQY = SIN(angleQY): cosineQY = COS(angleQY)\r
-sineQZ = SIN(angleQZ): cosineQZ = COS(angleQZ)\r
-\r
-' Render multiple frames of the pentachoron with varying depth\r
-FOR frame = 1 TO 15 STEP 3\r
-  ' Render a pentachoron (5-cell) with the current camera position and rotation\r
-  RenderPentachoron -10, -10, -10, 0, 10, -10, -10, 0, 0, -10, 10, 0, 0, 10, 0, 0, 0, 0, 0, 10\r
-NEXT frame\r
-\r
-' Get user input for camera control\r
-in$ = INPUT$(1)\r
-\r
-' Handle user input for rotation and movement\r
-SELECT CASE in$\r
-CASE CHR$(27)\r
-  ' ESC key pressed - exit program\r
-  SYSTEM\r
-CASE "q"\r
-  ' Increase rotation angle along XZ axis\r
-  angleXZ = angleXZ + .1\r
-CASE "w"\r
-  ' Decrease rotation angle along XZ axis\r
-  angleXZ = angleXZ - .1\r
-CASE "a"\r
-  ' Increase rotation angle along YZ axis\r
-  angleYZ = angleYZ + .1\r
-CASE "s"\r
-  ' Decrease rotation angle along YZ axis\r
-  angleYZ = angleYZ - .1\r
-CASE "z"\r
-  ' Increase rotation angle along XY axis\r
-  angleXY = angleXY + .1\r
-CASE "x"\r
-  ' Decrease rotation angle along XY axis\r
-  angleXY = angleXY - .1\r
-CASE "e"\r
-  ' Increase rotation angle along QX axis\r
-  angleQX = angleQX + .1\r
-CASE "r"\r
-  ' Decrease rotation angle along QX axis\r
-  angleQX = angleQX - .1\r
-CASE "d"\r
-  ' Increase rotation angle along QY axis\r
-  angleQY = angleQY + .1\r
-CASE "f"\r
-  ' Decrease rotation angle along QY axis\r
-  angleQY = angleQY - .1\r
-CASE "c"\r
-  ' Increase rotation angle along QZ axis\r
-  angleQZ = angleQZ + .1\r
-CASE "v"\r
-  ' Decrease rotation angle along QZ axis\r
-  angleQZ = angleQZ - .1\r
-\r
-' Handle user input for movement in the 4D space\r
-CASE "4"\r
-  ' Move camera left along X axis\r
-  cameraX = cameraX - 3\r
-CASE "6"\r
-  ' Move camera right along X axis\r
-  cameraX = cameraX + 3\r
-CASE "8"\r
-  ' Move camera forward along Z axis\r
-  cameraZ = cameraZ + 3\r
-CASE "2"\r
-  ' Move camera backward along Z axis\r
-  cameraZ = cameraZ - 3\r
-CASE "7"\r
-  ' Move camera up along Y axis\r
-  cameraY = cameraY + 3\r
-CASE "1"\r
-  ' Move camera down along Y axis\r
-  cameraY = cameraY - 3\r
-CASE "+"\r
-  ' Move camera forward along Q axis (4th dimension)\r
-  cameraQ = cameraQ + .3\r
-CASE "-"\r
-  ' Move camera backward along Q axis (4th dimension)\r
-  cameraQ = cameraQ - .3\r
-\r
-END SELECT\r
-\r
-' Loop back to render next frame\r
-GOTO MainLoop\r
-\r
-' Function to calculate the distance between two points in 4D space\r
-FUNCTION CalculateDistance (x1, y1, z1, q1, x2, y2, z2, q2)\r
-  ' Calculate Euclidean distance in 4D space\r
-  CalculateDistance = SQR((x1 - x2) ^ 2 + (y1 - y2) ^ 2 + (z1 - z2) ^ 2 + (q1 - q2) ^ 2)\r
-END FUNCTION\r
-\r
-' Subroutine to calculate the linear interpolation between two points\r
-SUB CalculateInterpolatedLine (originalX1, originalY1, originalZ1, originalQ1, originalX2, originalY2, originalZ2, originalQ2)\r
-  ' Local variables to store coordinates of the two points\r
-  x1 = originalX1: y1 = originalY1: z1 = originalZ1: q1 = originalQ1\r
-  x2 = originalX2: y2 = originalY2: z2 = originalZ2: q2 = originalQ2\r
-\r
-  ' If the first point is in front of the camera and the second is behind,\r
-  ' swap them to ensure proper rendering order\r
-  IF (q1 > cameraQ) AND (q2 < cameraQ) THEN\r
-    SWAP x1, x2\r
-    SWAP y1, y2\r
-    SWAP z1, z2\r
-    SWAP q1, q2\r
-  END IF\r
-\r
-  ' If the first point is in front of the camera and the second is behind,\r
-  ' calculate the intersection point where the line segment crosses the camera plane\r
-  IF (q1 < cameraQ) AND (q2 > cameraQ) THEN\r
-    ' Calculate the difference in Q coordinates\r
-    qDifference = q2 - q1\r
-    ' Calculate how far along the line segment we need to go to reach the camera plane\r
-    qToCamera = cameraQ - q1\r
-    ' Calculate the interpolation factor\r
-    interpolationFactor = qToCamera / qDifference\r
-    ' Increment point counter\r
-    pointCount = pointCount + 1\r
-    ' Calculate interpolated coordinates\r
-    interpolatedX = (x2 - x1) * interpolationFactor + x1\r
-    interpolatedY = (y2 - y1) * interpolationFactor + y1\r
-    interpolatedZ = (z2 - z1) * interpolationFactor + z1 + 50\r
-    ' Project 3D coordinates to 2D screen coordinates and store them\r
-    projectedX(pointCount) = interpolatedX / interpolatedZ * 700 + 320\r
-    projectedY(pointCount) = interpolatedY / interpolatedZ * 700 + 240\r
-  END IF\r
-END SUB\r
-\r
-' Subroutine to get a point at a specific distance along the line segment\r
-SUB GetPointAtDistance (x1, y1, z1, q1, x2, y2, z2, q2, distanceFactor, rx, ry, rz, rq)\r
-  ' Calculate the vector between the two points\r
-  xVector = x2 - x1\r
-  yVector = y2 - y1\r
-  zVector = z2 - z1\r
-  qVector = q2 - q1\r
-\r
-  ' Calculate the coordinates of the point at the specified distance along the line segment\r
-  rx = x1 + (xVector * distanceFactor)\r
-  ry = y1 + (yVector * distanceFactor)\r
-  rz = z1 + (zVector * distanceFactor)\r
-  rq = q1 + (qVector * distanceFactor)\r
-END SUB\r
-\r
-' Subroutine to render a 3D tetrahedron with varying brightness\r
-SUB RenderPentachoron (originalX1, originalY1, originalZ1, originalQ1, originalX2, originalY2, originalZ2, originalQ2, originalX3, originalY3, originalZ3, originalQ3, originalX4, originalY4, originalZ4, originalQ4, originalX5, originalY5, originalZ5 _\r
-, originalQ5)\r
-\r
-  ' Adjust coordinates based on camera position and frame depth\r
-  originalX1 = originalX1 - cameraX\r
-  originalY1 = originalY1 - cameraY\r
-  originalZ1 = originalZ1 - cameraZ\r
-  originalQ1 = originalQ1 - cameraQ - frame\r
-\r
-  originalX2 = originalX2 - cameraX\r
-  originalY2 = originalY2 - cameraY\r
-  originalZ2 = originalZ2 - cameraZ\r
-  originalQ2 = originalQ2 - cameraQ - frame\r
-\r
-  originalX3 = originalX3 - cameraX\r
-  originalY3 = originalY3 - cameraY\r
-  originalZ3 = originalZ3 - cameraZ\r
-  originalQ3 = originalQ3 - cameraQ - frame\r
-\r
-  originalX4 = originalX4 - cameraX\r
-  originalY4 = originalY4 - cameraY\r
-  originalZ4 = originalZ4 - cameraZ\r
-  originalQ4 = originalQ4 - cameraQ - frame\r
-\r
-  originalX5 = originalX5 - cameraX\r
-  originalY5 = originalY5 - cameraY\r
-  originalZ5 = originalZ5 - cameraZ\r
-  originalQ5 = originalQ5 - cameraQ - frame\r
-\r
-  ' Rotate all points based on current rotation angles\r
-  RotatePoint originalX1, originalY1, originalZ1, originalQ1, x1, y1, z1, q1\r
-  RotatePoint originalX2, originalY2, originalZ2, originalQ2, x2, y2, z2, q2\r
-  RotatePoint originalX3, originalY3, originalZ3, originalQ3, x3, y3, z3, q3\r
-  RotatePoint originalX4, originalY4, originalZ4, originalQ4, x4, y4, z4, q4\r
-  RotatePoint originalX5, originalY5, originalZ5, originalQ5, x5, y5, z5, q5\r
-\r
-  ' Initialize point counter\r
-  pointCount = 0\r
-\r
-  ' Calculate interpolated points for all edges of the pentachoron\r
-  CalculateInterpolatedLine x1, y1, z1, q1, x2, y2, z2, q2\r
-  CalculateInterpolatedLine x1, y1, z1, q1, x3, y3, z3, q3\r
-  CalculateInterpolatedLine x1, y1, z1, q1, x4, y4, z4, q4\r
-  CalculateInterpolatedLine x1, y1, z1, q1, x5, y5, z5, q5\r
-\r
-  CalculateInterpolatedLine x2, y2, z2, q2, x3, y3, z3, q3\r
-  CalculateInterpolatedLine x2, y2, z2, q2, x4, y4, z4, q4\r
-  CalculateInterpolatedLine x2, y2, z2, q2, x5, y5, z5, q5\r
-\r
-  CalculateInterpolatedLine x3, y3, z3, q3, x4, y4, z4, q4\r
-  CalculateInterpolatedLine x3, y3, z3, q3, x5, y5, z5, q5\r
-\r
-  CalculateInterpolatedLine x4, y4, z4, q4, x5, y5, z5, q5\r
-\r
-  ' Draw lines between each pair of interpolated points\r
-  FOR pointA = 1 TO pointCount\r
-    FOR pointB = pointA + 1 TO pointCount\r
-      ' Draw line with color based on frame depth (for varying brightness)\r
-      LINE (projectedX(pointA), projectedY(pointA))-(projectedX(pointB), projectedY(pointB)), 15 - frame\r
-    NEXT pointB\r
-  NEXT pointA\r
-\r
-END SUB\r
-\r
-' Subroutine to rotate a point along the specified axes\r
-SUB RotatePoint (x1, y1, z1, q1, x4, y4, z4, q4)\r
-\r
-  ' Rotate the point along the QX axis\r
-  q2 = q1 * sineQX - x1 * cosineQX\r
-  x2 = q1 * cosineQX + x1 * sineQX\r
-\r
-  ' Rotate the point along the QY axis\r
-  q3 = q2 * sineQY - y1 * cosineQY\r
-  y2 = q2 * cosineQY + y1 * sineQY\r
-\r
-  ' Rotate the point along the QZ axis\r
-  q4 = q3 * sineQZ - z1 * cosineQZ\r
-  z2 = q3 * cosineQZ + z1 * sineQZ\r
-\r
-  ' Rotate the point along the XZ axis\r
-  x3 = x2 * sineXZ - z2 * cosineXZ\r
-  z3 = x2 * cosineXZ + z2 * sineXZ\r
-\r
-  ' Rotate the point along the YZ axis\r
-  y3 = y2 * sineYZ - z3 * cosineYZ\r
-  z4 = y2 * cosineYZ + z3 * sineYZ\r
-\r
-  ' Rotate the point along the XY axis\r
-  y4 = y3 * sineXY - x3 * cosineXY\r
-  x4 = y3 * cosineXY + x3 * sineXY\r
-\r
-END SUB\r
-\r
-' Subroutine to set up the color palette\r
-SUB SetupPalette\r
-\r
-  ' Set up a grayscale color palette\r
-  FOR colorIndex = 0 TO 15\r
-    ' Set palette register\r
-    OUT &H3C8, colorIndex\r
-    ' Set RGB values (all equal for grayscale)\r
-    OUT &H3C9, colorIndex * 4\r
-    OUT &H3C9, colorIndex * 4\r
-    OUT &H3C9, colorIndex * 4\r
-    ' Draw a vertical line with this color to visualize the palette\r
-    LINE (colorIndex, 0)-(colorIndex, 400), colorIndex\r
-  NEXT colorIndex\r
-\r
-END SUB\r
-\r
diff --git a/Miscellaneous/4D engine/sshot.png b/Miscellaneous/4D engine/sshot.png
deleted file mode 100644 (file)
index 03e6e3e..0000000
Binary files a/Miscellaneous/4D engine/sshot.png and /dev/null differ
diff --git a/Miscellaneous/Alarm 1.bas b/Miscellaneous/Alarm 1.bas
new file mode 100755 (executable)
index 0000000..5e973a0
--- /dev/null
@@ -0,0 +1,57 @@
+' Program to play sound that resembles security alarm.\r
+' This program is free software: released under Creative Commons Zero (CC0) license\r
+' by Svjatoslav Agejenko.\r
+' Email: svjatoslav@svjatoslav.eu\r
+' Homepage: http://www.svjatoslav.eu\r
+'\r
+' Changelog:\r
+' ?, Initial version\r
+' 2024 - 2025, Enhanced program readability\r
+\r
+SCREEN 1\r
+CLS\r
+\r
+' Initialize main frequency control variable\r
+' This will create the oscillating siren effect by increasing/decreasing value\r
+currentFrequency = 40\r
+\r
+StartLoop:\r
+    ' Play primary oscillating tone (main siren component)\r
+    ' Frequency sweeps up and down between thresholds\r
+    SOUND currentFrequency, .3\r
+\r
+    ' Add secondary fixed-frequency component (200Hz for 1 duration unit)\r
+    ' Creates layered audio effect that makes alarm more realistic\r
+    ' Duration parameter uses QBasic's time units (1 ≈ 0.05 seconds)\r
+    SOUND 200, 1\r
+\r
+    ' Rapidly increase frequency for ascending siren sweep\r
+    ' Jump amount (100) creates dramatic pitch jumps\r
+    currentFrequency = currentFrequency + 100\r
+\r
+    ' Check if we've exceeded upper frequency threshold (1000Hz)\r
+    ' If yes, switch to descending phase\r
+    IF currentFrequency > 1000 THEN GoTo DecreaseFrequency\r
+\r
+    ' Repeat ascending sweep until reaching maximum threshold\r
+    GOTO StartLoop\r
+\r
+DecreaseFrequency:\r
+    ' Continue playing oscillating tone during descending phase\r
+    SOUND currentFrequency, .3\r
+\r
+    ' Add high-pitched pulse (500Hz for short duration)\r
+    ' Creates distinctive alarm "warble" pattern\r
+    ' Shorter duration (.2) adds rhythmic pulsing\r
+    SOUND 500, .2\r
+\r
+    ' Gradually decrease frequency for descending sweep\r
+    ' Smaller decrement (10) creates slower descent than ascent\r
+    currentFrequency = currentFrequency - 10\r
+\r
+    ' Check if we've dropped below lower threshold (200Hz)\r
+    ' If yes, restart ascending phase to complete siren cycle\r
+    IF currentFrequency < 200 THEN GoTo StartLoop\r
+\r
+    ' Continue descending sweep until reaching minimum threshold\r
+    GOTO DecreaseFrequency\r
diff --git a/Miscellaneous/Alarm 1.mp3 b/Miscellaneous/Alarm 1.mp3
new file mode 100644 (file)
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 (executable)
index 0000000..87f03c1
--- /dev/null
@@ -0,0 +1,34 @@
+' This program generates a security alarm sound effect with two alternating patterns\r
+\r
+DEFINT A-Z\r
+\r
+' Start of infinite alarm cycle\r
+1\r
+\r
+    ' Pattern 1: Ascending frequency sweep with counterpoint tone\r
+    ' Increase primary frequency from 100Hz to 1000Hz in steps of 3Hz\r
+    FOR ascendingFrequency = 100 TO 1000 STEP 3\r
+        ' Play main ascending tone\r
+        SOUND ascendingFrequency, .05\r
+\r
+        ' Generate counterpoint tone that decreases as primary increases\r
+        ' Formula creates complementary frequency by subtracting double current frequency\r
+        ' At 100Hz -> 5000-2*100=4800Hz; At 1000Hz -> 5000-2*1000=3000Hz\r
+        counterToneFrequency = 5000 - (ascendingFrequency * 2)\r
+        SOUND counterToneFrequency, .1\r
+    NEXT ascendingFrequency\r
+\r
+    ' Pattern 2: Descending frequency sweep with harmonic enhancement\r
+    ' Decrease frequency from 1000Hz back to 100Hz in larger steps (-5)\r
+    FOR descendingFrequency = 1000 TO 100 STEP -5\r
+        ' Play main descending tone \r
+        SOUND descendingFrequency, .05\r
+\r
+        ' Add harmonic overtone at triple frequency plus small offset\r
+        ' Creates richer, more complex sound texture\r
+        harmonicFrequency = (descendingFrequency * 3) + 10\r
+        SOUND harmonicFrequency, .05\r
+    NEXT descendingFrequency\r
+\r
+' Continuously repeat between both sound patterns\r
+GOTO 1\r
diff --git a/Miscellaneous/Alarm 2.mp3 b/Miscellaneous/Alarm 2.mp3
new file mode 100644 (file)
index 0000000..c00ecf5
Binary files /dev/null and b/Miscellaneous/Alarm 2.mp3 differ
index 6f5af43..3e67a5a 100644 (file)
@@ -3,7 +3,7 @@
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-<!-- 2025-07-29 ti 17:34 -->
+<!-- 2025-07-30 ke 01:30 -->
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 <title>Mouse driver for QBasic programs</title>
 <h2>Table of Contents</h2>
 <div id="text-table-of-contents" role="doc-toc">
 <ul>
-<li><a href="#org8632d57">1. Overview</a>
-<ul>
-<li><a href="#org5459e43">1.1. Terminate and Stay Resident module</a></li>
-<li><a href="#org3af7c6b">1.2. QBasic demonstration program</a></li>
-</ul>
-</li>
+<li><a href="#org1fde56c">1. Overview</a></li>
+<li><a href="#org388eb3d">2. High-level idea</a></li>
+<li><a href="#org961c40e">3. Terminate and Stay Resident module</a></li>
+<li><a href="#org03180d5">4. QBasic demonstration program</a></li>
 </ul>
 </div>
 </div>
 
-<div id="outline-container-org8632d57" class="outline-2">
-<h2 id="org8632d57"><span class="section-number-2">1.</span> Overview</h2>
+<div id="outline-container-org1fde56c" class="outline-2">
+<h2 id="org1fde56c"><span class="section-number-2">1.</span> Overview</h2>
 <div class="outline-text-2" id="text-1">
 <p>
 QBasic, a popular programming language in the DOS era, lacks native
 mouse support. This limitation can be a hurdle for developers looking
 to create interactive applications. To bridge this gap, I developed a
-solution that involves a Terminate and Stay Resident (TSR) program
-written in x86 assembly and a QBasic demonstration program.
+workaround that allows QBasic to use mouse input.
+</p>
+</div>
+</div>
+
+<div id="outline-container-org388eb3d" class="outline-2">
+<h2 id="org388eb3d"><span class="section-number-2">2.</span> High-level idea</h2>
+<div class="outline-text-2" id="text-2">
+<p>
+Workaround to access mouse involves a Terminate and Stay Resident
+(TSR) program written in x86 assembly. This TSR program must be
+started before running QBasic program that depends on mouse. This TSR
+program hooks into the system's interrupt mechanism, specifically the
+timer interrupt (IRQ 0), allowing it to regularly check for mouse
+activity several times per second.
 </p>
 
+<p>
+When this timer interrupt triggers, the TSR reads the latest mouse's
+horizontal and vertical movements and button states using mouse
+interrupts. This data is then stored in a dedicated memory location —
+a data table within the TSR's memory space. The TSR uses interrupt 79h
+as a pointer to this data table, making it accessible to other
+programs, including the QBasic application.
+</p>
 
 <p>
-The solution comprises two main components:
+While QBasic originally is not able to read mouse, it is able to read
+(and write) arbitrary location in system RAM. The QBasic demonstration
+program begins by retrieving the address of the TSR mouse data table
+from the interrupt vector table using interrupt 79h. By checking a
+predefined magic number (1983) in the data table, the program confirms
+that the mouse driver is loaded. Once verified, the QBasic program
+continuously reads mouse data from this shared memory location, while
+TSR keeps updating it with latest mouse state simultaneously.
 </p>
 </div>
+</div>
 
-
-<div id="outline-container-org5459e43" class="outline-3">
-<h3 id="org5459e43"><span class="section-number-3">1.1.</span> Terminate and Stay Resident module</h3>
-<div class="outline-text-3" id="text-1-1">
+<div id="outline-container-org961c40e" class="outline-2">
+<h2 id="org961c40e"><span class="section-number-2">3.</span> Terminate and Stay Resident module</h2>
+<div class="outline-text-2" id="text-3">
 <p>
 A DOS TSR program that hooks into the system's interrupt mechanism to
 regularly read mouse input and store it in a dedicated memory
@@ -258,9 +284,9 @@ Files:
 </div>
 
 
-<div id="outline-container-org3af7c6b" class="outline-3">
-<h3 id="org3af7c6b"><span class="section-number-3">1.2.</span> QBasic demonstration program</h3>
-<div class="outline-text-3" id="text-1-2">
+<div id="outline-container-org03180d5" class="outline-2">
+<h2 id="org03180d5"><span class="section-number-2">4.</span> QBasic demonstration program</h2>
+<div class="outline-text-2" id="text-4">
 <p>
 A QBasic program that reads mouse data from the memory location
 populated by the TSR and demonstrates mouse movement and button
@@ -269,7 +295,7 @@ clicks.
 
 
 
-<div id="org01b4c43" class="figure">
+<div id="org29d9d17" class="figure">
 <p><a href="mousedrv.bas" class="responsive-img"><img src="screenshot.png" alt="screenshot.png" class="responsive-img" /></a>
 </p>
 </div>
@@ -280,9 +306,8 @@ clicks.
 </div>
 </div>
 </div>
-</div>
 <div id="postamble" class="status">
-<p class="date">Created: 2025-07-29 ti 17:34</p>
+<p class="date">Created: 2025-07-30 ke 01:30</p>
 <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
 </div>
 </body>
index 338e706..e87e35a 100644 (file)
@@ -50,6 +50,27 @@ Files:
 - [[file:qbext.com][qbext.com - binary COM executable for DOS]]\r
 \r
 \r
+Here is the detailed technical specification for an in-memory table\r
+used to exchange mouse coordinates between a TSR program and a QBasic\r
+program.\r
+\r
+| Offset | Size (bytes) | Description             |\r
+|--------+--------------+-------------------------|\r
+|   0x00 |            2 | Magic Number (1983)     |\r
+|   0x02 |            2 | Horizontal Movement (X) |\r
+|   0x04 |            2 | Vertical Movement (Y)   |\r
+|   0x06 |            2 | Button Status           |\r
+|   0x08 |            1 | Update counter          |\r
+\r
+- Update counter :: Signals to the QBasic program that new mouse data\r
+  is available in the shared memory table. It ensures that the QBasic\r
+  program only reads fresh data and avoids processing outdated or\r
+  repeated data. When the TSR updates the mouse data, it increments\r
+  this flag by 1 to signal the QBasic program that new data is\r
+  available. QBasic can compare this number against last retrieved\r
+  value. If value has been increased, then there had been update\r
+  meanwhile.\r
+\r
 * QBasic demonstration program\r
 \r
 A QBasic program that reads mouse data from the memory location\r
@@ -62,3 +83,8 @@ clicks.
 [[file:mousedrv.bas][file:screenshot.png]]\r
 \r
 [[file:mousedrv.bas][mousedrv.bas - source code]]\r
+\r
+Here are more practical examples where this mouse driver is being\r
+used: Within [[https://www3.svjatoslav.eu/projects/qbasicapps/3D%20GFX/Space/index.html][Space themed 3D graphics]], see:\r
+- Galaxy explorer\r
+- Universe explorer\r
diff --git a/Miscellaneous/alarm 1.bas b/Miscellaneous/alarm 1.bas
deleted file mode 100755 (executable)
index 5e973a0..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-' Program to play sound that resembles security alarm.\r
-' This program is free software: released under Creative Commons Zero (CC0) license\r
-' by Svjatoslav Agejenko.\r
-' Email: svjatoslav@svjatoslav.eu\r
-' Homepage: http://www.svjatoslav.eu\r
-'\r
-' Changelog:\r
-' ?, Initial version\r
-' 2024 - 2025, Enhanced program readability\r
-\r
-SCREEN 1\r
-CLS\r
-\r
-' Initialize main frequency control variable\r
-' This will create the oscillating siren effect by increasing/decreasing value\r
-currentFrequency = 40\r
-\r
-StartLoop:\r
-    ' Play primary oscillating tone (main siren component)\r
-    ' Frequency sweeps up and down between thresholds\r
-    SOUND currentFrequency, .3\r
-\r
-    ' Add secondary fixed-frequency component (200Hz for 1 duration unit)\r
-    ' Creates layered audio effect that makes alarm more realistic\r
-    ' Duration parameter uses QBasic's time units (1 ≈ 0.05 seconds)\r
-    SOUND 200, 1\r
-\r
-    ' Rapidly increase frequency for ascending siren sweep\r
-    ' Jump amount (100) creates dramatic pitch jumps\r
-    currentFrequency = currentFrequency + 100\r
-\r
-    ' Check if we've exceeded upper frequency threshold (1000Hz)\r
-    ' If yes, switch to descending phase\r
-    IF currentFrequency > 1000 THEN GoTo DecreaseFrequency\r
-\r
-    ' Repeat ascending sweep until reaching maximum threshold\r
-    GOTO StartLoop\r
-\r
-DecreaseFrequency:\r
-    ' Continue playing oscillating tone during descending phase\r
-    SOUND currentFrequency, .3\r
-\r
-    ' Add high-pitched pulse (500Hz for short duration)\r
-    ' Creates distinctive alarm "warble" pattern\r
-    ' Shorter duration (.2) adds rhythmic pulsing\r
-    SOUND 500, .2\r
-\r
-    ' Gradually decrease frequency for descending sweep\r
-    ' Smaller decrement (10) creates slower descent than ascent\r
-    currentFrequency = currentFrequency - 10\r
-\r
-    ' Check if we've dropped below lower threshold (200Hz)\r
-    ' If yes, restart ascending phase to complete siren cycle\r
-    IF currentFrequency < 200 THEN GoTo StartLoop\r
-\r
-    ' Continue descending sweep until reaching minimum threshold\r
-    GOTO DecreaseFrequency\r
diff --git a/Miscellaneous/alarm 1.mp3 b/Miscellaneous/alarm 1.mp3
deleted file mode 100644 (file)
index eec2000..0000000
Binary files a/Miscellaneous/alarm 1.mp3 and /dev/null differ
diff --git a/Miscellaneous/alarm 2.bas b/Miscellaneous/alarm 2.bas
deleted file mode 100755 (executable)
index 87f03c1..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-' This program generates a security alarm sound effect with two alternating patterns\r
-\r
-DEFINT A-Z\r
-\r
-' Start of infinite alarm cycle\r
-1\r
-\r
-    ' Pattern 1: Ascending frequency sweep with counterpoint tone\r
-    ' Increase primary frequency from 100Hz to 1000Hz in steps of 3Hz\r
-    FOR ascendingFrequency = 100 TO 1000 STEP 3\r
-        ' Play main ascending tone\r
-        SOUND ascendingFrequency, .05\r
-\r
-        ' Generate counterpoint tone that decreases as primary increases\r
-        ' Formula creates complementary frequency by subtracting double current frequency\r
-        ' At 100Hz -> 5000-2*100=4800Hz; At 1000Hz -> 5000-2*1000=3000Hz\r
-        counterToneFrequency = 5000 - (ascendingFrequency * 2)\r
-        SOUND counterToneFrequency, .1\r
-    NEXT ascendingFrequency\r
-\r
-    ' Pattern 2: Descending frequency sweep with harmonic enhancement\r
-    ' Decrease frequency from 1000Hz back to 100Hz in larger steps (-5)\r
-    FOR descendingFrequency = 1000 TO 100 STEP -5\r
-        ' Play main descending tone \r
-        SOUND descendingFrequency, .05\r
-\r
-        ' Add harmonic overtone at triple frequency plus small offset\r
-        ' Creates richer, more complex sound texture\r
-        harmonicFrequency = (descendingFrequency * 3) + 10\r
-        SOUND harmonicFrequency, .05\r
-    NEXT descendingFrequency\r
-\r
-' Continuously repeat between both sound patterns\r
-GOTO 1\r
diff --git a/Miscellaneous/alarm 2.mp3 b/Miscellaneous/alarm 2.mp3
deleted file mode 100644 (file)
index c00ecf5..0000000
Binary files a/Miscellaneous/alarm 2.mp3 and /dev/null differ
index 6995bad..fda7e27 100644 (file)
--- a/index.org
+++ b/index.org
@@ -247,8 +247,7 @@ filled with colors that alternate to create a checkerboard pattern.
 </div>
 #+end_export
 
-
-[[file:3D%20GFX/3D%20land.bas][3D land.bas]]
+Download source code: [[file:3D%20GFX/3D%20land.bas][3D land.bas]]
 
 #+INCLUDE: "3D GFX/3D land.bas" src basic-qb45
 
@@ -475,6 +474,10 @@ patterns and trends in lottery numbers over time. The program reads
 data from a text file and offers multiple visualization options to
 help users understand the data better.
 
+Note: In the example data there are made-up numbers and there are
+repetitions in example data on-purpose. Those repeating patterns
+become easily detectable in visual graphs.
+
 #+attr_html: :class responsive-img
 #+attr_latex: :width 1000px
 [[file:Math/Lottery/Lottery%20analysis.bas][file:Math/Lottery/screenshot,%203.png]]
@@ -568,6 +571,152 @@ The dithering process helps to mitigate the limitations of the
 #+attr_latex: :width 1000px
 [[file:Miscellaneous/Custom%20palette.bas][file:Miscellaneous/Custom%20palette,%203.png]]
 
+** Alarm 1
+
+This QBasic program simulates the sound of a security alarm siren. It
+creates an oscillating sound effect by varying the frequency of the
+primary tone, mimicking the familiar rise-and-fall pattern of a siren.
+
+The program works by initializing a frequency variable and playing a
+primary oscillating tone alongside secondary fixed-frequency
+tones. This combination produces a realistic alarm sound. The
+frequency of the primary tone increases and decreases within set
+thresholds, controlled by conditional checks and loops.
+
+#+begin_export html
+<div class="flex-center">
+  <audio controls>
+    <source src="Miscellaneous/Alarm 1.mp3" type="audio/mpeg">
+    Your browser does not support the audio element.
+  </audio>
+</div>
+#+end_export
+
+#+INCLUDE: "Miscellaneous/Alarm 1.bas" src basic-qb45
+
+Download source code: [[file:Miscellaneous/Alarm,%201.bas][Alarm 1.bas]]
+
+** Alarm 2
+
+This QBasic program generates a security alarm sound effect by
+alternating between two distinct audio patterns. The first pattern
+features an ascending sweep of frequencies from 100 Hz to 1000 Hz,
+paired with a counterpoint tone that decreases in frequency. The
+second pattern involves a descending sweep from 1000 Hz back to 100
+Hz, enhanced with a harmonic overtone to create a richer sound
+texture.
+
+#+begin_export html
+<div class="flex-center">
+  <audio controls>
+    <source src="Miscellaneous/Alarm 2.mp3" type="audio/mpeg">
+    Your browser does not support the audio element.
+  </audio>
+</div>
+#+end_export
+
+#+INCLUDE: "Miscellaneous/Alarm 2.bas" src basic-qb45
+
+Download source code: [[file:Miscellaneous/Alarm,%202.bas][Alarm 2.bas]]
+
+** 4D engine
+
+Implementation of 4 dimensional (4D) engine. It's like 3D (X, Y, Z)
+but with additional extra dimension that I decided to call Q.
+
+*** Polygon -> Tetrahedron -> Pentatope
+
+- In 2D world you can have polygon. It takes 3 vertices (points) to
+  define. It is the minimal object in 2D world to have surface.
+
+- In 3D world you can have tetrahedron. It takes 4 vertices to
+  define. It is the minimal object in 3D world to have volume.
+
+- In 4D world you can have 5-cell (aka. pentatope). It takes 5
+  vertices to define. It is the minimal object in 4D world to have
+  hypervolume (aka. 4D volume).
+
+
+*** Planes or rotation in 3D world vs 4D world
+
+In 3D space, the planes of rotation correspond to rotations around the
+three principal axes, and they are as follows:
+
+- The yz-plane, corresponding to rotation around the x-axis.
+- The xz-plane, corresponding to rotation around the y-axis.
+- The xy-plane, corresponding to rotation around the z-axis.
+
+
+In 4D space, there are six possible planes of rotation, which can be
+described by the combinations of two axes out of four. These are:
+
+- The yz-plane (same as in 3D space)
+- The xz-plane (same as in 3D space)
+- The xy-plane (same as in 3D space)
+- The xq-plane (novel plane)
+- The yq-plane (novel plane)
+- The zq-plane (novel plane)
+
+*** Representing higher-dimensional objects through lower-dimensional slices
+
+The concept of representing higher-dimensional objects through
+lower-dimensional slices involves taking cross-sections along one
+dimension and viewing the resulting shapes.
+
+Here’s how it applies to both 3D to 2D and 4D to 3D representations:
+
+- *Representing a 3D Shape in 2D*:
+  - A 3D object can be represented as a series of 2D slices by taking
+    cross-sections along one axis (e.g., the z-axis). Each slice is a
+    flat, 2D shape that corresponds to the intersection of the 3D
+    object with a plane at a particular position along that axis.
+  - By stacking these 2D slices together in sequence, you can
+    reconstruct the 3D object. This method is akin to how CT scans
+    create images of the inside of a body by combining multiple
+    cross-sectional X-ray images.
+
+- *Representing a 4D Object in 3D*:
+  - Similarly, a 4D object can be represented in 3D space by taking
+    cross-sections along the fourth dimension. Each cross-section is a
+    3D shape that represents the intersection of the 4D object with a
+    hyperplane at a particular position along the fourth axis (e.g.,
+    Q-axis).
+  - By viewing these 3D slices in sequence, you can form an idea of
+    the structure and shape of the 4D object. This process allows us
+    to visualize a 4D object by observing how the 3D cross-sections
+    change over the fourth dimension.
+
+In both cases, the method of "slicing" allows us to understand and
+visualize objects in dimensions that we cannot directly perceive, by
+breaking them down into more manageable and comprehensible
+lower-dimensional pieces.
+
+*** Implementation
+
+Current 4D engine renders single pentatope. Each pentatope vertex is
+defined by 4 coordinates within 4D space:X, Y, Z, Q.
+
+You can rotate pentatope around any plane in 4D space (all 6 are
+supported). Also you as a viewer can move around any axis in 4D space
+(all 4 are supported).
+
+4D pentatope is shown on a screen as a series of 3D slices with
+varying brightness along the new Q axis.
+
+Wireframe rendering is quite useful in this case because it allows to
+see multiple overlayed 3D shapes at the same time.
+
+#+attr_html: :class responsive-img
+#+attr_latex: :width 1000px
+[[file:Miscellaneous/4D%20engine.bas][file:Miscellaneous/4D%20engine.png]]
+
+It is interesting how 3D slices of 4D pentatope stay as familiar
+tetrahedrons while you rotate the shape along familiar X,Y,Z axis. But
+shape starts changing in weird ways when you start rotating it along
+novel planes of 4D space.
+
+Download source code: [[file:Miscellaneous/4D%20engine.bas][4D engine.bas]]
+
 * Download
 ** Getting the source code