Updated copyright
[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 [[http://www3.svjatoslav.eu/projects/sixth-3d/][Sixth 3D]] which in turn is a subproject of
15   [[http://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: http://svjatoslav.eu
25   - Email: mailto://svjatoslav@svjatoslav.eu
26
27 - [[http://www.svjatoslav.eu/projects/][Other software projects hosted at svjatoslav.eu]]
28
29 ** Source code
30 - [[http://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=snapshot;h=HEAD;sf=tgz][Download latest snapshot in TAR GZ format]]
31
32 - [[http://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 http://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 [[http://www3.svjatoslav.eu/projects/sixth-3d/][Sixth 3D]] engine.
40
41 All sample scenes below are rendered at interactive framerates.
42 * Navigating in space
43 | key                            | result                               |
44 |--------------------------------+--------------------------------------|
45 | cursor keys                    | move: left, right, forward, backward |
46 | mouse scroll wheel             | move: up, down                       |
47 | dragging with mouse            | look around                          |
48
49 * Samples
50 ** Raytracing through voxels
51 [[file:screenshots/raytracing fractal in voxel polygon hybrid scene.png]]
52
53 Test scene that is generated simultaneously using:
54 + conventional polygons
55   + for realtime navigation, and
56 + voxels
57   + for on-demand raytracing
58
59 Instead of storing voxels in dumb [X * Y * Z] array, dynamically
60 partitioned [[https://en.wikipedia.org/wiki/Octree][octree]] is used to compress data. Press "r" key anywhere in
61 the scene to raytrace current view through compressed voxel
62 datastructure.
63
64 ** Conway's Game of Life
65 The Game of Life, also known simply as Life, is a cellular automaton
66 devised by the British mathematician John Horton Conway in 1970.
67
68 + https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
69   + Game rules:
70     + 2 cell states: alive / dead
71     + Each cell sees 8 neighboring cells.
72     + If alive cell neighbors count is 2 or 3, then cell survives,
73       otherwise it dies.
74     + Dead cell becomes alive if neighbors count is exactly 3.
75
76 [[file:screenshots/life.png]]
77
78 Current application projects 2D game grid/matrix onto three
79 dimensional space. Extra dimension (height) is used to visualize
80 history (previous iterations) using glowing dots suspended in space.
81
82 Usage:
83 | key                            | result                               |
84 |--------------------------------+--------------------------------------|
85 | mouse click on the cell (cell) | toggles cell state                   |
86 | <space>                        | next iteration                       |
87 | ENTER                          | next iteeration with the history     |
88 | "c"                            | clear the matrix                     |
89
90 ** Text editors
91 [[file:screenshots/text editors.png]]
92
93 Initial test for creating user interfaces in 3D and:
94 + window focus handling
95 + picking objecs using mouse
96 + redirecting keyboard input to focused window
97
98
99 Window focus acts like a stack.
100
101 When window is clicked with the mouse, previously focused window (if
102 any) is pushed to the focus stack and new window receives focus. Red
103 frame appears around the window to indicate this.
104
105 When ESC key is pressed, window focus is returned to previous window
106 (if any).
107
108 When any window is focused, all keyboard input is redirected to that
109 window, including cursor keys. To be able to navigate around the world
110 again, window must be unfocused first using ESC key.
111
112
113 + TODO:
114   + Improve focus handling:
115     + Perhaps add shortcut to navigate world without exiting entire
116       stack of focus.
117     + Possibility to retain and reuse recently focused elements.
118     + Store user location in the world and view direction with the
119       focused window. So that when returning focus to far away object,
120       user is redirected also to proper location in the world.
121   + Possibility to store recently visited locations in the world and
122     return to them.
123 ** Mathematical formulas
124 [[file:screenshots/mathematical formulas.png]]
125
126 + TODO: instead of projecting 2D visualizations onto 3D space,
127   visualize some formula using all 3 dimensions avaliable.
128 ** Sinus heightmaps and sphere
129 [[file:screenshots/sinus heightmaps and sphere.png]]
130
131 Simple test scene. Easy to implement and looks nice.