All Projects → fcor → arjs-gestures

fcor / arjs-gestures

Licence: MIT license
Rotate and zoom with touch gestures on any Image tracking or Marker Based AR.js scene

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to arjs-gestures

argon-aframe
glue to use aframe to author argon applications
Stars: ✭ 45 (-60.87%)
Mutual labels:  aframe
aframe-bmfont-text-component
A-Frame component for rendering bitmap fonts.
Stars: ✭ 62 (-46.09%)
Mutual labels:  aframe
aframe-lsystem-component
L-System/LSystem component for A-Frame to draw 3D turtle graphics. Using Lindenmayer as backend.
Stars: ✭ 33 (-71.3%)
Mutual labels:  aframe
lvr
👓 Augmented Reality for everyone - Out of the world experiences
Stars: ✭ 92 (-20%)
Mutual labels:  aframe
aframe-fit-texture-component
A fit-texture component for A-Frame VR.
Stars: ✭ 22 (-80.87%)
Mutual labels:  aframe
aframe-low-poly
low poly add-ons for aframe virtual reality
Stars: ✭ 18 (-84.35%)
Mutual labels:  aframe
globe-ar
3D Globe data visualization component in AR
Stars: ✭ 40 (-65.22%)
Mutual labels:  aframe
aframe-controller-cursor-component
A cursor for tracked controllers.
Stars: ✭ 30 (-73.91%)
Mutual labels:  aframe
virtual-reality-tour
📍 Virtual reality travel in Google Street View.
Stars: ✭ 34 (-70.43%)
Mutual labels:  aframe
aframe-speech-controls-component
alternative form of inputs for in-VR interaction with the content of a scene
Stars: ✭ 13 (-88.7%)
Mutual labels:  aframe
a-frame-demos
VR demos built with A-Frame
Stars: ✭ 19 (-83.48%)
Mutual labels:  aframe
aframe-react
React library for A-frame
Stars: ✭ 58 (-49.57%)
Mutual labels:  aframe
aframe-globe-component
3D Globe data visualization component for A-Frame
Stars: ✭ 27 (-76.52%)
Mutual labels:  aframe
a-blast
💥 Save the World From the Cutest Creatures in the Universe!
Stars: ✭ 116 (+0.87%)
Mutual labels:  aframe
aframe-xylayout
Flexbox like 2D layout + UI components for A-Frame.
Stars: ✭ 23 (-80%)
Mutual labels:  aframe
zanzarah-tools
The set of various zanzarah browsing and editing tools, written entirely in coffee and js.
Stars: ✭ 29 (-74.78%)
Mutual labels:  aframe
aframe-keyboard
An Aframe component that renders a fully functional 3D keyboard, that works on mobile, desktop browers, and VR headsets!
Stars: ✭ 23 (-80%)
Mutual labels:  aframe
aframe-registry
[DISCONTINUED] Curated collection of community A-Frame components.
Stars: ✭ 76 (-33.91%)
Mutual labels:  aframe
aframe-markdown
Render Markdown using SDF text in A-Frame.
Stars: ✭ 20 (-82.61%)
Mutual labels:  aframe
aframe-resonance-audio-component
🅰️ Google Resonance Audio (omnitone) for A-Frame
Stars: ✭ 33 (-71.3%)
Mutual labels:  aframe

AR.js & A-Frame Gestures

gesture sample

Example of using gesture events on AR.js with A-Frame. This work is based on this example from 8th Wall.

Scale and rotate 3D elements from your AR.js scene using gesture-detector and gesture-handler components.

Try now!

Image Tracking

🚀Open this sample on your phone and scan this picture

Marker Tracking

🚀Open this sample on your phone and scan this marker

Installation

Import this file if you want default touch events. Keep reading to learn how to extend it.

<script src="https://raw.githack.com/fcor/arjs-gestures/master/dist/gestures.js"></script>

How it works?

gesture-detector listens to regular touch events directly on a-scene and emits a custom event indicating how many fingers were involved ("one", "two", "three" or "many") and passing some details of the event, like the position, spread and coordinates where user touched the screen. This component was developed by 8th Wall for their A-Frame based demos and can be found here.

gesture-handler adds listeners for custom gesture events, emitted by gesture-detector. This component should be placed on the 3D element we want to control and it automaticaly detects if the marker or image is found or lost to ensure the element could only be manipulated if it's actually visible. This component could be customized via properties. Currently supports pinch to zoom and finger spin for rotating the element.

Properties

Property Description Default Value
enabled Whether gesture controls are enabled. true
rotationFactor Factor for controlling rotation 5
minScale Minimum scale applied to the 3D element 0.3
maxScale Minimum scale applied to the 3D element 8

Examples

Image Tracking

<a-scene
  arjs="trackingMethod: best; sourceType: webcam; debugUIEnabled: false;"
  embedded
  renderer="logarithmicDepthBuffer: true;"
  vr-mode-ui="enabled: false"
  gesture-detector
  id="scene"
>
  <a-nft
    type="nft"
    url="https://arjs-cors-proxy.herokuapp.com/https://raw.githack.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex/trex-image/trex"
    smooth="true"
    smoothCount="10"
    smoothTolerance=".01"
    smoothThreshold="5"
    raycaster="objects: .clickable"
    emitevents="true"
    cursor="fuse: false; rayOrigin: mouse;"
  >
    <a-entity
      gltf-model="https://arjs-cors-proxy.herokuapp.com/https://raw.githack.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex/scene.gltf"
      scale="5 5 5"
      position="50 150 0"
      class="clickable"
      gesture-handler="minScale: 0.25; maxScale: 10"
    >
    </a-entity>
  </a-nft>
  <a-entity camera></a-entity>
</a-scene>

Marker Tracking

<a-scene
  arjs
  embedded
  renderer="logarithmicDepthBuffer: true;"
  vr-mode-ui="enabled: false"
  gesture-detector
  id="scene"
>
  <a-assets>
    <a-asset-item
      id="bowser"
      src="https://cdn.glitch.com/06bd98b4-97ee-4c07-a546-fe39ca205034%2Fbowser.glb"
    >
    </a-asset-item>
  </a-assets>

  <a-marker
    preset="hiro"
    raycaster="objects: .clickable"
    emitevents="true"
    cursor="fuse: false; rayOrigin: mouse;"
    id="markerA"
  >
    <a-entity
      id="bowser-model"
      gltf-model="#bowser"
      position="0 0 0"
      scale="0.05 0.05 0.05"
      class="clickable"
      gesture-handler
    >
    </a-entity>
  </a-marker>
  <a-entity camera></a-entity>
</a-scene>

Credits

Kudos to 8th wall for sharing their A-Frame Manipulate example!

Bowser 3D model was made by santiago3052008 and can be found here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].