I wonder how to properly load multiple 3D models from remote URL. The problem with my code below is that even though 3D models load they do not show up until I take camera view away from target image and then take it back on it.
When there is only 1 3D model in a collection then it shows up most of the time right after when myTrackable.drawables.addCamDrawable(m); is called. However if there are 2 or 3 3D models being loaded, then the onLoaded() is being called every time which is good but the model does not appear on target image unless I take camera view away. What could be the problem? What is the proper way of loading multiple 3D models from remote URL?
By the way, I am using Server Side image recognition and the code below is triggered only after successful response from the server arrives. This is why I do not start loading 3D models from inside of onEnterFieldOfVision()
Thank you for your advise!
// Create trackable object
var myTrackable = new AR.Trackable2DObject(tracker, image_name,
{
onEnterFieldOfVision: function onEnter() { },
onExitFieldOfVision: function onExitFieldOfView() { }
});
// Load 3D models
for(var c=0; c < models_collection.length; c++)
{
var m = new AR.Model(target_url,
{
onLoaded: function modelLoadedLoaded() {
myTrackable.drawables.addCamDrawable(m);
}
}
}
A
Andreas Schacherbauer
said
almost 9 years ago
Hi Sergey, Maybe this one is related to the screen snapping issue that you reported where drawables appear stretched. I will create a case for it and take a look at it.
Sorry that I can't give you more advice at this time.
Sergey.kargopolov
1 person has this problem