Minor wording update
[sixth-3d-demos.git] / doc / index.html
1 <!doctype html>
2 <html lang="en">
3 <head>
4 <title>Sixth 3D engine demos</title>
5 <!-- 2020-01-29 K 21:40 -->
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width, initial-scale=1">
8 <meta name="generator" content="Org-mode">
9 <meta name="author" content="Svjatoslav Agejenko">
10 <link href="https://bootswatch.com/3/darkly/bootstrap.min.css" rel="stylesheet">
11 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
12 <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
13 <style type="text/css">
14 footer {background-color: #111 !important;}
15 pre {background-color: #111; color: #ccc;}
16 </style>
17 <style type="text/css">
18 /* org mode styles on top of twbs */
19
20 html {
21     position: relative;
22     min-height: 100%;
23 }
24
25 body {
26     font-size: 18px;
27     margin-bottom: 105px;
28 }
29
30 footer {
31     position: absolute;
32     bottom: 0;
33     width: 100%;
34     height: 101px;
35     background-color: #f5f5f5;
36 }
37
38 footer > div {
39     padding: 10px;
40 }
41
42 footer p {
43     margin: 0 0 5px;
44     text-align: center;
45     font-size: 16px;
46 }
47
48 #table-of-contents {
49     margin-top: 20px;
50     margin-bottom: 20px;
51 }
52
53 blockquote p {
54     font-size: 18px;
55 }
56
57 pre {
58     font-size: 16px;
59 }
60
61 .footpara {
62     display: inline-block;
63 }
64
65 figcaption {
66   font-size: 16px;
67   color: #666;
68   font-style: italic;
69   padding-bottom: 15px;
70 }
71
72 /* from twbs docs */
73
74 .bs-docs-sidebar.affix {
75     position: static;
76 }
77 @media (min-width: 768px) {
78     .bs-docs-sidebar {
79         padding-left: 20px;
80     }
81 }
82
83 /* All levels of nav */
84 .bs-docs-sidebar .nav > li > a {
85     display: block;
86     padding: 4px 20px;
87     font-size: 14px;
88     font-weight: 500;
89     color: #999;
90 }
91 .bs-docs-sidebar .nav > li > a:hover,
92 .bs-docs-sidebar .nav > li > a:focus {
93     padding-left: 19px;
94     color: #A1283B;
95     text-decoration: none;
96     background-color: transparent;
97     border-left: 1px solid #A1283B;
98 }
99 .bs-docs-sidebar .nav > .active > a,
100 .bs-docs-sidebar .nav > .active:hover > a,
101 .bs-docs-sidebar .nav > .active:focus > a {
102     padding-left: 18px;
103     font-weight: bold;
104     color: #A1283B;
105     background-color: transparent;
106     border-left: 2px solid #A1283B;
107 }
108
109 /* Nav: second level (shown on .active) */
110 .bs-docs-sidebar .nav .nav {
111     display: none; /* Hide by default, but at >768px, show it */
112     padding-bottom: 10px;
113 }
114 .bs-docs-sidebar .nav .nav > li > a {
115     padding-top: 1px;
116     padding-bottom: 1px;
117     padding-left: 30px;
118     font-size: 12px;
119     font-weight: normal;
120 }
121 .bs-docs-sidebar .nav .nav > li > a:hover,
122 .bs-docs-sidebar .nav .nav > li > a:focus {
123     padding-left: 29px;
124 }
125 .bs-docs-sidebar .nav .nav > .active > a,
126 .bs-docs-sidebar .nav .nav > .active:hover > a,
127 .bs-docs-sidebar .nav .nav > .active:focus > a {
128     padding-left: 28px;
129     font-weight: 500;
130 }
131
132 /* Nav: third level (shown on .active) */
133 .bs-docs-sidebar .nav .nav .nav {
134     padding-bottom: 10px;
135 }
136 .bs-docs-sidebar .nav .nav .nav > li > a {
137     padding-top: 1px;
138     padding-bottom: 1px;
139     padding-left: 40px;
140     font-size: 12px;
141     font-weight: normal;
142 }
143 .bs-docs-sidebar .nav .nav .nav > li > a:hover,
144 .bs-docs-sidebar .nav .nav .nav > li > a:focus {
145     padding-left: 39px;
146 }
147 .bs-docs-sidebar .nav .nav .nav > .active > a,
148 .bs-docs-sidebar .nav .nav .nav > .active:hover > a,
149 .bs-docs-sidebar .nav .nav .nav > .active:focus > a {
150     padding-left: 38px;
151     font-weight: 500;
152 }
153
154 /* Show and affix the side nav when space allows it */
155 @media (min-width: 992px) {
156     .bs-docs-sidebar .nav > .active > ul {
157         display: block;
158     }
159     /* Widen the fixed sidebar */
160     .bs-docs-sidebar.affix,
161     .bs-docs-sidebar.affix-bottom {
162         width: 213px;
163     }
164     .bs-docs-sidebar.affix {
165         position: fixed; /* Undo the static from mobile first approach */
166         top: 20px;
167     }
168     .bs-docs-sidebar.affix-bottom {
169         position: absolute; /* Undo the static from mobile first approach */
170     }
171     .bs-docs-sidebar.affix .bs-docs-sidenav,.bs-docs-sidebar.affix-bottom .bs-docs-sidenav {
172         margin-top: 0;
173         margin-bottom: 0
174     }
175 }
176 @media (min-width: 1200px) {
177     /* Widen the fixed sidebar again */
178     .bs-docs-sidebar.affix-bottom,
179     .bs-docs-sidebar.affix {
180         width: 263px;
181     }
182 }
183 </style>
184 <script type="text/javascript">
185 $(function() {
186     'use strict';
187
188     $('.bs-docs-sidebar li').first().addClass('active');
189
190     $(document.body).scrollspy({target: '.bs-docs-sidebar'});
191
192     $('.bs-docs-sidebar').affix();
193 });
194 </script>
195 </head>
196 <body>
197 <div id="content" class="container">
198 <div class="row"><div class="col-md-9"><h1 class="title">Sixth 3D engine demos</h1>
199
200 <div id="outline-container-sec-1" class="outline-2">
201 <h2 id="sec-1"><span class="section-number-2">1</span> General</h2>
202 <div class="outline-text-2" id="text-1">
203 <ul class="org-ul">
204 <li>This is a subproject of <a href="https://www3.svjatoslav.eu/projects/sixth-3d/">Sixth 3D</a>:
205 <ul class="org-ul">
206 <li>which in turn is a subproject of parent project <a href="https://www3.svjatoslav.eu/projects/sixth/">Sixth</a>.
207 </li>
208 </ul>
209 </li>
210
211 <li>This program is free software: you can redistribute it and/or modify
212 it under the terms of the <a href="https://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a> as
213 published by the Free Software Foundation, either version 3 of the
214 License, or (at your option) any later version.
215 </li>
216
217 <li>Program author:
218 <ul class="org-ul">
219 <li>Svjatoslav Agejenko
220 </li>
221 <li>Homepage: <a href="https://svjatoslav.eu">https://svjatoslav.eu</a>
222 </li>
223 <li>Email: <a href="mailto://svjatoslav@svjatoslav.eu">mailto://svjatoslav@svjatoslav.eu</a>
224 </li>
225 </ul>
226 </li>
227
228 <li><a href="https://www.svjatoslav.eu/projects/">Other software projects hosted at svjatoslav.eu</a>
229 </li>
230 </ul>
231 </div>
232
233 <div id="outline-container-sec-1-1" class="outline-3">
234 <h3 id="sec-1-1"><span class="section-number-3">1.1</span> Source code</h3>
235 <div class="outline-text-3" id="text-1-1">
236 <ul class="org-ul">
237 <li><a href="https://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=snapshot;h=HEAD;sf=tgz">Download latest snapshot in TAR GZ format</a>
238 </li>
239
240 <li><a href="https://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=summary">Browse Git repository online</a>
241 </li>
242
243 <li>Clone Git repository using command:
244 <pre class="example">
245 git clone https://www2.svjatoslav.eu/git/sixth-3d-demos.git
246
247 </pre>
248 </li>
249 </ul>
250 </div>
251 </div>
252 </div>
253
254 <div id="outline-container-sec-2" class="outline-2">
255 <h2 id="sec-2"><span class="section-number-2">2</span> Overview</h2>
256 <div class="outline-text-2" id="text-2">
257 <p>
258 Goal of this project is to show off capabilities and API usage of
259 <a href="https://www3.svjatoslav.eu/projects/sixth-3d/">Sixth 3D</a> engine.
260 </p>
261
262 <p>
263 All sample scenes below are rendered at interactive framerates.
264 </p>
265 </div>
266 </div>
267 <div id="outline-container-sec-3" class="outline-2">
268 <h2 id="sec-3"><span class="section-number-2">3</span> Navigating in space</h2>
269 <div class="outline-text-2" id="text-3">
270 <table class="table table-striped table-bordered table-hover table-condensed">
271
272
273 <colgroup>
274 <col  class="left">
275
276 <col  class="left">
277 </colgroup>
278 <thead>
279 <tr>
280 <th scope="col" class="text-left">key</th>
281 <th scope="col" class="text-left">result</th>
282 </tr>
283 </thead>
284 <tbody>
285 <tr>
286 <td class="text-left">cursor keys</td>
287 <td class="text-left">move: left, right, forward, backward</td>
288 </tr>
289
290 <tr>
291 <td class="text-left">mouse scroll wheel</td>
292 <td class="text-left">move: up, down</td>
293 </tr>
294
295 <tr>
296 <td class="text-left">dragging with mouse</td>
297 <td class="text-left">look around</td>
298 </tr>
299 </tbody>
300 </table>
301 </div>
302 </div>
303
304 <div id="outline-container-sec-4" class="outline-2">
305 <h2 id="sec-4"><span class="section-number-2">4</span> Example applications in this repository</h2>
306 <div class="outline-text-2" id="text-4">
307 </div><div id="outline-container-sec-4-1" class="outline-3">
308 <h3 id="sec-4-1"><span class="section-number-3">4.1</span> Raytracing through voxels</h3>
309 <div class="outline-text-3" id="text-4-1">
310
311 <figure>
312 <p><img src="screenshots/raytracing fractal in voxel polygon hybrid scene.png" class="img-responsive" alt="raytracing fractal in voxel polygon hybrid scene.png">
313 </p>
314 </figure>
315
316 <p>
317 Test scene that is generated simultaneously using:
318 </p>
319 <ul class="org-ul">
320 <li>conventional polygons
321 <ul class="org-ul">
322 <li>for realtime navigation, and
323 </li>
324 </ul>
325 </li>
326 <li>voxels
327 <ul class="org-ul">
328 <li>for on-demand raytracing
329 </li>
330 </ul>
331 </li>
332 </ul>
333
334 <p>
335 Instead of storing voxels in dumb [X * Y * Z] array, dynamically
336 partitioned <a href="https://en.wikipedia.org/wiki/Octree">octree</a> is used to compress data. Press "r" key anywhere in
337 the scene to raytrace current view through compressed voxel
338 datastructure.
339 </p>
340 </div>
341 </div>
342
343 <div id="outline-container-sec-4-2" class="outline-3">
344 <h3 id="sec-4-2"><span class="section-number-3">4.2</span> Conway's Game of Life</h3>
345 <div class="outline-text-3" id="text-4-2">
346 <p>
347 The Game of Life, also known simply as Life, is a cellular automaton
348 devised by the British mathematician John Horton Conway in 1970.
349 </p>
350
351 <ul class="org-ul">
352 <li><a href="https://en.wikipedia.org/wiki/Conway's_Game_of_Life">https://en.wikipedia.org/wiki/Conway's_Game_of_Life</a>
353 <ul class="org-ul">
354 <li>Game rules:
355 <ul class="org-ul">
356 <li>2 cell states: alive / dead
357 </li>
358 <li>Each cell sees 8 neighboring cells.
359 </li>
360 <li>If alive cell neighbors count is 2 or 3, then cell survives,
361 otherwise it dies.
362 </li>
363 <li>Dead cell becomes alive if neighbors count is exactly 3.
364 </li>
365 </ul>
366 </li>
367 </ul>
368 </li>
369 </ul>
370
371
372 <figure>
373 <p><img src="screenshots/life.png" class="img-responsive" alt="life.png">
374 </p>
375 </figure>
376
377 <p>
378 Current application projects 2D game grid/matrix onto three
379 dimensional space. Extra dimension (height) is used to visualize
380 history (previous iterations) using glowing dots suspended in space.
381 </p>
382
383 <p>
384 Usage:
385 </p>
386 <table class="table table-striped table-bordered table-hover table-condensed">
387
388
389 <colgroup>
390 <col  class="left">
391
392 <col  class="left">
393 </colgroup>
394 <thead>
395 <tr>
396 <th scope="col" class="text-left">key</th>
397 <th scope="col" class="text-left">result</th>
398 </tr>
399 </thead>
400 <tbody>
401 <tr>
402 <td class="text-left">mouse click on the cell (cell)</td>
403 <td class="text-left">toggles cell state</td>
404 </tr>
405
406 <tr>
407 <td class="text-left">&lt;space&gt;</td>
408 <td class="text-left">next iteration</td>
409 </tr>
410
411 <tr>
412 <td class="text-left">ENTER</td>
413 <td class="text-left">next iteeration with the history</td>
414 </tr>
415
416 <tr>
417 <td class="text-left">"c"</td>
418 <td class="text-left">clear the matrix</td>
419 </tr>
420 </tbody>
421 </table>
422 </div>
423 </div>
424
425 <div id="outline-container-sec-4-3" class="outline-3">
426 <h3 id="sec-4-3"><span class="section-number-3">4.3</span> Text editors</h3>
427 <div class="outline-text-3" id="text-4-3">
428
429 <figure>
430 <p><img src="screenshots/text editors.png" class="img-responsive" alt="text editors.png">
431 </p>
432 </figure>
433
434 <p>
435 Initial test for creating user interfaces in 3D and:
436 </p>
437 <ul class="org-ul">
438 <li>window focus handling
439 </li>
440 <li>picking objecs using mouse
441 </li>
442 <li>redirecting keyboard input to focused window
443 </li>
444 </ul>
445
446
447 <p>
448 Window focus acts like a stack.
449 </p>
450
451 <p>
452 When window is clicked with the mouse, previously focused window (if
453 any) is pushed to the focus stack and new window receives focus. Red
454 frame appears around the window to indicate this.
455 </p>
456
457 <p>
458 When ESC key is pressed, window focus is returned to previous window
459 (if any).
460 </p>
461
462 <p>
463 When any window is focused, all keyboard input is redirected to that
464 window, including cursor keys. To be able to navigate around the world
465 again, window must be unfocused first using ESC key.
466 </p>
467
468
469 <ul class="org-ul">
470 <li>TODO:
471 <ul class="org-ul">
472 <li>Improve focus handling:
473 <ul class="org-ul">
474 <li>Perhaps add shortcut to navigate world without exiting entire
475 stack of focus.
476 </li>
477 <li>Possibility to retain and reuse recently focused elements.
478 </li>
479 <li>Store user location in the world and view direction with the
480 focused window. So that when returning focus to far away object,
481 user is redirected also to proper location in the world.
482 </li>
483 </ul>
484 </li>
485 <li>Possibility to store recently visited locations in the world and
486 return to them.
487 </li>
488 </ul>
489 </li>
490 </ul>
491 </div>
492 </div>
493 <div id="outline-container-sec-4-4" class="outline-3">
494 <h3 id="sec-4-4"><span class="section-number-3">4.4</span> Mathematical formulas</h3>
495 <div class="outline-text-3" id="text-4-4">
496
497 <figure>
498 <p><img src="screenshots/mathematical formulas.png" class="img-responsive" alt="mathematical formulas.png">
499 </p>
500 </figure>
501
502 <ul class="org-ul">
503 <li>TODO: instead of projecting 2D visualizations onto 3D space,
504 visualize some formula using all 3 dimensions avaliable.
505 </li>
506 </ul>
507 </div>
508 </div>
509 <div id="outline-container-sec-4-5" class="outline-3">
510 <h3 id="sec-4-5"><span class="section-number-3">4.5</span> Sinus heightmaps and sphere</h3>
511 <div class="outline-text-3" id="text-4-5">
512
513 <figure>
514 <p><img src="screenshots/sinus heightmaps and sphere.png" class="img-responsive" alt="sinus heightmaps and sphere.png">
515 </p>
516 </figure>
517
518 <p>
519 Simple test scene. Easy to implement and looks nice.
520 </p>
521 </div>
522 </div>
523 </div>
524 </div><div class="col-md-3"><nav id="table-of-contents">
525 <div id="text-table-of-contents" class="bs-docs-sidebar">
526 <ul class="nav">
527 <li><a href="#sec-1">1. General</a>
528 <ul class="nav">
529 <li><a href="#sec-1-1">1.1. Source code</a></li>
530 </ul>
531 </li>
532 <li><a href="#sec-2">2. Overview</a></li>
533 <li><a href="#sec-3">3. Navigating in space</a></li>
534 <li><a href="#sec-4">4. Example applications in this repository</a>
535 <ul class="nav">
536 <li><a href="#sec-4-1">4.1. Raytracing through voxels</a></li>
537 <li><a href="#sec-4-2">4.2. Conway's Game of Life</a></li>
538 <li><a href="#sec-4-3">4.3. Text editors</a></li>
539 <li><a href="#sec-4-4">4.4. Mathematical formulas</a></li>
540 <li><a href="#sec-4-5">4.5. Sinus heightmaps and sphere</a></li>
541 </ul>
542 </li>
543 </ul>
544 </div>
545 </nav>
546 </div></div></div>
547 <footer id="postamble" class="">
548 <div><p class="author">Author: Svjatoslav Agejenko</p>
549 <p class="date">Created: 2020-01-29 K 21:40</p>
550 <p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 26.1 (<a href="http://orgmode.org">Org-mode</a> 9.1.9)</p>
551 </div>
552 </footer>
553 </body>
554 </html>