poolvr
所属分类:工具库
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2017-10-08 01:37:01
上 传 者:
sh-1993
说明: 在WebVR中玩台球!,
(Play pool billiards in WebVR!,)
文件列表:
Gruntfile.js (1995, 2016-01-24)
LICENSE (1082, 2016-01-24)
favicon.ico (51262, 2016-01-24)
fonts/ (0, 2016-01-24)
fonts/Anonymous Pro B.ttf (153708, 2016-01-24)
fonts/Anonymous Pro.ttf (158080, 2016-01-24)
fonts/Anonymous Pro_Regular.js (245473, 2016-01-24)
fonts/FONTLOG.txt (2166, 2016-01-24)
fonts/OFL-FAQ.txt (30202, 2016-01-24)
fonts/OFL.txt (4521, 2016-01-24)
images/ (0, 2016-01-24)
images/deck.png (1196, 2016-01-24)
images/mouseParticle.png (1361, 2016-01-24)
images/nx.png (223053, 2016-01-24)
images/ny.png (293499, 2016-01-24)
images/nz.png (238462, 2016-01-24)
images/px.png (320261, 2016-01-24)
images/py.png (304450, 2016-01-24)
images/pz.png (432645, 2016-01-24)
index.html (49262, 2016-01-24)
lib/ (0, 2016-01-24)
lib/Primrose.js (285773, 2016-01-24)
lib/leap-widgets-0.1.0.js (48773, 2016-01-24)
lib/leap.transform.js (6036, 2016-01-24)
lib/three-r73.js (811837, 2016-01-24)
lib/three.js (906062, 2016-01-24)
lib/webvr-manager.js (124482, 2016-01-24)
lib/webvr-polyfill.js (72298, 2016-01-24)
obj/ (0, 2016-01-24)
obj/poolvr.js (90525, 2016-01-24)
package.json (1455, 2016-01-24)
pyserver/ (0, 2016-01-24)
pyserver/__init__.py (0, 2016-01-24)
pyserver/flask_app.py (5072, 2016-01-24)
pyserver/pool_table.py (18764, 2016-01-24)
pyserver/site_settings.py (64, 2016-01-24)
pyserver/templates/ (0, 2016-01-24)
... ...
# **poolvr**
Play pool / billiards with your [Leap Motion controller](https://www.leapmotion.com) in VR (or fullscreen mode), in a web browser!
![screenshot](http://jzitelli.github.io/poolvr/images/poolvr-0.1.0.png)
## About:
**poolvr** uses [three.js](http://threejs.org) to provide WebGL graphics and [Cannon.js](http://www.cannonjs.org) to provide real-time physics.
If you use a WebVR-enabled browser, you can play in VR! This feature uses [webvr-boilerplate](https://github.com/borismus/webvr-boilerplate).
The three.js pool table scene and Cannon.js world is defined procedurally via a Python script.
This project began as an experimental example that I introduced into
my fork of [Primrose](http://www.primroseeditor.com), which was my own starting point for WebVR development.
[**poolvr** became my entry](http://subvr.itch.io/poolvr) into the [Leap Motion 3D Jam](http://itch.io/jam/leapmotion3djam) (at literally the last minute).
**poolvr** is the main WebVR project that I'm working on now.
It's been improved since the [Leap Motion 3D Jam](http://itch.io/jam/leapmotion3djam) ended! Some amazing features are planned!
## Obtaining the latest WebVR-enabled browsers:
- Mozilla Firefox supports WebVR in its nightly builds, [see MozVR for more info](http://mozvr.com)
- [WebVR-enabled builds of Chrome / Chromium](http://blog.tojicode.com/2014/07/bringing-vr-to-chrome.html)
## Configuration:
You can configure the graphics and other aspects of **poolvr** via URL parameters. Some of the recognized URL parameters are:
- `useBasicMaterials`: defaults to `true`, which configures bare-bones, low-expectation setting "EGA" graphics for max performance and compatibility
- `useShadowMap`: defaults to `false`, shadows will be rendered as projected meshes. If `true`, shadows are rendered via three.js shadow maps.
- `host`: network address of the Leap Motion WebSocket server
## How to host locally (tested under Windows 7, Windows 10, Ubuntu 14, Fedora 22):
1. Clone this repository
2. From your cloned **poolvr** root directory: ```bash
git submodule init
git submodule update```
3. Follow either A or B:
A. Serving the static file `index.html`:
** BROKEN AT THE MOMENT **
1. Start a Python HTTP server from the root directory:
- using Python 2: `python -m SimpleHTTPServer`
- using Python 3: `python -m http.server`
2. Point your browser to `http://127.0.0.1:8000`
B. Tornado / Flask application serving dynamically generated HTML:
This method requires some extra Python packages, but offers more functionality.
1. Set up a Python environment with the required packages.
I recommend using the [Miniconda Python distribution](http://conda.pydata.org/miniconda.html),
which will let you easily install the Python dependencies (using the `conda` Python package manager): ```bash
conda install tornado
conda install flask
conda install numpy```
2. Run the Python script `pyserver/tornado_app.py`: ```bash
python pyserver/tornado_app.py```
3. Point your browser to `http://127.0.0.1:5000/poolvr`
The Tornado server is configured to also serve any file within the project tree (nice for local development, but probably a bad idea to deploy to an actual web server).
For instance, you can access the static `index.html` that you would obtain with method A via `http://127.0.0.1:5000/index.html`.
## Acknowledgements:
The following amazing open-source projects have helped make **poolvr** possible:
JavaScript libraries:
- [Leap Motion JavaScript framework](https://github.com/leapmotion/leapjs)
- [LeapJS-Plugins](https://github.com/leapmotion/leapjs-plugins)
- [three.js](http://threejs.org)
- [Cannon.js](http://www.cannonjs.org)
- [Primrose](https://www.primroseeditor.com)
- [webvr-boilerplate](https://github.com/borismus/webvr-boilerplate)
- [Shader Particle Engine](https://github.com/squarefeet/ShaderParticleEngine)
Python packages:
- [Tornado](http://www.tornadoweb.org)
- [Flask](http://flask.pocoo.org/)
- [NumPy](http://www.numpy.org)
The space nebula cube map background was created with [Space 3D](http://wwwtyro.github.io/space-3d/#animationSpeed=1&fov=90&nebulae=true&pointStars=true&resolution=1024&seed=1bblx79ds&stars=true&sun=false).
## TODO list:
- add 8-ball / other pool/billiards game logic
- Leap Motion hand interactions (e.g. point at the ball you want to pocket next)
- improve and add more sounds
- menu / menus
- tweak cannon.js parameters
- multi-user
- render balls as sphere imposters
- improve cardboard / mobile experience
近期下载者:
相关文件:
收藏者: