Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VR control does not working when using other VR headmount #9

Closed
oUp2Uo opened this issue Feb 20, 2024 · 6 comments
Closed

VR control does not working when using other VR headmount #9

oUp2Uo opened this issue Feb 20, 2024 · 6 comments

Comments

@oUp2Uo
Copy link

oUp2Uo commented Feb 20, 2024

Hi, I am now trying on another VR headmount (HTC vive),
but VR control does not working.
Render result can be seen.
Last time, the program went well on Quest 3.
Do you have any idea about this?
Thank you.

@hyperlogic
Copy link
Owner

I don't have a functioning HTC Vive to test with, but likely the issue is that the hand controllers do not have a thumbstick, but instead have those weird trackpad things. It might be possible to map the trackpad_x and trackpad_y input to stick. Here's a suggestion to fix it:

diff --git a/src/app.cpp b/src/app.cpp
index 33e5cf4..dd9d741 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -784,6 +784,12 @@ bool App::Process(float dt)
         bool valid, changed;
         xrBuddy->GetActionVec2("l_stick", &leftStick, &valid, &changed);
         xrBuddy->GetActionVec2("r_stick", &rightStick, &valid, &changed);
+
+        xrBuddy->GetActionFloat("l_trackpad_x", &leftStick.x, &valid, &changed);
+        xrBuddy->GetActionFloat("l_trackpad_y", &leftStick.y, &valid, &changed);
+        xrBuddy->GetActionFloat("r_trackpad_x", &rightStick.x, &valid, &changed);
+        xrBuddy->GetActionFloat("r_trackpad_y", &rightStick.y, &valid, &changed);
+
         MagicCarpet::ButtonState buttonState;
         xrBuddy->GetActionBool("l_select_click", &buttonState.leftTrigger, &valid, &changed);
         xrBuddy->GetActionBool("r_select_click", &buttonState.rightTrigger, &valid, &changed);

The fix might be more involved then this... I'm not sure the trackpad origin is (0,0) and I'm not sure if the trackpad origin goes back to (0,0) after your thumb is lifted from it.

@oUp2Uo
Copy link
Author

oUp2Uo commented Feb 21, 2024

This works! Thank you very much.
One trackpad for moving left/right and front/back, another for rotating roll.

Btw, HTC vive is too old, and trackpad is sooo hard to use.
How could they design such a control device at that time.

@hyperlogic
Copy link
Owner

I modified that patch a bit, I now check to see if the trackpad is "pressed" before moving the user. This should make it less prone to move if your thumb brushes up against the trackpad. Let me know if this works or not, if you get a chance.

Thanks

@hyperlogic
Copy link
Owner

You can re-download the zip, or build off of the main branch to get this fix.

@oUp2Uo
Copy link
Author

oUp2Uo commented Feb 22, 2024

Hi, I have tested the latest version.
This latest version need to press the trackpad then move it.
Last old version both pressing or not worked.
I think the latest version is better, which could reduce mis-operation.

@oUp2Uo
Copy link
Author

oUp2Uo commented Feb 22, 2024

And one more thing is about the rendering speed.
When using a small ply file(<100MB, like a figure/doll), the program can run >60 fps on Geforce RTX 2080 Ti.
But if using a big ply file(~2GB, like a room), the program can only run ~9 fps, whcih is hard for VR.
I saw an issue of gpu-radix-sort loryruta/gl-radix-sort#3
And I wonder if this is why having low FPS when points number is huge.

Btw, I have tried some other GS rendering program, like https://github.com/shg8/VulkanSplatting, this one can render the same big ply file very fast.
(Is Vulkan a new version of OpenGL? Sorry I have no knowledege about this.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants