Please have a look at the sample application which is included in the SDK download package. You can see there in detail in which .html file (not an .xml) should be included and how it's handled.
Greetings
Nicola
J
Jbeli_mohamed1
said
about 8 years ago
Hi,in which HTML file i must to includ this code of architect.js :<script src="architect://architect.js"></script>
should i includ it in activity_main.xml or in AndroidManifest.xml file.
C
Christian Ebner
said
about 8 years ago
Please have a look at the documentation. There is a detailed description how to setup an AR View.
H
Hamza KOUKI
said
about 8 years ago
Hi,
I have the same problem and i want to know what do you mean includ js file in the HTML is it the AndroidManifest ?
C
Christian Ebner
said
about 8 years ago
Hi, first check if you included the architect.js file in your HTML:
<script src="architect://architect.js"></script>
second, start the animation only after the 3d model has been loaded. Therefore implement the onLoaded function of the AR.Model.
var modelUri = "butterfly.wt3"; var animationName = "butterfly_animation";
var model = new AR.Model(modelUri, { onLoaded : function() { var animation = new AR.ModelAnimation(model, animationName, { onStart: function(){ console.log("animation started"); }, onFinish: function(){ console.log("animation finished"); } }); animation.start(-1);
}});
Hope that helps, Christian
J
Jbeli_mohamed1
said
about 8 years ago
Hi, i want to add some 3D objects (.wt3) on my project and saw examples that uses Model and animation to add this object, but i can't instanciate this 3D object. I ask if there are class or library for the resolution of this problem?
Code :
// instantiate the model object
var model = new AR.Model("butterfly.wt3");
// instantiate the model animation with the animation id
var animation = new AR.ModelAnimation(model, "butterfly_animation");
Jbeli_mohamed1