Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cmbruns/pyopenvr
Unofficial python bindings for Valve's OpenVR virtual reality SDK
https://github.com/cmbruns/pyopenvr
Last synced: 2 months ago
JSON representation
Unofficial python bindings for Valve's OpenVR virtual reality SDK
- Host: GitHub
- URL: https://github.com/cmbruns/pyopenvr
- Owner: cmbruns
- License: bsd-3-clause
- Created: 2016-05-07T14:10:42.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2024-10-09T17:26:52.000Z (4 months ago)
- Last Synced: 2024-11-11T11:16:00.640Z (3 months ago)
- Language: Python
- Homepage:
- Size: 21.5 MB
- Stars: 252
- Watchers: 25
- Forks: 41
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- vr-resources - pyopenvr, Unofficial python bindings for Valve's OpenVR virtual reality SDK
README
# pyopenvr
### Unofficial python bindings for Valve's OpenVR virtual reality SDK, located at https://github.com/ValveSoftware/openvr## DEPRECATION NOTICE
Our upstream SDK OpenVR is no longer being updated. Everyone is switching to OpenXR instead. We are working on similar bindings for OpenXR at https://github.com/cmbruns/pyopenxr
## Installation
- [ ] Install Python 3.5+ https://www.python.org/download/
- [ ] Install HTC Vive SteamVR
- [ ] ``pip install openvr`` OR download the installer at https://github.com/cmbruns/pyopenvr/releases## Use
```python
import sys
import time
import openvropenvr.init(openvr.VRApplication_Scene)
poses = [] # will be populated with proper type after first call
for i in range(100):
poses, _ = openvr.VRCompositor().waitGetPoses(poses, None)
hmd_pose = poses[openvr.k_unTrackedDeviceIndex_Hmd]
print(hmd_pose.mDeviceToAbsoluteTracking)
sys.stdout.flush()
time.sleep(0.2)
openvr.shutdown()
```For more advanced usage, consult the example at https://github.com/cmbruns/pyopenvr/blob/master/src/samples/glfw/hellovr_glfw.py, which is a complete faithful translation into python from the original C++ sample at https://github.com/ValveSoftware/openvr/tree/master/samples/hellovr_opengl