npm

Need private packages and team management tools?Check out npm Orgs. »

three-demo

3.10.0 • Public • Published

Three Demo

Build status npm version Peer dependencies

A compact demo framework for three.js.

Demo · API 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

46

version

3.10.0

license

Zlib

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability