GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — jsartoolkitNFT/examples/node/example_dist.js at master · webarkit/jsartoolkitNFT Expand file tree/ Copy pathexample_dist.jsMore file actions 35 lines (30 loc) · 1.07 KB / Copy pathexample_dist.jsFile metadata and controls35 lines (30 loc) · 1.07 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 const jsartoolkitNFT = require("../../dist/ARToolkitNFT_node.js"); const sharp = require("sharp"); async function init() { const arControllerNFT = await new jsartoolkitNFT.ARControllerNFT( 2000, 1500, "/camera_para.dat", ); const ar = await arControllerNFT._initialize(); // process() expects RGBA pixel data, so add the alpha channel. const data = await sharp("pinball-demo.jpg").ensureAlpha().raw().toBuffer(); const imageData = new Uint8Array(data.buffer); ar.on("getNFTMarker", function (e) { console.log("NFT marker detected: ", e.data.marker); }); const cameraMatrix = ar.getCameraMatrix(); ar.loadNFTMarker("DataNFT/pinball", function (id) { console.log("marker id is: ", id); ar.trackNFTMarkerId(id); const marker = ar.getNFTData(id); console.log("nftMarker data: ", marker); console.log("cameraMatrix: ", cameraMatrix); // process() must run after the marker is loaded; NFT tracking // needs several iterations before it locks on. for (let i = 0; i < 10; i++) { ar.process(imageData); } }); } init(); |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |