1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
6 <!-- 2021-05-29 Sat 05:01 -->
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 <meta name="viewport" content="width=device-width, initial-scale=1" />
9 <title>Sixth 3D engine demos</title>
10 <meta name="generator" content="Org mode" />
11 <meta name="author" content="Svjatoslav Agejenko" />
12 <style type="text/css">
13 <!--/*--><![CDATA[/*><!--*/
14 .title { text-align: center;
15 margin-bottom: .2em; }
16 .subtitle { text-align: center;
20 .todo { font-family: monospace; color: red; }
21 .done { font-family: monospace; color: green; }
22 .priority { font-family: monospace; color: orange; }
23 .tag { background-color: #eee; font-family: monospace;
24 padding: 2px; font-size: 80%; font-weight: normal; }
25 .timestamp { color: #bebebe; }
26 .timestamp-kwd { color: #5f9ea0; }
27 .org-right { margin-left: auto; margin-right: 0px; text-align: right; }
28 .org-left { margin-left: 0px; margin-right: auto; text-align: left; }
29 .org-center { margin-left: auto; margin-right: auto; text-align: center; }
30 .underline { text-decoration: underline; }
31 #postamble p, #preamble p { font-size: 90%; margin: .2em; }
32 p.verse { margin-left: 3%; }
34 border: 1px solid #ccc;
35 box-shadow: 3px 3px 3px #eee;
37 font-family: monospace;
49 background-color: white;
53 border: 1px solid black;
55 pre.src:hover:before { display: inline; margin-top: 14px;}
56 /* Languages per Org manual */
57 pre.src-asymptote:before { content: 'Asymptote'; }
58 pre.src-awk:before { content: 'Awk'; }
59 pre.src-C:before { content: 'C'; }
60 /* pre.src-C++ doesn't work in CSS */
61 pre.src-clojure:before { content: 'Clojure'; }
62 pre.src-css:before { content: 'CSS'; }
63 pre.src-D:before { content: 'D'; }
64 pre.src-ditaa:before { content: 'ditaa'; }
65 pre.src-dot:before { content: 'Graphviz'; }
66 pre.src-calc:before { content: 'Emacs Calc'; }
67 pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
68 pre.src-fortran:before { content: 'Fortran'; }
69 pre.src-gnuplot:before { content: 'gnuplot'; }
70 pre.src-haskell:before { content: 'Haskell'; }
71 pre.src-hledger:before { content: 'hledger'; }
72 pre.src-java:before { content: 'Java'; }
73 pre.src-js:before { content: 'Javascript'; }
74 pre.src-latex:before { content: 'LaTeX'; }
75 pre.src-ledger:before { content: 'Ledger'; }
76 pre.src-lisp:before { content: 'Lisp'; }
77 pre.src-lilypond:before { content: 'Lilypond'; }
78 pre.src-lua:before { content: 'Lua'; }
79 pre.src-matlab:before { content: 'MATLAB'; }
80 pre.src-mscgen:before { content: 'Mscgen'; }
81 pre.src-ocaml:before { content: 'Objective Caml'; }
82 pre.src-octave:before { content: 'Octave'; }
83 pre.src-org:before { content: 'Org mode'; }
84 pre.src-oz:before { content: 'OZ'; }
85 pre.src-plantuml:before { content: 'Plantuml'; }
86 pre.src-processing:before { content: 'Processing.js'; }
87 pre.src-python:before { content: 'Python'; }
88 pre.src-R:before { content: 'R'; }
89 pre.src-ruby:before { content: 'Ruby'; }
90 pre.src-sass:before { content: 'Sass'; }
91 pre.src-scheme:before { content: 'Scheme'; }
92 pre.src-screen:before { content: 'Gnu Screen'; }
93 pre.src-sed:before { content: 'Sed'; }
94 pre.src-sh:before { content: 'shell'; }
95 pre.src-sql:before { content: 'SQL'; }
96 pre.src-sqlite:before { content: 'SQLite'; }
97 /* additional languages in org.el's org-babel-load-languages alist */
98 pre.src-forth:before { content: 'Forth'; }
99 pre.src-io:before { content: 'IO'; }
100 pre.src-J:before { content: 'J'; }
101 pre.src-makefile:before { content: 'Makefile'; }
102 pre.src-maxima:before { content: 'Maxima'; }
103 pre.src-perl:before { content: 'Perl'; }
104 pre.src-picolisp:before { content: 'Pico Lisp'; }
105 pre.src-scala:before { content: 'Scala'; }
106 pre.src-shell:before { content: 'Shell Script'; }
107 pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
108 /* additional language identifiers per "defun org-babel-execute"
110 pre.src-cpp:before { content: 'C++'; }
111 pre.src-abc:before { content: 'ABC'; }
112 pre.src-coq:before { content: 'Coq'; }
113 pre.src-groovy:before { content: 'Groovy'; }
114 /* additional language identifiers from org-babel-shell-names in
115 ob-shell.el: ob-shell is the only babel language using a lambda to put
116 the execution function name together. */
117 pre.src-bash:before { content: 'bash'; }
118 pre.src-csh:before { content: 'csh'; }
119 pre.src-ash:before { content: 'ash'; }
120 pre.src-dash:before { content: 'dash'; }
121 pre.src-ksh:before { content: 'ksh'; }
122 pre.src-mksh:before { content: 'mksh'; }
123 pre.src-posh:before { content: 'posh'; }
124 /* Additional Emacs modes also supported by the LaTeX listings package */
125 pre.src-ada:before { content: 'Ada'; }
126 pre.src-asm:before { content: 'Assembler'; }
127 pre.src-caml:before { content: 'Caml'; }
128 pre.src-delphi:before { content: 'Delphi'; }
129 pre.src-html:before { content: 'HTML'; }
130 pre.src-idl:before { content: 'IDL'; }
131 pre.src-mercury:before { content: 'Mercury'; }
132 pre.src-metapost:before { content: 'MetaPost'; }
133 pre.src-modula-2:before { content: 'Modula-2'; }
134 pre.src-pascal:before { content: 'Pascal'; }
135 pre.src-ps:before { content: 'PostScript'; }
136 pre.src-prolog:before { content: 'Prolog'; }
137 pre.src-simula:before { content: 'Simula'; }
138 pre.src-tcl:before { content: 'tcl'; }
139 pre.src-tex:before { content: 'TeX'; }
140 pre.src-plain-tex:before { content: 'Plain TeX'; }
141 pre.src-verilog:before { content: 'Verilog'; }
142 pre.src-vhdl:before { content: 'VHDL'; }
143 pre.src-xml:before { content: 'XML'; }
144 pre.src-nxml:before { content: 'XML'; }
145 /* add a generic configuration mode; LaTeX export needs an additional
146 (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
147 pre.src-conf:before { content: 'Configuration File'; }
149 table { border-collapse:collapse; }
150 caption.t-above { caption-side: top; }
151 caption.t-bottom { caption-side: bottom; }
152 td, th { vertical-align:top; }
153 th.org-right { text-align: center; }
154 th.org-left { text-align: center; }
155 th.org-center { text-align: center; }
156 td.org-right { text-align: right; }
157 td.org-left { text-align: left; }
158 td.org-center { text-align: center; }
159 dt { font-weight: bold; }
160 .footpara { display: inline; }
161 .footdef { margin-bottom: 1em; }
162 .figure { padding: 1em; }
163 .figure p { text-align: center; }
164 .equation-container {
170 vertical-align: middle;
175 vertical-align: middle;
179 border: 2px solid gray;
184 { text-align: right; font-size: 70%; white-space: nowrap; }
185 textarea { overflow-x: auto; }
186 .linenr { font-size: smaller }
187 .code-highlighted { background-color: #ffff00; }
188 .org-info-js_info-navigation { border-style: none; }
189 #org-info-js_console-label
190 { font-size: 10px; font-weight: bold; white-space: nowrap; }
191 .org-info-js_search-highlight
192 { background-color: #ffff00; color: #000000; font-weight: bold; }
193 .org-svg { width: 90%; }
196 <link rel="stylesheet" type="text/css" href="https://thomasf.github.io/solarized-css/solarized-dark.min.css" />
197 <script type="text/javascript">
198 // @license magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a&dn=public-domain.txt Public Domain
199 <!--/*--><![CDATA[/*><!--*/
200 function CodeHighlightOn(elem, id)
202 var target = document.getElementById(id);
204 elem.classList.add("code-highlighted");
205 target.classList.add("code-highlighted");
208 function CodeHighlightOff(elem, id)
210 var target = document.getElementById(id);
212 elem.classList.remove("code-highlighted");
213 target.classList.remove("code-highlighted");
222 <h1 class="title">Sixth 3D engine demos</h1>
223 <div id="table-of-contents">
224 <h2>Table of Contents</h2>
225 <div id="text-table-of-contents">
227 <li><a href="#org95d4b4a">1. General</a>
229 <li><a href="#orgb4bf858">1.1. Source code</a></li>
232 <li><a href="#orgc815f60">2. Overview</a></li>
233 <li><a href="#org8b7a7b2">3. Navigating in space</a></li>
234 <li><a href="#org48ba3fe">4. Example scenes in this repository</a>
236 <li><a href="#org00b3f6a">4.1. Raytracing through voxels</a></li>
237 <li><a href="#orgc873cd5">4.2. Conway's Game of Life</a></li>
238 <li><a href="#org45d4cba">4.3. Text editors</a></li>
239 <li><a href="#orga981e88">4.4. Mathematical formulas</a></li>
240 <li><a href="#org2f45bee">4.5. Sinus heightmaps and sphere</a></li>
247 <div id="outline-container-org95d4b4a" class="outline-2">
248 <h2 id="org95d4b4a"><span class="section-number-2">1</span> General</h2>
249 <div class="outline-text-2" id="text-1">
251 <li>This program is free software: released under Creative Commons Zero
256 <li>Svjatoslav Agejenko</li>
257 <li>Homepage: <a href="https://svjatoslav.eu">https://svjatoslav.eu</a></li>
258 <li>Email: <a href="mailto://svjatoslav@svjatoslav.eu">mailto://svjatoslav@svjatoslav.eu</a></li>
261 <li><a href="https://www.svjatoslav.eu/projects/">Other software projects hosted at svjatoslav.eu</a></li>
265 <div id="outline-container-orgb4bf858" class="outline-3">
266 <h3 id="orgb4bf858"><span class="section-number-3">1.1</span> Source code</h3>
267 <div class="outline-text-3" id="text-1-1">
269 <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></li>
271 <li><a href="https://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=summary">Browse Git repository online</a></li>
274 Clone Git repository using command:
276 <pre class="example">
277 git clone https://www2.svjatoslav.eu/git/sixth-3d-demos.git
284 <div id="outline-container-orgc815f60" class="outline-2">
285 <h2 id="orgc815f60"><span class="section-number-2">2</span> Overview</h2>
286 <div class="outline-text-2" id="text-2">
288 Goal of this project is to show off capabilities and API usage of
289 <a href="https://www3.svjatoslav.eu/projects/sixth-3d/">Sixth 3D</a> engine.
293 All <a href="#org48ba3fe">example scenes in this repository</a> render at interactive
298 Download runnable JAR file: <a href="sixth-3d-demos.jar">sixth-3d-demos.jar</a>
302 To start demo application, use command:
304 <pre class="example">
305 java -jar sixth-3d-demos.jar
310 <div id="outline-container-org8b7a7b2" class="outline-2">
311 <h2 id="org8b7a7b2"><span class="section-number-2">3</span> Navigating in space</h2>
312 <div class="outline-text-2" id="text-3">
313 <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
317 <col class="org-left" />
319 <col class="org-left" />
323 <th scope="col" class="org-left">key</th>
324 <th scope="col" class="org-left">result</th>
329 <td class="org-left">cursor keys</td>
330 <td class="org-left">move: left, right, forward, backward</td>
334 <td class="org-left">mouse scroll wheel</td>
335 <td class="org-left">move: up, down</td>
339 <td class="org-left">dragging with mouse</td>
340 <td class="org-left">look around</td>
347 <div id="outline-container-org48ba3fe" class="outline-2">
348 <h2 id="org48ba3fe"><span class="section-number-2">4</span> Example scenes in this repository</h2>
349 <div class="outline-text-2" id="text-4">
351 <div id="outline-container-org00b3f6a" class="outline-3">
352 <h3 id="org00b3f6a"><span class="section-number-3">4.1</span> Raytracing through voxels</h3>
353 <div class="outline-text-3" id="text-4-1">
355 <div id="org4c3989b" class="figure">
356 <p><img src="screenshots/raytracing fractal in voxel polygon hybrid scene.png" alt="raytracing fractal in voxel polygon hybrid scene.png" />
361 Test scene that is generated simultaneously using:
364 <li>conventional polygons
366 <li>for realtime navigation, and</li>
370 <li>for on-demand raytracing</li>
375 Instead of storing voxels in dumb [X * Y * Z] array, dynamically
376 partitioned <a href="https://en.wikipedia.org/wiki/Octree">octree</a> is used to compress data. Press "r" key anywhere in
377 the scene to raytrace current view through compressed voxel
383 <div id="outline-container-orgc873cd5" class="outline-3">
384 <h3 id="orgc873cd5"><span class="section-number-3">4.2</span> Conway's Game of Life</h3>
385 <div class="outline-text-3" id="text-4-2">
387 The Game of Life, also known simply as Life, is a cellular automaton
388 devised by the British mathematician John Horton Conway in 1970.
392 <li><a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life</a>
396 <li>2 cell states: alive / dead</li>
397 <li>Each cell sees 8 neighboring cells.</li>
398 <li>If alive cell neighbors count is 2 or 3, then cell survives,
399 otherwise it dies.</li>
400 <li>Dead cell becomes alive if neighbors count is exactly 3.</li>
406 <div id="org06856d1" class="figure">
407 <p><img src="screenshots/life.png" alt="life.png" />
412 Current application projects 2D game grid/matrix onto three
413 dimensional space. Extra dimension (height) is used to visualize
414 history (previous iterations) using glowing dots suspended in space.
420 <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
424 <col class="org-left" />
426 <col class="org-left" />
430 <th scope="col" class="org-left">key</th>
431 <th scope="col" class="org-left">result</th>
436 <td class="org-left">mouse click on the cell (cell)</td>
437 <td class="org-left">toggles cell state</td>
441 <td class="org-left"><space></td>
442 <td class="org-left">next iteration</td>
446 <td class="org-left">ENTER</td>
447 <td class="org-left">next iteeration with the history</td>
451 <td class="org-left">"c"</td>
452 <td class="org-left">clear the matrix</td>
459 <div id="outline-container-org45d4cba" class="outline-3">
460 <h3 id="org45d4cba"><span class="section-number-3">4.3</span> Text editors</h3>
461 <div class="outline-text-3" id="text-4-3">
463 <div id="orgd8ec036" class="figure">
464 <p><img src="screenshots/text editors.png" alt="text editors.png" />
469 Initial test for creating user interfaces in 3D and:
472 <li>window focus handling</li>
473 <li>picking objecs using mouse</li>
474 <li>redirecting keyboard input to focused window</li>
479 Window focus acts like a stack.
483 When window is clicked with the mouse, previously focused window (if
484 any) is pushed to the focus stack and new window receives focus. Red
485 frame appears around the window to indicate this.
489 When ESC key is pressed, window focus is returned to previous window
494 When any window is focused, all keyboard input is redirected to that
495 window, including cursor keys. To be able to navigate around the world
496 again, window must be unfocused first using ESC key.
503 <li>Improve focus handling:
505 <li>Perhaps add shortcut to navigate world without exiting entire
507 <li>Possibility to retain and reuse recently focused elements.</li>
508 <li>Store user location in the world and view direction with the
509 focused window. So that when returning focus to far away object,
510 user is redirected also to proper location in the world.</li>
512 <li>Possibility to store recently visited locations in the world and
518 <b>Quite a lot of text editors can be rendered:</b>
522 <div id="orgc510a03" class="figure">
523 <p><img src="screenshots/text editors 2.png" alt="text editors 2.png" />
528 <div id="outline-container-orga981e88" class="outline-3">
529 <h3 id="orga981e88"><span class="section-number-3">4.4</span> Mathematical formulas</h3>
530 <div class="outline-text-3" id="text-4-4">
532 <div id="org67b5695" class="figure">
533 <p><img src="screenshots/mathematical formulas.png" alt="mathematical formulas.png" />
538 <li>TODO: instead of projecting 2D visualizations onto 3D space,
539 visualize some formula using all 3 dimensions avaliable.</li>
543 <div id="outline-container-org2f45bee" class="outline-3">
544 <h3 id="org2f45bee"><span class="section-number-3">4.5</span> Sinus heightmaps and sphere</h3>
545 <div class="outline-text-3" id="text-4-5">
547 <div id="org63e266a" class="figure">
548 <p><img src="screenshots/sinus heightmaps and sphere.png" alt="sinus heightmaps and sphere.png" />
553 Simple test scene. Easy to implement and looks nice.
559 <div id="postamble" class="status">
560 <p class="author">Author: Svjatoslav Agejenko</p>
561 <p class="date">Created: 2021-05-29 Sat 05:01</p>
562 <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>