node-ar.js

0.0.5 • Public • Published

Node-AR.js

Node.js installable AR.js based on AR.js by jeromeetienne.

  • AR.js v1.6.0

Usage

import * as THREE from 'three';
import {
  ArToolkitSource,
  ArToolkitContext,
  ArMarkerControls,
  ArSmoothedControls
} from 'node-ar.js';
 
// ArToolkitSource uses your version of THREE.js
const _artoolkitsource = ArToolkitSource(THREE);
const arToolkitSource = new _artoolkitsource({
  sourceType: 'webcam'
});

Currently, the other modules use a pre-installed 0.95.x version of THREE.js.

Other modules can be used simply as:

const arToolkitContext = new ArToolkitContext({
  cameraParametersUrl: cameraParam,
  detectionMode: 'mono',
  maxDetectionRate: 30,
  canvasWidth: 80 * 3,
  canvasHeight: 60 * 3
});
 
const markerControls = new ArMarkerControls(arToolkitContext, markerRoot, {
  type: 'pattern',
  patternUrl: markerPattern,
  changeMatrixMode: 'cameraTransformMatrix'
});
 
const smoothedControls = new ArSmoothedControls(smoothedRoot, {
  lerpPosition: 0.4,
  lerpQuaternion: 0.3,
  lerpScale: 1,
});

Example

Example usage can be found in this repository

TODO

Decouple all modules from THREE.js and make them rely on installer's THREE.js version

Readme

Keywords

Package Sidebar

Install

npm i node-ar.js

Weekly Downloads

0

Version

0.0.5

License

MIT

Unpacked Size

125 MB

Total Files

372

Last publish

Collaborators

  • josephrexme