Closed ghost closed 6 years ago
Check out the A-Frame documentation on how to load a model. I basically used the
I'm stumbling through the "own marker" bit, but I was trying to use barcode markers and they are currently broken. The theory for one of the other markers is that you'd probably have to add the training pattern for the marker (not Hiro or Kanji) and ensure it's loaded into jsartoolkit properly, but I haven't done that yet.
for use my own pattern I did the following:
I create my own github data --> https://github.com/darasat/data ( I trained the pattern with http://flash.tarotaro.org/blog/2009/07/12/mgo2/)
I create a variable in the aframe-ar.js called testURL THREEx.ArToolkitContext.testURL = 'https://raw.githubusercontent.com/darasat/data/'
Following in the parameters section
THREEx.ArToolkitProfile.prototype.reset = function () { this.sourceParameters = { // to read from the webcam sourceType : 'webcam', }
this.contextParameters = {
cameraParametersUrl: THREEx.ArToolkitContext.baseURL + '../data/data/camera_para.dat',
detectionMode: 'mono',
}
this.defaultMarkerParameters = {
type : 'pattern',
patternUrl : THREEx.ArToolkitContext.testURL + 'master/tiger.patt'
}
return this
};
THREEx.ArToolkitProfile.prototype.testMarker = function () { this.contextParameters.detectionMode = 'mono'
this.defaultMarkerParameters.type = 'pattern'
this.defaultMarkerParameters.patternUrl = THREEx.ArToolkitContext.testURL+ 'master/tiger.patt'
return this
}
init: function () { // honor this.data.preset if( this.data.preset === 'tiger' ){ this.data.type = 'pattern' this.data.patternUrl = THREEx.ArToolkitContext.testURL+'master/tiger.patt' }
In the HTML add a aframe scene with the assets from the model and new preset pattern in this case tiger model for example
and this works!
I hope this solves the problem of the own marker with custom 3d Model, greetings from Colombia.
custom marker #
Hello How to add my own maker and 3dmodels in webAR using A-Frame
Thanks in advance