While overlays may be a better fit for certain scenarios, the content inserted with behaves just like the standard Forge models - you can interact with it both programatically and through user input.Īfter loading the extension the usual way, call its (async) method addNewModel to create a new Model and instantiate a ModelBuilder for it: async function addModel(viewer) )
The extension is not meant to replace the scene overlays mentioned above. The extension allows you to create Models similar to those you load from the Model Derivative service, and populate them on-the-fly. Let's take a look at it! What it can and can't do Well, if this is something you've been waiting for, worry no more! The Forge Viewer team has put together a new extension that turns your custom three.js content into 'proper' viewer models:. You cannot hover or select the objects, move camera to them using the Viewer APIs, and so on. While these techniques work - meaning that you can see your custom objects rendered with your custom materials - they don't really play well with the rest of the viewer. We usually recommend using scene overlays, and those feeling more adventurous go directly to the uncharted territories of or. Embedding custom three.js geometry into Forge Viewer is a very common request.