Fixed TOC
[sixth-3d-demos.git] / doc / index.org
index d3438e3..9842076 100644 (file)
 #+TITLE: Sixth 3D engine demos
 
------
-- This is a subproject of [[http://www2.svjatoslav.eu/gitbrowse/sixth-3d/doc/index.html][Sixth 3D]]
-- [[http://www2.svjatoslav.eu/gitweb/?p=sixth.git;a=snapshot;h=HEAD;sf=tgz][download latest snapshot]]
+* (document settings) :noexport:
+** use dark style for TWBS-HTML exporter
+#+HTML_HEAD: <link href="https://bootswatch.com/3/darkly/bootstrap.min.css" rel="stylesheet">
+#+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
+#+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
+#+HTML_HEAD: <style type="text/css">
+#+HTML_HEAD:   footer {background-color: #111 !important;}
+#+HTML_HEAD:   pre {background-color: #111; color: #ccc;}
+#+HTML_HEAD: </style>
 
-- This program is free software; you can redistribute it and/or modify it under
-  the terms of version 3 of the [[https://www.gnu.org/licenses/lgpl.html][GNU Lesser General Public License]] or later as
-  published by the Free Software Foundation.
+* General
+- This is a subproject of [[http://www3.svjatoslav.eu/projects/sixth-3d/][Sixth 3D]] which in turn is a subproject of
+  [[http://www3.svjatoslav.eu/projects/sixth/][Sixth]].
+
+- This program is free software: you can redistribute it and/or modify
+  it under the terms of the [[https://www.gnu.org/licenses/lgpl.html][GNU Lesser General Public License]] as
+  published by the Free Software Foundation, either version 3 of the
+  License, or (at your option) any later version.
 
 - Program author:
   - Svjatoslav Agejenko
   - Homepage: http://svjatoslav.eu
   - Email: mailto://svjatoslav@svjatoslav.eu
 
-- [[http://svjatoslav.eu/programs.jsp][other applications hosted at svjatoslav.eu]]
+- [[http://www.svjatoslav.eu/projects/][Other software projects hosted at svjatoslav.eu]]
+
+** Source code
+- [[http://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=snapshot;h=HEAD;sf=tgz][Download latest snapshot in TAR GZ format]]
+
+- [[http://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=summary][Browse Git repository online]]
+
+- Clone Git repository using command:
+  : git clone http://www2.svjatoslav.eu/git/sixth-3d-demos.git
+
+* Overview
+Goal of this project is to show off capabilities and API usage of
+[[http://www3.svjatoslav.eu/projects/sixth-3d/][Sixth 3D]] engine.
+
+All sample scenes below are rendered at interactive framerates.
+* Navigating in space
+| key                            | result                               |
+|--------------------------------+--------------------------------------|
+| cursor keys                    | move: left, right, forward, backward |
+| mouse scroll wheel             | move: up, down                       |
+| dragging with mouse            | look around                          |
+
+* Samples
+** Raytracing through voxels
+[[file:screenshots/raytracing fractal in voxel polygon hybrid scene.png]]
+
+Test scene that is generated simultaneously using:
++ conventional polygons
+  + for realtime navigation, and
++ voxels
+  + for on-demand raytracing
+
+Instead of storing voxels in dumb [X * Y * Z] array, dynamically
+partitioned [[https://en.wikipedia.org/wiki/Octree][octree]] is used to compress data. Press "r" key anywhere in
+the scene to raytrace current view through compressed voxel
+datastructure.
+
+** Conway's Game of Life
+The Game of Life, also known simply as Life, is a cellular automaton
+devised by the British mathematician John Horton Conway in 1970.
+
++ https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
+  + Game rules:
+    + 2 cell states: alive / dead
+    + Each cell sees 8 neighboring cells.
+    + If alive cell neighbors count is 2 or 3, then cell survives,
+      otherwise it dies.
+    + Dead cell becomes alive if neighbors count is exactly 3.
+
+[[file:screenshots/life.png]]
+
+Current application projects 2D game grid/matrix onto three
+dimensional space. Extra dimension (height) is used to visualize
+history (previous iterations) using glowing dots suspended in space.
+
+Usage:
+| key                            | result                               |
+|--------------------------------+--------------------------------------|
+| mouse click on the cell (cell) | toggles cell state                   |
+| <space>                        | next iteration                       |
+| ENTER                          | next iteeration with the history     |
+| "c"                            | clear the matrix                     |
+
+** Text editors
+[[file:screenshots/text editors.png]]
+
+Initial test for creating user interfaces in 3D and:
++ window focus handling
++ picking objecs using mouse
++ redirecting keyboard input to focused window
+
+
+Window focus acts like a stack.
 
+When window is clicked with the mouse, previously focused window (if
+any) is pushed to the focus stack and new window receives focus. Red
+frame appears around the window to indicate this.
 
-* Description
-Goal of this project is to show off capabilities of [[http://www2.svjatoslav.eu/gitbrowse/sixth-3d/doc/index.html][Sixth 3D]] engine. Also to
-show examples of its usage.
+When ESC key is pressed, window focus is returned to previous window
+(if any).
 
-[[http://www2.svjatoslav.eu/gitbrowse/sixth/doc/screenshots/index.html][http://www2.svjatoslav.eu/gitbrowse/sixth/doc/screenshots.png]]
+When any window is focused, all keyboard input is redirected to that
+window, including cursor keys. To be able to navigate around the world
+again, window must be unfocused first using ESC key.
 
-Sample scenes rendered at interactive framerates by Sixth 3D engine.
 
++ TODO:
+  + Improve focus handling:
+    + Perhaps add shortcut to navigate world without exiting entire
+      stack of focus.
+    + Possibility to retain and reuse recently focused elements.
+    + Store user location in the world and view direction with the
+      focused window. So that when returning focus to far away object,
+      user is redirected also to proper location in the world.
+  + Possibility to store recently visited locations in the world and
+    return to them.
+** Mathematical formulas
+[[file:screenshots/mathematical formulas.png]]
 
++ TODO: instead of projecting 2D visualizations onto 3D space,
+  visualize some formula using all 3 dimensions avaliable.
+** Sinus heightmaps and sphere
+[[file:screenshots/sinus heightmaps and sphere.png]]
 
+Simple test scene. Easy to implement and looks nice.