PortalGL
Put Three.js content into your HTML layout and keep it aligned as the page scrolls.
Start here
Give an HTML element a scene, a 3D object, or an image plane. PortalGL handles positioning and resizing; you keep your renderer and animation loop.
-
Render a rotating cube inside a card, with a complete setup and cleanup example.
Recipes
-
Add more views, align objects with DOM elements, animate, and clip content.
-
Make a textured plane follow an HTML rectangle.
-
Add bloom or another TSL effect to a view or shared scene.
More control
-
Read DOM bounds without Three.js, or integrate with your own WebGL render loop.
-
Look up methods, defaults, supported layouts, and common fixes.