Created
December 21, 2016 14:48
-
-
Save demonixis/49419221bfc412d2802da95f9f589bdf to your computer and use it in GitHub Desktop.
A simple C++ program that reads the rotation of the Pimax 4k HMD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <PVR_API.h> | |
#include <iostream> | |
int main(int argc, char** argv) | |
{ | |
pvrResult result = pvr_initialise(); | |
if (result == pvr_success) | |
{ | |
std::cout << "PVR SDK Initialized!" << std::endl; | |
PvrHmdHandle hmd; | |
result = pvr_createHmd(&hmd); | |
if (result == pvr_success) | |
{ | |
std::cout << "PVR Device Created!" << std::endl; | |
pvrPoseStatef pose; | |
result = pvr_getHmdPoseState(hmd, &pose); | |
if (result == pvr_success) | |
{ | |
std::cout << "Rotation W: " << pose.ThePose.Orientation.w << std::endl; | |
std::cout << "Rotation X: " << pose.ThePose.Orientation.x << std::endl; | |
std::cout << "Rotation Y: " << pose.ThePose.Orientation.y << std::endl; | |
std::cout << "Rotation Z: " << pose.ThePose.Orientation.z << std::endl; | |
} | |
} | |
else | |
std::cout << "PVR Device Not Created" << std::endl; | |
} | |
else | |
std::cout << "PVR SDK Not Initialized."; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi. this looks perfect. sadly i have no idea how to use it. does it work if i disable the sensor in piplay? can i get the data into freetrack/opentrack with this?