Skip to content

Create a generic three.js application for quick prototyping

License

Notifications You must be signed in to change notification settings

terkelg/threejs-create

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

threejs-create

A quick way to prototype three.js applications without spending time on boilerplate code

Standard - JavaScript Style Guide

Install

$ npm install --save threejs-create

Usage

You can either extend with ES6 classes or just take whatever you need, as in the following example:

import * as THREE from 'three'
import CreateLoop from 'raf-loop'
import CreateApp from 'threejs-create'

const {
  scene,
  render
} = new CreateApp()

// Use three.js as you're used to
let geometry = new THREE.IcosahedronGeometry(1, 1)
let material = new THREE.MeshBasicMaterial({ color: 0xfff999fff, wireframe: true })
let mesh = new THREE.Mesh(geometry, material)

scene.add(mesh)

// Render loop
CreateLoop(render).start()

Features

  • Built in post-processing with WAGNER
  • Easy to extend with ES6 classes

Credit

Based on this code by @mattdesl

License

MIT © Terkel Gjervig

About

Create a generic three.js application for quick prototyping

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published