Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
648a9de
Remove trailing spaces in ModuleManager
sasha240100 Jun 22, 2017
f09bab1
DefineModule
sasha240100 Jun 22, 2017
84b8f6c
Fix examples
sasha240100 Jun 22, 2017
05a5308
Fix .define() in AnimationModule
sasha240100 Jun 22, 2017
68a7456
Fix examples & tests
sasha240100 Jun 22, 2017
b7c066e
Use DefineModule instead of CameraModule
sasha240100 Jun 22, 2017
99f1be6
Adjusts DefineModule example description patch#2
hirako2000 Jun 22, 2017
c75586c
wip: light {}, camera {}
sasha240100 Jun 24, 2017
799efb9
Fix light, camera
sasha240100 Jun 24, 2017
7044ea3
Merge remote-tracking branch 'origin/patch#2' into patch#2
sasha240100 Jun 24, 2017
3873e78
StateModule
sasha240100 Jun 24, 2017
3f49442
Change StateModule example
sasha240100 Jun 24, 2017
4982080
Fix StateModule example
sasha240100 Jun 24, 2017
a785fa4
Fix shadows on saturn example
sasha240100 Jun 24, 2017
6138765
Fix fov
sasha240100 Jun 24, 2017
e911aa5
Fix docs link
sasha240100 Jun 24, 2017
1a3e65f
Remove CameraModule test
sasha240100 Jun 24, 2017
36b03d6
Fix fov
sasha240100 Jun 24, 2017
71582f6
Fix alien example
sasha240100 Jun 24, 2017
5ced094
Fix animation
sasha240100 Jun 24, 2017
663db0f
StateModule docs
sasha240100 Jun 25, 2017
76578d6
Merge pull request #260 from WhitestormJS/beta
sasha240100 Jun 25, 2017
2d647ab
StateModule docs
sasha240100 Jun 26, 2017
0beefff
iframes
sasha240100 Jun 26, 2017
0e97fc8
Fixes spot and point light examples in doc - patch#2
hirako2000 Jun 26, 2017
60e2590
Make extend links
sasha240100 Jun 26, 2017
6d86ea3
Move extends
sasha240100 Jun 26, 2017
b690ff3
Add links
sasha240100 Jun 26, 2017
ecab692
classes order
sasha240100 Jun 26, 2017
a9e378e
Merge branch 'patch#2' of https://github.com/WhitestormJS/whitestorm.…
hirako2000 Jun 27, 2017
62cfdce
wip: rectarealight
sasha240100 Jun 27, 2017
3db85b5
Fix glitch example
sasha240100 Jun 27, 2017
9c7b747
Change ElementModule
sasha240100 Jun 27, 2017
f153a73
Add release badge
sasha240100 Jun 27, 2017
abdf618
Fix ElementModule
Jun 29, 2017
ab2fae3
manager.require
sasha240100 Jun 29, 2017
f0f08dd
Document manager.require
sasha240100 Jun 29, 2017
3a77dfb
Configure webpack
sasha240100 Jun 29, 2017
05eef6b
Adds cross-env and make build script use production patch#2
hirako2000 Jun 29, 2017
015b47e
Fix console.log's
sasha240100 Jun 30, 2017
4605eed
Fix existing meshes
sasha240100 Jun 30, 2017
2a0bb48
Add Circle & Cone
sasha240100 Jun 30, 2017
2982c95
Docs
sasha240100 Jun 30, 2017
e3f4e46
Add link to logo
sasha240100 Jun 30, 2017
ec0c4bc
Fix
sasha240100 Jun 30, 2017
f8e93e3
New readme
sasha240100 Jun 30, 2017
a9aa4d6
Fix Travis CI
sasha240100 Jun 30, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/WHY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
### Why?
* 🤔 Because making of even **a basic Three.js application requires at least ~20 lines of code** (see [this tutorial](https://threejs.org/docs/index.html#Manual/Introduction/Creating_a_scene))
- **Three.js:** you will need to setup: _scene, renderer, camera_, make an `animate()` function before making the actual app.
- **Whitestorm.js:** There are modules that helps you easily setup them:

```javascript
const app = new WHS.App([
new WHS.ElementModule(), // attach to DOM
new WHS.SceneModule(), // creates THREE.Scene instance
new WHS.DefineModule('camera', new WHS.PerspectiveCamera()), // creates PerspectiveCamera instance
new WHS.RenderingModule() // creates WebGLRenderer instance
]);

app.start(); // run animation
```

See [more about modules](https://medium.com/whitestormjs-framework/migrating-to-whitestormjs-v2-beta-module-system-2eeaeda08a80#.qqdn2mhct)

* 💣 **Adding physics is hard.**
- **Three.js:** To make your app run with physics you need to make a second world with same 3d objects and apply their transform (position & rotation) to your rendered scene objects (`THREE.Scene` for example) in every frame.
- **Whitestorm.js:** Can be done with modules in a few lines:

```javascript
const app = new WHS.App([
// Other modules...
new PHYSICS.WorldModule()
]);

const sphere = new WHS.Sphere({
geometry: {
radius: 3
},

modules: [
new PHYSICS.SphereModule({
mass: 10
})
],

material: new THREE.MeshBasicMaterial({color: 0xff0000}) // red material
});

app.start(); // run animation
```

Use [physics-module-ammonext](https://github.com/WhitestormJS/physics-module-ammonext) as your physics module.

Try with **physics** on [**Codepen**](http://codepen.io/sasha240100/pen/wgEXwN):

<a href="http://codepen.io/sasha240100/pen/wgEXwN"><img src="http://i.imgur.com/AcsnqTs.png" height="50" /></a>


* 🔌 **Components & plugins**
- **Three.js:** You can create meshes with geometry and material.
- **Whitestorm.js:** You can create components with advanced custom functionality.

```javascript
export class BasicComponent extends WHS.MeshComponent {
build() {
return new THREE.Mesh(
new THREE.IcosahedronGeometry(3, 5),
new THREE.MeshBasicMaterial({color: 0xffffff})
)
}

randomize() { // Additional function
this.position.set(Math.random() * 10, Math.random() * 10, Math.random() * 10);
}
}
```

- See [Component system in interactive 3D of web](https://medium.com/@_alex_buzin/component-system-in-interactive-3d-of-web-18348eecf270#.lynivy4ut) article for more info.
Loading