Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

npm version Codeship Status for Galiaf47/lib3d Document Coverage Status

lib3d

Display 3D library on your webpage

Screenshot

Install

npm install lib3d

Add three.js and lib3d to your index.html:

<script src="/node_modules/three/three.min.js"></script>
<script src="/node_modules/lib3d/dist/lib3d.js"></script>

And add a canvas element to your page

<body>
    <canvas id="LIBRARY"></canvas>

Basic Usage

var env = new lib3d.Environment(document.getElementById("LIBRARY"), 300, 300);

var library = lib3d.factory.createLibrary({
    id: '1', 
    model: 'default'
});
var section = lib3d.factory.createSection({
    id: '1', 
    model: 'default'
});
var book = lib3d.factory.createBook({
    id: '1'
    model: 'default', 
    shelfId: '4', 
    sectionId: '1'
});

library.addSection(section);
library.addBook(book);
env.library = library;

section.move(new THREE.Vector3(-0.3, 0, -2));
book.move(new THREE.Vector3(-0.1, -0.06, -0.046));

Documentation

API reference

Contribution

Star this repository or let me know in any other way that you use or going to use this library.