Viewer3D.loadModel() method

Load a model into current viewer.

Signature:

loadModel(modelId: string, configOrOnProgress?: LoadModelConfig | ProgressFn, changeCamera?: boolean): Promise<string>;

Parameters

ParameterDescription
modelIdThe global unique ID to this model under developer account.
configOrOnProgressConfig object for model loading. Accept config object or onProgress callback function.
changeCameraModify the camera position and rotation to fit the entire scene after model being loaded.

Returns:

Promise<string>

A promise contains the model id.

Example

var modelId = '';
var viewer = new Modelo.View.Viewer3D("model");
// using config object
viewer.loadModel(modelId, { initialTransform: [], onProgress: percentage => console.log('load', percentage) });
// shortcut if progress report is the only thing needed
viewer.loadModel(modelId, percentage => console.log('upload', percentage));