Start a new topic

3D model loading deformed after screen sleep/onPause

3D model loading deformed after screen sleep/onPause


Hi,

I got a problem with 3d model loading deformed (sticking the texture on screen/polygon points deformed) for some 3d models if the app sleeps/locks then resume when it is tracking..

Here's the code how i call it, as i want to save memory as for i have more than 20 models to load..

var marker1 = new AR.Trackable2DObject(this.tracker, "marker1", {

drawables: {

cam:

},

 

onEnterFieldOfVision: function onEnterFieldOfVisionFn() {

console.log('enter');

 

World.fish_minor = new AR.Model("assets/bone_fish/fish_minor.wt3",{

scale: {

x: 0.1,

y: 0.1,

z: 0.1

},

translate: {

x: 0,

y: -1,

z: -3

},

rotate: {

roll: 0,

tilt: 270,

heading: 0

},

onLoaded: function(){

setTimeout(function() {

World.fish_minor_anim_0 = new AR.ModelAnimation(World.fish_minor, "Animation_00");

World.fish_minor_anim_1 = new AR.ModelAnimation(World.fish_minor, "fish_Geo_GRP1_animation");

World.fish_minor_anim_2 = new AR.ModelAnimation(World.fish_minor, "fish_Geo_GRP2_animation");

World.fish_minor_anim_3 = new AR.ModelAnimation(World.fish_minor, "fish_Geo_GRP3_animation");

World.fish_minor_anim_4 = new AR.ModelAnimation(World.fish_minor, "fish_Geo_GRP4_animation");

World.fish_minor_anim_5 = new AR.ModelAnimation(World.fish_minor, "fish_Geo_GRP5_animation");

World.fish_minor_anim_6 = new AR.ModelAnimation(World.fish_minor, "fish_Geo_GRP6_animation");

World.fish_minor_anim_7 = new AR.ModelAnimation(World.fish_minor, "fish_Geo_GRP7_animation");

World.fish_minor_anim_8 = new AR.ModelAnimation(World.fish_minor, "fish_Geo_GRP8_animation");

World.fish_minor_anim_9 = new AR.ModelAnimation(World.fish_minor, "fish_Geo_GRP_animation");

World.fish_minor_anim_0.start(-1);

World.fish_minor_anim_1.start(-1);

World.fish_minor_anim_2.start(-1);

World.fish_minor_anim_3.start(-1);

World.fish_minor_anim_4.start(-1);

World.fish_minor_anim_5.start(-1);

World.fish_minor_anim_6.start(-1);

World.fish_minor_anim_7.start(-1);

World.fish_minor_anim_8.start(-1);

World.fish_minor_anim_9.start(-1);

},500);

}

});

marker.drawables.addCamDrawable(World.fish_minor);

 

World.vibrateDevice();

//}

},

onExitFieldOfVision: function onExitFieldOfVisionFn() {

console.log('exit');

room14_markB.drawables.removeCamDrawable(World.fish_minor);

World.fish_minor_anim_0.pause();

World.fish_minor_anim_1.pause();

World.fish_minor_anim_2.pause();

World.fish_minor_anim_3.pause();

World.fish_minor_anim_4.pause();

World.fish_minor_anim_5.pause();

World.fish_minor_anim_6.pause();

World.fish_minor_anim_7.pause();

World.fish_minor_anim_8.pause();

World.fish_minor_anim_9.pause();

World.fish_minor_anim_0.destroy();

World.fish_minor_anim_1.destroy();

World.fish_minor_anim_2.destroy();

World.fish_minor_anim_3.destroy();

World.fish_minor_anim_4.destroy();

World.fish_minor_anim_5.destroy();

World.fish_minor_anim_6.destroy();

World.fish_minor_anim_7.destroy();

World.fish_minor_anim_8.destroy();

World.fish_minor_anim_9.destroy();

World.fish_minor.destroy();

 

});

 

The wt3 file is attached with this post...

actually there are some other wt3 which has the same habit in my project

Bascially if one crashed, it will affect the whole arworld and the only thing you can do is to kill the app and restart the app...

Thank you for your help

Please test with latest SDK version (an update was just released yesterday) and check if the issue still occurs.

Also ensure to optimize your 3D Models for mobile use, a 6.5MB wt3 file is not recommended as it will consume multiples of the compressed filesize in memory.
Please try optimizing it so that it uses hald of the size approx.
Besides that I recommend using a datastructure that holds all required information of an augmentation, that way you can easily loop through components that need to be paused or destroyed instead of hardcoding them.

Best regards,
Andreas

 
Login or Signup to post a comment