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