2

I'm using the multimodel loader of the Autodesk. When I load the same model to the viewer, the position of previous model shifts to a different position.

I'm using transformations, like translation,rotation and scaling, to adjust the position of the model so that is overlays over the first model. Is there a way to load the model in a way where it overlaps on loading the second model?

Also, for the z-oriented rvt and nwc files, is there a fix?

For reference, I have been following these blogs: https://forge.autodesk.com/blog/preparing-your-viewing-application-multi-model-workflows

https://forge.autodesk.com/blog/preparing-your-viewing-application-multi-model-workflows-part-2-model-loader

Daniel
  • 2,355
  • 9
  • 23
  • 30
Bi SAl MhRzn
  • 61
  • 2
  • 7

1 Answers1

0

It seems to have another placement or offsets applied to loaded models while using the ModelLoaderExtension. If you just want to load the same model twice, here is a sample for you:

var models = [
  '123.svf',
  '123.svf'
];


function _onGeometryLoaded( event ) {
 if( urns.length <= 0 ) {
     viewer.removeEventListener(
       Autodesk.Viewing.GEOMETRY_LOADED_EVENT,
       _onGeometryLoaded
     );
     return;
 }

 viewer.loadModel( urns[0], { globalOffset: event.model.getData().globalOffset } );
 urns.splice( 0, 1 );
}

viewer.addEventListener(
 Autodesk.Viewing.GEOMETRY_LOADED_EVENT,
 _onGeometryLoaded
);

viewer.loadModel( urns[0] );
urns.splice( 0, 1 );

Hope it helps!

Eason Kang
  • 6,155
  • 1
  • 7
  • 24