ImFusion Web SDK

babylon.js

Integrate babylon.js rendering into ImFusion Web SDK views with a CustomGlObject.

Here we show a simplified version of babylon.js' Area Lights demo, integrated into the SDK's views.

Loading demo…

babylon.js defaults to a left-handed coordinate system, so set the scene to right-handed to match the SDK. It also has no single "reset GL state" call, so we reset its caches and gl.CULL_FACE each frame.

ts

In render, map the SDK matrices to the camera:

ts

Add it to the views:

ts