Giter Site home page Giter Site logo

noise-map's Introduction

Three Seed

Three.js starter project boilerplate bundled with Webpack.

This project is designed to help you get started on your next three.js project. It sets up a simple scene, camera and renderer to view two imported GLTF assets.

Online Demo

Install

Before you begin, make sure you are comfortable with terminal commands and have Node and NPM installed. Then either install via a download or with Git.

Install via Download

First download the zip of the project and extract it. Then in terminal at that folder type npm install to set things up. To get going run: npm start.

Install with Git

In terminal clone the project into a directory of your choice then delete the git folder to start fresh.

git clone --depth=1 https://github.com/edwinwebb/three-seed.git my-project
cd my-project
rm -rf .git
npm install

Running the development server

To see the changes you make to the starter project go to the project folder in terminal and type...

npm start

This command will bundle the project code and start a development server at http://localhost:8080/. Visit this in your web browser; you should see a rotating island and flower.

Editing the code

The first file you should open is ./objects/Scene.js. In it you will find the three objects comprising the ThreeJS scene represented in your browser. The flower, the island, and the lights illuminating them are each represented as a javascript file in the ./object/ folder. Open these, edit them and see your changes in the browser. If something goes wrong a message will displayed in the debug console of the browser.

Importing local files

Local files, such as images and 3D models, are imported into the application as URLs then loaded asynchronously with three.js. Most common files that three.js uses are supported. For more information about this system see the webpack site.

Importing modules from the web

If you want to add additional functionality to your project, you can search and install them from the NPM repository. Some modules you might want to consider are...

Additions like these are best managed in the projects entry file: ./src/entry.js. In it are the Scene, Camera, Renderer, the window event listeners and the animation loop.

Using the Three.js Examples

When using this project you might bump into a few issues around using the examples from three.js docs. Most of the common issues have been solved with including NPM packages. However, for more complex examples with custom script includes you might find yourself having to refactor them. See Issue 15 for an example.

About the models

Both the models are loaded by the GLTFLoader and were sourced from the Google Poly project.

"Floating Island" by sirkitree is licensed under CC BY 2.0

"Flower" by Poly By Google is licensed under CC BY 2.0

Building the project for the web

Once you are happy with your project you'll be sure to want to show it off. Running npm run build in terminal will bundle your project into the folder ./build/. You can upload this directory to a web server. For more complex results read this guide.

License

MIT

noise-map's People

Contributors

chkvskyi avatar

Watchers

 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.