3D開發-AR.js 圖片匹配

圖片匹配方式html

    加載一張圖片做爲識別的pattern marker。spa

代碼code

AR.js/three.js/examples/marker-training/examples/patternmarker-from-image.html修改代碼htm

//從圖片加載匹配模式three

        // load image and convert it to a marker圖片

        var imageURL = '../../res/arjs/marker/inner/inner-letterA.png';ci

        THREEx.ArPatternFile.encodeImageURL(imageURL, function onComplete(patternFileString) {it

            var patternURL = 'data:text/plain;base64,' + btoa(patternFileString)io

            // create THREEx.ArMarkerControlsbase64

            var markerControls = new THREEx.ArMarkerControls(arToolkitContext, markerRoot1, {

                type: 'pattern',

                patternUrl: patternURL,

//                patternUrl : "../../res/arjs/data/pattern-letterA.patt",

            })

        })

相關文章
相關標籤/搜索