Start a new topic

How to properly destroy 3D models?

How to properly destroy 3D models?


Hello! 

I am having an issue with destroying 3D models properly. If 3D model is not destroyed the next time it is loaded(after you trun camera view off and on) it loads up damaged. Here is how I destroy 3D model currently(the code is simplified): 

 

  var myTrackable = new AR.Trackable2DObject(tracker, image_name,  {

    onExitFieldOfVision: function onExitFieldOfView() {

    if(myTrackable.drawables.cam.length>0) 
   {

    for(var o=0; o < myTrackable.drawables.cam.length;o++)

    {

          if(myTrackable.drawables.cam.isLoaded())
          {
                   myTrackable.drawables.cam.destroy();
          }

    }

}

    });

 

This approach does not help. 

Also if there are more than 1 3D model in drawables application crashes when destroy() is called. It does not crash if only one 3D model added to drawables but if 2 or 3 it crashes.... 

Thank you for your advise. 

 

 

have you find a solution?
Login or Signup to post a comment