Added runnable jar file to the web site
[sixth-3d-demos.git] / doc / index.org
1 #+TITLE: Sixth 3D engine demos
2
3 * (document settings) :noexport:
4 ** use dark style for TWBS-HTML exporter
5 #+HTML_HEAD: <link href="https://bootswatch.com/3/darkly/bootstrap.min.css" rel="stylesheet">
6 #+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
7 #+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
8 #+HTML_HEAD: <style type="text/css">
9 #+HTML_HEAD:   footer {background-color: #111 !important;}
10 #+HTML_HEAD:   pre {background-color: #111; color: #ccc;}
11 #+HTML_HEAD: </style>
12
13 * General
14 - This is a subproject of [[https://www3.svjatoslav.eu/projects/sixth-3d/][Sixth 3D]]:
15   - which in turn is a subproject of parent project [[https://www3.svjatoslav.eu/projects/sixth/][Sixth]].
16
17 - This program is free software: you can redistribute it and/or modify
18   it under the terms of the [[https://www.gnu.org/licenses/lgpl.html][GNU Lesser General Public License]] as
19   published by the Free Software Foundation, either version 3 of the
20   License, or (at your option) any later version.
21
22 - Program author:
23   - Svjatoslav Agejenko
24   - Homepage: https://svjatoslav.eu
25   - Email: mailto://svjatoslav@svjatoslav.eu
26
27 - [[https://www.svjatoslav.eu/projects/][Other software projects hosted at svjatoslav.eu]]
28
29 ** Source code
30 - [[https://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=snapshot;h=HEAD;sf=tgz][Download latest snapshot in TAR GZ format]]
31
32 - [[https://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=summary][Browse Git repository online]]
33
34 - Clone Git repository using command:
35   : git clone https://www2.svjatoslav.eu/git/sixth-3d-demos.git
36
37 * Overview
38 Goal of this project is to show off capabilities and API usage of
39 [[https://www3.svjatoslav.eu/projects/sixth-3d/][Sixth 3D]] engine.
40
41 All [[id:5f88b493-6ab3-4659-8280-803f75dbd5e0][example scenes in this repository]] render at interactive
42 framerates.
43
44 Download runnable JAR file: [[file:sixth-3d-demos.jar]]
45
46 To start demo application, use command:
47 : java -jar sixth-3d-demos.jar
48
49 * Navigating in space
50 | key                            | result                               |
51 |--------------------------------+--------------------------------------|
52 | cursor keys                    | move: left, right, forward, backward |
53 | mouse scroll wheel             | move: up, down                       |
54 | dragging with mouse            | look around                          |
55
56 * Example scenes in this repository
57 :PROPERTIES:
58 :ID:       5f88b493-6ab3-4659-8280-803f75dbd5e0
59 :END:
60 ** Raytracing through voxels
61 [[file:screenshots/raytracing fractal in voxel polygon hybrid scene.png]]
62
63 Test scene that is generated simultaneously using:
64 + conventional polygons
65   + for realtime navigation, and
66 + voxels
67   + for on-demand raytracing
68
69 Instead of storing voxels in dumb [X * Y * Z] array, dynamically
70 partitioned [[https://en.wikipedia.org/wiki/Octree][octree]] is used to compress data. Press "r" key anywhere in
71 the scene to raytrace current view through compressed voxel
72 datastructure.
73
74 ** Conway's Game of Life
75 The Game of Life, also known simply as Life, is a cellular automaton
76 devised by the British mathematician John Horton Conway in 1970.
77
78 + https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
79   + Game rules:
80     + 2 cell states: alive / dead
81     + Each cell sees 8 neighboring cells.
82     + If alive cell neighbors count is 2 or 3, then cell survives,
83       otherwise it dies.
84     + Dead cell becomes alive if neighbors count is exactly 3.
85
86 [[file:screenshots/life.png]]
87
88 Current application projects 2D game grid/matrix onto three
89 dimensional space. Extra dimension (height) is used to visualize
90 history (previous iterations) using glowing dots suspended in space.
91
92 Usage:
93 | key                            | result                               |
94 |--------------------------------+--------------------------------------|
95 | mouse click on the cell (cell) | toggles cell state                   |
96 | <space>                        | next iteration                       |
97 | ENTER                          | next iteeration with the history     |
98 | "c"                            | clear the matrix                     |
99
100 ** Text editors
101 [[file:screenshots/text editors.png]]
102
103 Initial test for creating user interfaces in 3D and:
104 + window focus handling
105 + picking objecs using mouse
106 + redirecting keyboard input to focused window
107
108
109 Window focus acts like a stack.
110
111 When window is clicked with the mouse, previously focused window (if
112 any) is pushed to the focus stack and new window receives focus. Red
113 frame appears around the window to indicate this.
114
115 When ESC key is pressed, window focus is returned to previous window
116 (if any).
117
118 When any window is focused, all keyboard input is redirected to that
119 window, including cursor keys. To be able to navigate around the world
120 again, window must be unfocused first using ESC key.
121
122
123 + TODO:
124   + Improve focus handling:
125     + Perhaps add shortcut to navigate world without exiting entire
126       stack of focus.
127     + Possibility to retain and reuse recently focused elements.
128     + Store user location in the world and view direction with the
129       focused window. So that when returning focus to far away object,
130       user is redirected also to proper location in the world.
131   + Possibility to store recently visited locations in the world and
132     return to them.
133 ** Mathematical formulas
134 [[file:screenshots/mathematical formulas.png]]
135
136 + TODO: instead of projecting 2D visualizations onto 3D space,
137   visualize some formula using all 3 dimensions avaliable.
138 ** Sinus heightmaps and sphere
139 [[file:screenshots/sinus heightmaps and sphere.png]]
140
141 Simple test scene. Easy to implement and looks nice.