问题
I am trying to follow this blog post to customize the viewer to look around a model by tilting. When I load this extension from onModelLoadSuccess, it works for some models but crashes the viewer on larger models. If I load it from an event later in the load process, such as GEOMETRY_LOADED, the model partially loads but some objects don't get rendered. Which event is the right one to load this extension from? And is there a way to make it behave on larger models, >50MB?
回答1:
Try waiting on the TEXTURES_LOADED_EVENT event, like this...
https://github.com/wallabyway/forge-pdf-report/blob/6babb6d7332b6cdb983f57e7d140ff59a5136705/docs/index.html#L44
taken from: How do can I load model and change materials before showing it in the Forge Viewer
to load larger models... you may want to consider the upcoming OTG format (which you can try through BIM360 design collaboration)
回答2:
I figured out the problem...I had to up the memory limit on the viewer. I guess the constant screen refresh eats memory.
var config3d = {
memory: {
limit: 1000 // in MB
}
};
var viewerDiv = document.getElementById('MyViewerDiv');
viewer = new Autodesk.Viewing.Private.GuiViewer3D(viewerDiv, config3d);
Does the OTG format work for models coming from BIM 360 Docs?
回答3:
yes - there's two improvements here...
- (easy) add a low-pass filter to take out human 'shakes' and low-quality MEMs sensor shakes ( see what I did for http://pano.autodesk.com )
- (hard) use the Forge Viewer, as a pano renderer.
For 2., take a screenshot of the ForgeViewer to a half-cube-map (use the screenshot API 10 times... 2x [front, left, right, top, bottom]. Then stitch them into the inside of a cube. Now you've got a pano, locked to the camera position. When the user teleports to a new position, or the person turns past 180' from front view, regenerate the cubemap/pano. This technique is great for large scenes with lots of mesh-popping, and you're phone slow... and you've run out of options. ;-)
来源:https://stackoverflow.com/questions/55750203/when-to-load-custom-panorama-extension