This project aims to provide a protocol and tools to feed a client with 3D data. The main idea is to let the client decide what kind of data to visualize first. In order to be generic and to not depend on other restrictive licensed tools, rest3d is based on glTF format, three.js 3D library and Node.js.
This project was presented at WebGL & glTF BOF - SIGGRAPH 2016
- Clone or download this project
- Install Node.js (v4.4.7) if it's not already installed
- At src/server/
npm install
- At example/
npm install
- At example/
npm start
- Open
http://localhost:8080
in your browser - Click
start
button
###Server
var ws = require('websocket-stream');
var gltfStreamer = require('rest3d_server');
function handle (stream){
var assetManager = gltfStreamer.assetManager();
assetManager.bindWebSocket(stream);
assetManager.initEvent();
stream.on('data', function(message){
assetManager.feedbackManager(message);
});
};
ws.createServer({server: yourServer}, handle);
###Client
<script src="./rest3d_client.js"></script>
var websocket = require('websocket-stream');
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement );
var ws = websocket('ws://localhost:8080');
var streamManager = new StreamManager(ws);
streamManager.bindScene(scene);
function render() {
requestAnimationFrame( render );
renderer.render( scene, camera );
}
render();
streamManager.launchStream('path/myAsset.gltf');
Visit the example page for a ready to use example.
Visit the wiki for more details.
- Send server errors and warnings to client
- Loading by URL:
- For 'file:///'
- For 'http:///'
- Interlaced binary:
- Server: Yes, but depreciated
- Client
- Asset Infos
- Sort
- GUI example
- Multiple binary files for the same asset
- Indices
- Positions
- Normals
- Texture coordinates
- Bones weigth
- Bones indices
- Scenes
- LOD
- Displacement Parameters for a node:
- rotation
- translation
- scale
- quaternion
- matrix
- Skeleton
- Animations
- Hierarchy
- Cameras
- Materials //In progress
- Shaders
- KHR_materials_common
- Textures (jpg: OK, png: OK, tga: OK, dds:must be tested )
- EnvMap
- Camera Feedback
###Author [Selim Bekkar] (https://github.com/selimbek)
###Contributors Maxime Helen
[Jérôme Labbe] (https://github.com/jerome-labbe-sb)