React-360: Positioning relative to the camera orientation?

Created on 16 Dec 2016  路  4Comments  路  Source: facebookarchive/react-360

Is there any way currently, to position a component in the center of screen (always)?
I want to render a gaze cursor.

Most helpful comment

A bit of requirement gathering.

We do have a gaze cursor built in, which you can enable using something like this (from the tour sample)

  const vr = new VRInstance(bundle, 'TourSample', parent, {
    // Show a gaze cursor.
    cursorEnabled: true,
    ...options,
  });

You can also control if it autohides when not over something that is interactive via cursorAutoHide: bool in the same VRInstance options object.

This will enable the cursor when on mobile or in VR but not on desktop and this is purposeful as in that case we default controls to the mouse pointer.

If you want to handle you own gaze cursor then I'd suggest you don't handle the rendering within the React VR code. The reason for this is that the React VR code runs asynchronously in the a webwork and for a gaze cursor you want this pinned to the camera, lag is really not desired. To do this you will want to make use of the render function of the VRInstance, see the CubeSample client.js for an example. I can put together a small demo of this over the weekend.

Does this help?

All 4 comments

A bit of requirement gathering.

We do have a gaze cursor built in, which you can enable using something like this (from the tour sample)

  const vr = new VRInstance(bundle, 'TourSample', parent, {
    // Show a gaze cursor.
    cursorEnabled: true,
    ...options,
  });

You can also control if it autohides when not over something that is interactive via cursorAutoHide: bool in the same VRInstance options object.

This will enable the cursor when on mobile or in VR but not on desktop and this is purposeful as in that case we default controls to the mouse pointer.

If you want to handle you own gaze cursor then I'd suggest you don't handle the rendering within the React VR code. The reason for this is that the React VR code runs asynchronously in the a webwork and for a gaze cursor you want this pinned to the camera, lag is really not desired. To do this you will want to make use of the render function of the VRInstance, see the CubeSample client.js for an example. I can put together a small demo of this over the weekend.

Does this help?

Yeah, helps a ton! Thanks.

Please feel free to reopen if you need more information

Hi guys, do you have any working example of the
Gaze Pointer in react-vr app?

Was this page helpful?
0 / 5 - 0 ratings