Skip to content

Brunch.js skeleton for ES6 WebGL projects using Three.js

License

Notifications You must be signed in to change notification settings

seigler/brunch-threejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brunch app

This is brunch skeleton for starting a project in WebGL with Three.js and ES2016.

Getting started

  • Install (if you don't have them):
    • Node.js: brew install node on OS X
    • Brunch: npm install -g brunch
  • Create a new project :
    • Deploy with brunch :
      • brunch new myapp --skeleton https://github.com/seigler/brunch-threejs - create new project
    • Or use git to clone the brunch-threejs repository :
      • git clone https://github.com/Jeremboo/brunch-threejs
  • Download dependencies :
    • npm run deploy or npm install && npm start

How to use

  • npm start or brunch watch --server to watch the project with continuous rebuild.
  • npm run prod or brunch build --production to build minified project for production.

More

  • Like brunch basic skeleton :

    • public/ dir is fully auto-generated and served by HTTP server. Write your code in app/ dir.
    • Place static files you want to be copied from app/assets/ to public/.
  • Specific to this skeleton :

    • You can use this dir /app/js/components/ for your THREE.object3D components. For my part, I create one component for each 3D object. There is an example of a 3D object in this dir (Example.js) to show how you can create a THREE.object3D with ES2015.

    • /app/js/shaders contains fragments and vertex .glsl files. If you need to use some .glsl file for build a ShaderMaterial, you can import these files. Look at Example.js for more details.

    • The directory /app/js/core/ contains:

      • Webgl.js initializes the 3D scene and the camera.
      • Loop.js manages frame animation for each update of 3Dobjects.
      • props.js contains all variables of settings to be uses in all other files. It's specially created to be used by dat.gui
    • /app/js/main.js puts these together to animate a 3D object.

    • I also added EffectComposer for post processing.

Thanks to

About

Brunch.js skeleton for ES6 WebGL projects using Three.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published