JSPM

artoolkit5-js

0.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q40464F
  • License LGPL-3.0

ES6 module port of artoolkit5

Package Exports

  • artoolkit5-js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (artoolkit5-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

artoolkit5-js

ES6 module port of artoolkit5. Based on the (now defunct) original Emscripten to JavaScript port and improved by Walter Perdan.

This build is uses WASM for best possible performance.

Usage

Install the module via NPM:

npm install artoolkit5-js

The module is built in UMD format and can be used in different environments:

Browser

<script src="/path/to/ARToolkit.js"></script>

Node.js

const ARToolkit = require('artoolkit5-js');

ES6 Import

import ARToolkit from 'artoolkit5-js';

After successfully importing the module you need to initialize it using the init() method:

const artoolkit = new ARToolkit();
artoolkit.init()
.then(_ => {
  return artoolkit.loadCamera('/data/camera_para.dat');
})
.then(cameraId => {
  console.log('Got camera ID', cameraId);
})
.catch(err => {
  console.log('Something went wrong', err);
});

You can access all public ARToolkit methods and class constants like this:

  // for the full API documentation see
  // https://github.com/artoolkitx/artoolkit5
  artoolkit.detectMarker( ... );

  console.log(artoolkit.AR_LOG_LEVEL_DEBUG);