A minimal First Person Scenery with a Blender level and dynamic content
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 of mrdoobs ThreeJS library and the CannonJS FPS example by 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).
Some information
To play around with it simply download the files by clicking the links above. For more information checkout the repository here.
Here's the live example.
Here's a screenshot.
And this is the scene in Blender.