The libigl vr viewer is an application developed with libigl and openvr for 3d model viewing in vr. The program has been tested and works on oculus devices (quests and rifts) along with windows. Theoretically it should work on other headsets as well but we never tried.
The project currently has the 3d models rendering and controller tracking working properly in vr with a companion window on flat screen. It's quite basic but a lot of features can be easily implemented from there.
On all platforms, the vr viewer requires cmake and a modern c++ compiler on Mac OS X¹, Linux², or Windows³.
SteamVR is also required for the viewer to run.
Cloned this repository using the --recursive
flag (if not then issue git submodule update --init --recursive
).
Inside the project folder, run:
mkdir build
cd build
cmake .. -T host=x64 -A x64
Open introduction.sln
and right click on introduction in the explorer to build/debug.
ALL_BUILD might not work, that's why the instruction above is the preferred way to get it running.
All of the changes we made to the libigl library are in include/igl/opengl
, including Viewer
and ViewerCore
We also made an additional directory under igl
called openvr
, which include the VRApplication
class.
drawVR()
: the same usage as draw(), but for vr.
ViewerCore(igl::openvr::VRApplication *VRapp)
: overloaded viewer core constructor for vr.
append_vrcore
: appends a core for the right eye.
An example usage can be found in main.cpp
This class handles all the calculation and rendering necessary for the vr viewer, which are called by ViewerCore.cpp