vinciDa Posted May 30 Share Posted May 30 I need the gaze directions (L and R eyes) for C++ rendering engine. Using `v1.3.3.0`. After importing the `bin, lib, include` folders in the rendering engine, I am a bit lost. I can see from the c API, runtime is working: https://imgur.com/e2Z4lf2https://imgur.com/e2Z4lf2 Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted June 1 Share Posted June 1 Hi @vinciDa, Could you explain more about C++ rendering project? Could you provide sample project for further investigation? And, how could we setup the PC environment to build it? Link to comment Share on other sites More sharing options...
vinciDa Posted June 3 Author Share Posted June 3 C++ rendering project: [VRWorks Graphics SDK](https://developer.nvidia.com/vrworks#tabs-section); it has variable_rate_shading_dx sample code I am using visual studio 2017 on the win10 (64bit) framework. p.s. which sranipal sdk version (current 1.3.6.8) and sranipal runtime version would you suggest for a stable implementation? Link to comment Share on other sites More sharing options...
vinciDa Posted June 5 Author Share Posted June 5 #include "SRanipal_SDK/include/SRanipal.h" #include "SRanipal_SDK/include/SRanipal_Eye.h" #include "SRanipal_SDK/include/SRanipal_Enums.h" ... int2 offset = makeint2(rtSceneDesc.width / 2, rtSceneDesc.height / 2); int2 gazeOffset = makeint2(0, 0); switch (m_eyeTrackingMode) { case ETM_MousePointer: { float2 normalizedMousePosition = makefloat2(float(m_mousePosition.x) / float(m_clientWindowSize.x), float(m_mousePosition.y) / float(m_clientWindowSize.y)); int2 scaledMousePosition = makeint2(int(std::round(normalizedMousePosition.x * rtSceneDesc.width)), int(std::round(normalizedMousePosition.y * rtSceneDesc.height))); gazeOffset = scaledMousePosition - offset; break; } case ETM_SRAnipal: { //ViveSR::anipal::Eye::VerboseData::combined; ViveSR::anipal::Eye::EyeData_v2 eye_data_v2; //float *gaze = eye_data_v2.verbose_data.combined.eye_data.gaze_direction_normalized.elem_; int2 gazeOffset = makeint2(int(eye_data_v2.verbose_data.combined.eye_data.gaze_direction_normalized.x),int( eye_data_v2.verbose_data.combined.eye_data.gaze_direction_normalized.y)); break; } The mouse pointer tracking is working, but the eye tracking is fixed at the center of the screen. Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted June 6 Share Posted June 6 Hi @vinciDa, Did your code run into ETM_SRAnipal case? If it does, it should be the x and y values are 0. According to this post, We suggest developer to move to OpenXR instead of using SRanipal legacy SDK. BTW, may I know which VR device are you using for your development? Link to comment Share on other sites More sharing options...
vinciDa Posted June 6 Author Share Posted June 6 Hi @VIVE_chengnay, thanks for taking your time. the ETM_SRAnipal case is the user interface. You are right, the X and Y values are (0,0). I need the real-time gaze direction. Do I first initialize the eye-engine to get the gaze directions? I am using NVIDIA's VRWorks SDK, and it uses OpenVR. So, if I integrate OpenXR would be a good idea or not. Because OpenVR and OpenXR serve the same purpose. However, I am aware of the OpenXR script for eye tracking. So what are you suggesting, I should ignore the sranipal (legacy) and use openxr? I am using Vive Pro Eye. Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted June 6 Share Posted June 6 Hi @vinciDa, I check the C# script and could you check the status first? Not sure if you can get below status and use Initial API. SRanipal_Eye_Framework.Instance.EnableEye SRanipal_Eye_Framework.Status Error result = SRanipal_API.Initial(SRanipal_Eye_v2.ANIPAL_TYPE_EYE_V2, IntPtr.Zero); Link to comment Share on other sites More sharing options...
vinciDa Posted June 7 Author Share Posted June 7 22 hours ago, VIVE_chengnay said: I check the C# script and could you check the status first? I am talking about the`C_API` actually. Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted June 8 Share Posted June 8 Hi @vinciDa, I know, I am just referring to C# script to explain how we process to get the data from SRanipal. Could you try finding corresponding API to try? Link to comment Share on other sites More sharing options...
vinciDa Posted June 10 Author Share Posted June 10 Hi @VIVE_chengnay, I have solved my problem. One last question, what is the difference between version 1 and version 2? For example, there are SRanipal_EyeData_v1.h SRanipal_EyeData_v2.h Also, in Unreal, I see the versions. Which version should I use? V2? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now