VR pool simulator written in Python (using pyopenvr)
- pyopenvr for VR
- sounddevice and soundfile for sound
- pytest and matplotlib for running the tests
Time-stepped physics using the Open Dynamics Engine is also supported if the ODE library with Python bindings is installed.
You can probably install most of the required packages listed above using pip
, e.g.
pip install pillow
I was not able to install cyglfw3
, 'pyopenvr', or ode
using pip
,
so I built them from source following the steps below:
First, you need to build or download the glfw
library binary for your platform
- the easiest way is to download pre-compiled binaries
from the official
glfw
site: http://www.glfw.org/download.html
Then build the cyglfw3 package:
git clone https://github.com/jzitelli/cyglfw3.git
cd cyglfw3
python setup.py build_py build_ext --include-dirs="{path to glfw include dir}" --library-dirs="{path to glfw dll dir}"
python setup.py install
At the moment I am using my own fork of https://github.com/cmbruns/pyopenvr. To clone and install:
git clone https://github.com/jzitelli/pyopenvr.git
cd pyopenvr
python setup.py install
ode
is the Python package of bindings for the Open Dynamics Engine.
This is my own fork of
The library and bindings are built from the same source repository.
To clone the repo and generate a Visual Studio solution (.sln
)
for building the library:
git clone https://github.com/jzitelli/ode.git
cd ode
cd build
premake4.exe --only-shared --only-double --platform=x64 vs2010
Then open the generated solution in Visual Studio
(probably ok to upgrade the solution to your version of VS if it asks you - I tested successfully with 2015 and 2017).
Compile a Release build for your target architecture (I believe this should match your version of Python, e.g. x64 or x86).
It should output a library ode\lib\Release\ode.dll
. You should add this location to your PATH environment variable or copy the file to a directory in your PATH.
To build the Python bindings, run from the Visual Studio Native Tools Command Line:
cd {directory where you cloned the repo}
cd bindings
cd python
python setup.py build_ext install
If installed successfully, from the Python interpreter you should be able to import the ode
package, e.g.
import ode
print(ode.__file__) # <-- assuming Python 3 here
and see something like ...\Anaconda3\lib\site-packages\ode.cp36-win_amd64.pyd
.
git clone https://github.com/jzitelli/poolvr.py.git
cd poolvr.py
python setup.py develop
Installation will place an executable poolvr
into your Python environment's path.
From a command-line, just enter:
poolvr
To run without VR:
poolvr --novr
For information on available command-line options and other help:
poolvr -h
From your cloned poolvr.py
repository root directory:
cd test
pytest --render