Skip to content

josephrexme/Node-AR.js

 
 

Repository files navigation

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

About

Node.js fork of AR.js for Augmented Reality

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 81.6%
  • HTML 16.3%
  • Makefile 0.5%
  • Brainfuck 0.4%
  • C 0.4%
  • Forth 0.4%
  • Other 0.4%