Open jaider opened 5 years ago
Here's an input that draws a controller with laser: https://github.com/facebook/react-360/tree/master/Examples/inputs You'll see it used in a lot of projects we've developed with partners.
Our team is currently working on improving this fuctionality, as well.
Actually, even better, what you want is this: https://www.npmjs.com/package/react-vr-controller-raycaster
Add it to your project, it draws a controller and laser, and works for both 3dof and 6dof inputs
Actually, even better, what you want is this: https://www.npmjs.com/package/react-vr-controller-raycaster
Add it to your project, it draws a controller and laser, and works for both 3dof and 6dof inputs
This is for React VR, Does it work for React 360?
I was able to test raycaster package in both: React VR and React 360.
In React VR works as expected, a "laser" beam with a dot at the end.
In React 360 I had a little of challenge: First I got this error:
failed: UnableToResolveError: Unable to resolve module
ovrui
fromE:\my-playground\demoReact360\client.js
: Module does not exist in the module map
I fixed by installing the package manually npm install --save ovrui
and works but the "laser" is not displayed, only the dot at the end.
The Input example also is build for React VR. Visually, looks great! like native laser from Oculus, but projection over View is off. It only project great on the background (chess). The default static position of the hand/control is a little forward, but I don't mind it.
Any way we could this working with React 360? This seems to be only working with "vr instance" . I can only see the dot, but not the laser nor the "controller/hand"
I was able to get it working with React 360. Cloned ControllerRayCaster.js and made these changes
add a mesh builder to generate mesh and add it to scene, in the constructor. Make sure to pass the scene from ReactInstance to the Controller, otherwise initialize with a new THREE.Scene
Update fillDirection to update the position and quaternion of the mesh
Update fillOrigin to update position of the mesh
Added code changes from this commit to support Left/Right - whichever controller is active
@devsatish are you able to create a working example of it? I can't reproduce your tips with success at this moment. My main goal is to make Gear VR controller work with React 360.
@devsatish @andrewimm how you make ControllerRayCaster run , please let us know I also followed but no luck , please help there is no example for ControllerRaycaster in the Examples. All the examples are using react-vr not react-360.
Description
Feature Request. I wish to be able to activate Oculus Rift Controller in VR mode... It will be great if we can make the Oculus Rift controller (or a hand) appears in VR mode and show a laser beam as many Oculus Rift Native apps has, so we can have a better experience interacting with VrButtons.
Expected behavior
Be able to see Oculus Rift controller and track the movement/cursor with a laser beam in VR Mode.
Actual behavior
Controllers are not displayed in VR Mode.
Reproduction
Solution
I see an example of ThreeJS with HTC Vive Controller, but I haven't see any with laser beam. This could be a good starting point. I believe other web frameworks such as
A-Frame
already support this out of the box.Additional Information