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