Forum Discussion
cybereality
12 years agoGrand Champion
Minimal Oculus Application Tutorial
Hey guys!
I put together this simple tutorial, showing the bare minimum code needed to work with the Oculus SDK.
https://developer.oculus.com/wiki/index.php?title=Minimal_Oculus_Application
It's basically just a console application that prints out some values from the headset. This could be a good place to start if you are confused about what is part of the SDK and what is just part of the demos. It also shows how simple it is to work with the SDK. Of course, it won't show how to handle stereo 3D, or distortion, or all the complex stuff. But it's a start.
Hope that helps,
- Andres
Updated tutorial for 0.3.x SDK:
https://developer.oculus.com/wiki/Minimal_Oculus_Application_0.3.x
I put together this simple tutorial, showing the bare minimum code needed to work with the Oculus SDK.
https://developer.oculus.com/wiki/index.php?title=Minimal_Oculus_Application
It's basically just a console application that prints out some values from the headset. This could be a good place to start if you are confused about what is part of the SDK and what is just part of the demos. It also shows how simple it is to work with the SDK. Of course, it won't show how to handle stereo 3D, or distortion, or all the complex stuff. But it's a start.
Hope that helps,
- Andres
Updated tutorial for 0.3.x SDK:
https://developer.oculus.com/wiki/Minimal_Oculus_Application_0.3.x
33 Replies
- cyberealityGrand ChampionI need to update the wiki to the latest SDK. Please give me a moment.
- cyberealityGrand Champion
- provezanoHonored GuestI've tested your application and I some constants aren't recognized.
In this line:ovrHmd_StartSensor(hmd, ovrHmdCap_Orientation | ovrHmdCap_YawCorrection | ovrHmdCap_Position | ovrHmdCap_LowPersistence, ovrHmdCap_Orientation);
I found those constants in the OVR_CAPI file, as follows:typedef enum
{
ovrSensorCap_Orientation = 0x0010, // Supports orientation tracking (IMU).
ovrSensorCap_YawCorrection = 0x0020, // Supports yaw correction through magnetometer or other means.
ovrSensorCap_Position = 0x0040, // Supports positional tracking.
} ovrSensorCaps;
So, if I change the line above toovrHmd_StartSensor(hmd, ovrSensorCap_Orientation | ovrSensorCap_YawCorrection | ovrSensorCap_Position | ovrHmdCap_LowPersistence, ovrSensorCap_Orientation);
it works.
--
Is it possible to capture those values while I am trying an example at the same time :?: - cyberealityGrand ChampionAh yes, there were some changes in 0.3.2 that broke this example.
Thanks for bringing this to my attention. - jhericoAdventurer
"provezano" wrote:
ovrHmd_StartSensor(hmd, ovrSensorCap_Orientation | ovrSensorCap_YawCorrection | ovrSensorCap_Position | ovrHmdCap_LowPersistence, ovrSensorCap_Orientation);
Don't pass in anything that isn't an "ovrSensorCap_" capabilities into StartSensor. In particular, ovrHmdCap_LowPersistence isn't part of the sensor capabilities. Since these are bitfields, injecting a bitfield from the wrong type can erroneously turn on or off some feature you didn't expect.
Also, you don't need to duplicate anything in required that is already in supported, unless you explicitly want the function to return false and not start the sensors if it's not supported. - cyberealityGrand ChampionOK, I updated the tutorial. The line should look like this:
ovrHmd_StartSensor(hmd, ovrSensorCap_Orientation| ovrSensorCap_YawCorrection | ovrSensorCap_Position, ovrSensorCap_Orientation);
- provezanoHonored GuestHow about my question?
Is it possible to capture those values while I am trying an example at the same time :?:
I mean... I can use and capture the coordinates from my mouse at the same time, is it possible to do the same with Oculus? Because I tried that example and the Oculus becomes unavailable for another application. - cyberealityGrand ChampionCurrently only one application can interface with the Rift at a time.
- geekmasterProtege
"cybereality" wrote:
Currently only one application can interface with the Rift at a time.
Unless that application is a USB multiplexer, such as is commonly used to feed a USB webcam video stream to multiple apps. This method could work for the Rift as well. It is not that hard to find a way to get beyond artificial limitations like your "only one application" constraint. - fire2kHonored GuestA little question about the tutorial:
To get this to work I also have to explicitly link to "shell32.lib" and "gdi32.lib", even though they are totally in the inherited values. If I don't link those two specifically I get Linker failures.
I've noticed that the OculusTinyRoom also explicitly links everything inherited in again. Is there a reason for this?
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 3 months ago
- 2 years agoAnonymous
- 3 months ago