Load a model into certain viewport. When loading done, it will trigger onSuccess callback. The loading will fail if there is already a model loaded in current renderer. In this case, users should call unload first.
Signature:
loadModelAtViewport(modelId: string, viewportIdx: number, configOrOnProgress?: LoadModelConfig | ProgressFn): Promise<{}>;
Parameter | Description |
---|---|
modelId | The model's id. |
viewportIdx | Which viewport you want the model to be displayed. |
configOrOnProgress | LoadModelConfig | Pass a callback of onprogress or a object contains both initail transform of the model and onprogress. |
Returns:
Promise<{}>
The promise to resolve when the loading is done or fails.