Skip to content

Commit

Permalink
Merge pull request #249 from nudibranchrecords/release/v0.5.0
Browse files Browse the repository at this point in the history
Release/v0.5.0
  • Loading branch information
funwithtriangles authored Aug 12, 2019
2 parents 13f596c + 2fdab9d commit b7e055e
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 3,256 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"standard",
"standard-react"
],
"globals": {
"THREE": "readonly"
},
"env": {
"browser" : true,
"jest/globals": true
Expand Down
13 changes: 4 additions & 9 deletions docs/dev/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ module.exports = {

## index.js

This is where the actual sketch is held. You can `require` other modules from here, so don't feel restricted to a single file.
This is where the actual sketch is held. `THREE` is available as a global variable and it's strongly advised you use this rather than import the library yourself, to prevent unexpected behaviour. For convenience, `THREE.GLTFLoader` and `THREE.OrbitControls` are available too.

You can `require` other modules from here, so don't feel restricted to a single file.

### Very basic example
This is the minimum you need to do in order to use Hedron.

```javascript
const THREE = require('three')

class MyFirstSketch {
constructor () {
// Create a cube, add it to the root of the scene
Expand Down Expand Up @@ -91,11 +91,6 @@ A polyhedron that can spin on all axes. The user can change the speed of the rot
The user can change the scale. The user can also click on "shapeshift" and the geometry changes.
**/

/** HEDRON TIP **
Hedron uses three.js, so you'll need that :)
**/
const THREE = require('three')

/** HEDRON TIP **
Hedron sketches must be a class
**/
Expand All @@ -116,7 +111,7 @@ class Solid {
Must define a "root" property as a THREE.Group or THREE.Object3D
Hedron looks for this and will add it to the scene.
**/
this.root = new THREE.Group()
this.root = new THREE.Group() // THREE is a global var so no need to import

/** HEDRON TIP **
It's good practice to not manipulate the root object
Expand Down
Loading

0 comments on commit b7e055e

Please sign in to comment.