three-demo
v5.1.3
Published
A demo framework for three.js.
Downloads
434
Readme
Three Demo
A compact demo framework for three.js.
Installation
This library requires the peer dependencies three and dat.gui.
npm install dat.gui three three-demo
Usage
import { DemoManager } from "three-demo";
import { MyDemo } from "./MyDemo";
const manager = new DemoManager(document.getElementById("viewport"), {
aside: document.getElementById("aside"),
renderer
});
manager.addEventListener("change", (event) => console.log(event));
manager.addEventListener("load", (event) => console.log(event));
manager.addDemo(new MyDemo());
requestAnimationFrame(function render(timestamp) {
requestAnimationFrame(render);
manager.render(timestamp);
});
Custom Demos
You can create custom demos by extending the Demo
class. For details, take a look at the ExampleDemo.
Contributing
Please refer to the contribution guidelines for details.