Skip to content

fl4re/rest3d-new

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rest3d

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

How to run the example:

  1. Clone or download this project
  2. Install Node.js (v4.4.7) if it's not already installed
  3. At src/server/ npm install
  4. At example/ npm install
  5. At example/ npm start
  6. Open http://localhost:8080 in your browser
  7. Click start button

Usage

###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.

Supported features checklist

  • 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

Credits

Starbreeze Studios

###Author [Selim Bekkar] (https://github.com/selimbek)

###Contributors Maxime Helen

[Jérôme Labbe] (https://github.com/jerome-labbe-sb)

Remi Arnaud

Mark Barnes

Tony Parisi

License

MIT

About

REST 3D public edition (need updated description)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published