three.js
Integrate three.js rendering into ImFusion Web SDK views with a CustomGlObject.
Here we show a simplified version of three.js' lights / arealight demo, integrated with the SDK's views.
Loading demo…
Set up three.js so it does not interfere with the SDK: disable auto-clear so it never wipes the SDK's output, and reset the GL state after each frame.
ts
From these definitions, we can implement the render and bounds functions required by the CustomGlObject interface.
ts
This defines our CustomGlObject that we can then add to the Display:
ts