0.1.7 • Published 7 years ago
lib3d v0.1.7
lib3d
Display 3D library on your webpage
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
Contribution
Star this repository or let me know in any other way that you use or going to use this library.