November Perfect Moustache
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

three-demo

3.2.3 • Public • Published

Three Demo

Build status npm version Peer dependencies

A compact demo framework for three.js.

DemoAPI Reference

Installation

This library requires the peer dependencies dat.gui, synthetic-event and three.

npm install dat.gui synthetic-event three
npm install three-demo

Usage

import { DemoManager } from "three-demo";
import { MyDemo } from "./MyDemo.js";
 
// Initialize the demo manager.
const manager = new DemoManager(document.getElementById("viewport"), {
    aside: document.getElementById("aside"),
    renderer: myWebGLRenderer
});
 
// React to events.
manager.addEventListener("change", console.log);
manager.addEventListener("load", console.log);
 
// Register demos.
manager.addDemo(new MyDemo());
 
// Start rendering.
(function render(now) {
 
    requestAnimationFrame(render);
    manager.render(now);
 
}());

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.

install

npm i three-demo

Downloadsweekly downloads

13

version

3.2.3

license

Zlib

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability