aframe Controls (component) Look controls


Example

The look-controls component:

  • Rotates the entity when we rotate a VR head-mounted display (HMD).
  • Rotates the entity when we click-drag mouse.
  • Rotates the entity when we touch-drag the touchscreen.

The look-controls component is usually used alongside the camera component.

<a-entity camera look-controls></a-entity>

Caveats

If you want to create your own component for look controls, you will have to copy and paste the HMD-tracking bits into your component. In the future, we may have a system for people to more easily create their controls.

Adding gaze to cursor

For this you need to add a cursor component to your camera

<a-scene>
  <a-camera>
    <a-cursor></a-cursor>
    <!-- Or <a-entity cursor></a-entity> -->
  </a-camera>
</a-scene>

More information you could find on the cursor (component) topic.