Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am a Japanese student. Sorry if my English is strange.
I am using HTCVIVE

 I want to add an event that accompanies the controller pad information by webXR in three.js I want to add an event that when the pad part of the controller is moved, the displayed object is also moved. I am using HTCVIVE. The events for the trigger button operations are in the official example, but I can't find any other button operations in the example. I did some research and found that as of June 2020, webXR cannot get information about the pad? Is this situation still the same? I have a code that works with the now deprecated WebVR. It looks like it is written this way. And I have confirmed that this code does not work in webXR

this is code work in webVRAPI

What I have tried:


controller1.addEventListener('axischanged', move);
.
.
.
function move(event){
    if(this.getButtonState('thumbpad') && this.getButtonState('trigger') === false){
      var z = event.axes[0];
      var x = event.axes[1];
      group.position.x = group.position.x + 100 * x;
      group.position.z = group.position.z + 100* z;
    }
    if(this.getButtonState('thumbpad') && this.getButtonState('trigger')){
      var y = -event.axes[1];
      group.position.y = group.position.y + 100* y;
    }
  }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900