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