Coder Social home page Coder Social logo

threejs-boilerplate's Introduction

Three.js Boilerplate

A Three.js Boilerplate to aid in quick prototyping.

When updating older Three.js projects, you may get a warning in the browser such as, "As part of the transition to ES6 Modules, the files in 'examples/js' were deprecated in May 2020 (r117) and will be deleted in December 2020 (r124)."

There are several steps involved in converting to use modules. This boilerplate was written to help you solve some issues that you may have when converting your Three.js projects to use modules.

To install and start the master (ES6) branch

git clone https://github.com/Sean-Bradley/Threejs-Boilerplate.git
cd Threejs-Boilerplate
npm install
npm start

Visit http://127.0.0.1:3000

To update threejs

npm install three@latest

Note : This boilerplate contains 3 branches

  • master : The minimal boilerplate using ES6 imports and script type module
  • before-es6-modules : The example, but using older style script imports
  • water : An example based on the official Three.js Ocean example

To see the before-es6-modules branch

git checkout before-es6-modules
npm install
npm start

To see the water branch

git checkout water
npm install
npm start

Water Branch

Video Tutorial About Importing Three.js as Module

Importing Three.js as Module

Threejs Courses

To help support this Threejs boilerplate and my other open source licensed repositories, please take a look at my official Threejs courses,

Three.js and TypeScript

Threejs TypeScript Course

and

React Three Fiber

React Three Fiber

Note, discount Coupons for all my courses can be found at https://sbcode.net/coupons

Relative Import References versus Module Specifiers

If you ever see the error "Relative references must start with either "/", "./", or "../".", then that may also be related to using Named Module Specifiers in the client, when it was expecting a Relative Import Reference instead. You can use an import map to help solve that problem. You can also read more about Relative Imports versus Module Specifiers at https://medium.com/threejs/module-specifiers-versus-relative-import-references-fd747980ba6f

Programming Books

To help support my projects, please check out my books.

Three.js and TypeScript

   https://www.amazon.com/dp/B09GYTKRCH
   https://www.amazon.co.uk/dp/B09GYTKRCH
   https://www.amazon.in/dp/B09GYTKRCH
   https://www.amazon.de/dp/B09GYTKRCH
   https://www.amazon.fr/dp/B09GYTKRCH
   https://www.amazon.es/dp/B09GYTKRCH
   https://www.amazon.it/dp/B09GYTKRCH
   https://www.amazon.nl/dp/B09GYTKRCH
   https://www.amazon.co.jp/dp/B09GYTKRCH
   https://www.amazon.ca/dp/B09GYTKRCH
   https://www.amazon.com.br/dp/B09GYTKRCH
   https://www.amazon.com.mx/dp/B09GYTKRCH
   https://www.amazon.com.au/dp/B09GYTKRCH

(ASIN : B09GZM9KGJ / B09GYTKRCH)

Design Patterns in TypeScript

   https://www.amazon.com/dp/B0948BCH24
   https://www.amazon.co.uk/dp/B0948BCH24
   https://www.amazon.in/dp/B094716FD6
   https://www.amazon.de/dp/B0948BCH24
   https://www.amazon.fr/dp/B0948BCH24
   https://www.amazon.es/dp/B0948BCH24
   https://www.amazon.it/dp/B0948BCH24
   https://www.amazon.co.jp/dp/B0948BCH24
   https://www.amazon.ca/dp/B0948BCH24
   https://www.amazon.com.au/dp/B094716FD6

(ASIN : B0948BCH24 / B094716FD6)

threejs-boilerplate's People

Contributors

sean-bradley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.