Frame rate debugging support
stats.js provides a simple message box to help run performance monitoring code.
// stats.js Add to AR.js // Create and add to the stats dom was State = new Stats (); document.body.appendChild( stats.dom ); // update when rendering is performed stats.update(); |
artoolkit debugging turned on
When ArToolkitContext initialization, debug = true turn on debugging features
// stats.js Add to AR.js // create atToolkitContext arToolkitContext = new THREEx.ArToolkitContext({ cameraParametersUrl: '../../res/arjs/data/camera_para.dat', detectionMode: 'mono', debug: true, }); |
Support Print this matching rate
// ARjs / RES / js / threex / threex-armarkercontrols.js var curMatchValue = 0; arController.addEventListener('getMarker', function(event){ curMatchValue = event.data.marker.cfPatt; // debug.js function printMatchValue() { setInterval(function () { console.log("ARjs match: " + curMatchValue) curMatchValue = 0 },1000) } |
Coordinate debugging support
Use THREE.AxesHelper, added to the root ar rendering space
// coordinate support for debugging: -X axis red, green -Y axis, blue -Z axis var axesHelper = new THREE.AxesHelper( 2 ); smoothedRoot.add( axesHelper ); |