GLTF

Helper component to load and display GLTF format 3D models.


Screenshot of component GLTF basic

Usage

GLTF models can be provided as a .glb binary or as a descriptor file .gltf with included resources folder containing .bin formatted assets.

GLTF support and export from CAD software is discussed in the guide:

Usage is straightforward: import the component and model file, preload() the model, then use it in a 3D scene.

import { GLTF, Environment } from '@electricui/components-desktop-three'
import SpaceShipModel from './spaceship.glb'
 
// Preload the asset as early as possible for good user experience
GLTF.preload(SpaceShipModel)
 
function ModelViewer() {
return (
<Environment>
<GLTF asset={SpaceShipModel} />
</Environment>
)
}