Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nice work! How to change the marker?Thank you! #4

Open
gascendcn opened this issue Oct 13, 2020 · 1 comment
Open

Nice work! How to change the marker?Thank you! #4

gascendcn opened this issue Oct 13, 2020 · 1 comment

Comments

@gascendcn
Copy link

Nice work! How to change the marker?Thank you!

@fcor
Copy link
Owner

fcor commented Oct 13, 2020

Hello! you can try using barcode markers, which are part of AR.js core.

Here's the full collection of barcodes:
https://github.com/nicolocarpignoli/artoolkit-barcode-markers-collection

This is how you can select any of the presets:

'3x3': artoolkit.AR_MATRIX_CODE_3x3,
'3x3_HAMMING63': artoolkit.AR_MATRIX_CODE_3x3_HAMMING63,
'3x3_PARITY65': artoolkit.AR_MATRIX_CODE_3x3_PARITY65,
'4x4': artoolkit.AR_MATRIX_CODE_4x4,
'4x4_BCH_13_9_3': artoolkit.AR_MATRIX_CODE_4x4_BCH_13_9_3,
'4x4_BCH_13_5_5': artoolkit.AR_MATRIX_CODE_4x4_BCH_13_5_5,

And here's an example:

 <a-scene
      embedded
      arjs="detectionMode: mono_and_matrix; matrixCodeType: 3x3_HAMMING63;"
      renderer="logarithmicDepthBuffer: true;"
      vr-mode-ui="enabled: false"
    >
      <a-assets>
        <a-asset-item id="bowser" src="../assets/bowser.glb"></a-asset-item>
      </a-assets>
      <a-marker type="barcode" value="0">
         <a-entity
          position="0 0 1"
          scale="0.1 0.1 0.1"
          rotation="-90 0 0"
          gltf-model="#bowser"
        ></a-entity>
      </a-marker>
      <a-marker type="barcode" value="1">
        <a-entity
          position="0 0 1"
          scale="0.1 0.1 0.1"
          rotation="90 180 0"
          gltf-model="#bowser"
        ></a-entity>
      </a-marker>
      <a-entity camera></a-entity>
    </a-scene>

Once you have this up and runnng you should just gesture components exactly as on marker examples and that's it. Keep in mind that gestures only work with one marker at a time. If you have multiple markers you need some logic to select with model will be modified by gesture events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants