https://github.com/moisestech/united-internet-nations
United Internet Nations in Threejs
https://github.com/moisestech/united-internet-nations
Last synced: about 1 year ago
JSON representation
United Internet Nations in Threejs
- Host: GitHub
- URL: https://github.com/moisestech/united-internet-nations
- Owner: moisestech
- Created: 2014-06-06T20:08:38.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-10T23:54:01.000Z (about 12 years ago)
- Last Synced: 2024-04-13T09:21:03.048Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 11.1 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
FPS0
====
A ThreeJS/physics experiment, with first person controls and minimal collision detection.
The goal of this project was to explore the options for a simple game with first person controls that runs completely in a browser. To achieve this I wanted to be able to
- load a 'level', i.e. a basic 3D model (in this case with Blender)
- create 'WASD' first person type of controls
- apply simple physics with collision detection to walk around and
interact with objects
- add dynamic objects on runtime
Luckily, all of the ground work was already done by someone else. :-)
Basically this demo merges the [Blender scene loader](http://mrdoob.github.com/three.js/examples/webgl_loader_scene_blender.html) of [mrdoobs](http://mrdoob.com/) [ThreeJS library](http://mrdoob.github.com/three.js/) and the [CannonJS](https://github.com/schteppe/cannon.js) [FPS example](https://github.com/schteppe/cannon.js/blob/master/examples/threejs_fps.html) by [schteppe](https://github.com/schteppe).
I added the idea that the imported Blender geometry gets turned into a static model in the physics engine by finding the cubes and adding invisible physical collision boxes to their position.
This worked surprisingly well and gives some sort of minimal FP(S) - completely running in the browser.
The imported Blender model is turned into a static model by adding the boxes as static physic objects. This way this you can 'walk' on the objects of the Blender model (the grey objects in the screenshot).

Important: to try it locally you still must run it from a web server (for example 'python -m SimpleHTTPServer') due to cross-origin security issues.