Merge branch 'documentation' into develop

This commit is contained in:
Daniel Kastl 2014-02-15 15:59:50 +09:00
commit bac2e8bd94
10 changed files with 146 additions and 0 deletions

82
doc/doc.md Normal file
View File

@ -0,0 +1,82 @@
# Documentation
* [File Format Description](./file_format.md)
* [How Does Loading Nodes Work?](./how_does_loading_nodes_work.md)
## Introduction
Potree is a WebGL based viewer for large point clouds. The idea is that, similar to Google Maps, only visible parts up to a certain level of detail
will be loaded and displayed. In order to achieve this, points are partitioned into an octree.
The root node r contains a sparse subset of the data. All of its children contain another sparse subset which, combined, will gradualy increase
the level of detail.
| ![](./images/r.png "") | ![](./images/r1.png "") | ![](./images/r_and_r1.png "") | ![](./images/r_and_rx.png "") |
| ------------- |:-------------:| -----:| --- |
| root | r0, first child of root | root and r0 combined | root and all its children combined |
## Getting Started
1. Deploy potree on a webserver.
2. Open lion.html.
This should be the result:
![](./images/lion_demo_screenshot.jpg)
And this is what happens inside lion.html:
Initialize potree inside the canvas element:
var canvas = document.getElementById("canvas");
var success = Potree.init(canvas);
if(!success){
return;
}
Load a point cloud and add it to the scene:
var scene = Potree.currentScene;
var cloudURL = "resources/pointclouds/lion_takanawa/cloud.js";
var pcoNode = POCLoader.load(cloudURL);
scene.rootNode.addChild(pcoNode);
Directly manipulate the transformation matrix of the point cloud node:
In this case, the point cloud was upside down so it has to be mirrored along the y-axis.
pcoNode.transform = [1, 0, 0, 0,
0, -1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1];
Transform the camera:
var cam = scene.activeCamera;
cam.rotateY(Math.PI/2);
cam.translate(-1,-1,-1);
Set the point Size:
var material = MaterialManager.getMaterial("pointCloud");
material.pointSize = 1;
A high LOD multiplicator will display more nodes that are small or far away:
Potree.Settings.LODMultiplicator = 20.0;
## Compatibility
| Browser | Result |
| -------------------- |:-------------:|
| Chrome 32 | works |
| Firefox 26 | works |
| Safari | works |
| Opera 19 | works |
| Internet Explorer 11 | does not work |
## License
Potree is available under the [FreeBSD License](http://en.wikipedia.org/wiki/BSD_licenses) license.

60
doc/file_format.md Normal file
View File

@ -0,0 +1,60 @@
# File Format
## File Hierarchy
Points are stored in an octree. All nodes, even intermediate nodes, contain a subset of the whole point cloud.
.cloud.js Contains bounding box, vertex format and octree hierarchy
./data Contains one file for each octree node.
./data/r The root node.
./data/rx The x.th child of the root. x = 0 to 7
./data/rxy The y.th child of the x.th child of the root.
Each node may have up to 8 child nodes. The numbers from 0 to 7 inside the node name indicate which child it is. For example:
* r is the root node
* r0 is the first child of the root node
* r03 is the fourth child of the first child of the root node
## Octree Hierarchy
Child nodes are arranged like this:
3----7
/| /|
y 2----6 |
| -z | 1--|-5
|/ |/ |/
O----x 0----4
This means that node 0 is at the origin, node 1 is translated along the -z axis, node 2 is on top of node 0 and so on.
## cloud.js
Stores information about the pointcloud in JSON format.
The property "pointAttributes" indicates how each point is stored. At the moment, you should stick to the format given in the example below. "POSITION_CARTESIAN" and "COLOR_PACKED" means that each point is stored as 3 32bit floats for x,y and z coordinates and 4 unsigned bytes for r,g,b and a colors.
The hierarchy property contains all nodes and the number of points in each node. The nodes must be stored top to bottom, i.e. root at the beginning and leafs at the end.
{
"octreeDir": "data",
"boundingBox": {
"lx": -10.0,
"ly": -10.0,
"lz": -10.0,
"ux": 10.0,
"uy": 10.0,
"uz": 10.0
},
"pointAttributes": [
"POSITION_CARTESIAN",
"COLOR_PACKED"
],
"hierarchy": [
["r", 9103],
["r0", 7809],
["r1", 3491],
["r3", 4309],
["r03", 8521]
]
}

View File

@ -0,0 +1,4 @@
# How Does Loading Nodes Work?
TODO

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
doc/images/pompei.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 KiB

BIN
doc/images/r.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
doc/images/r1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
doc/images/r_and_r1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
doc/images/r_and_rx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
doc/images/rx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB