Import and export SceneModels as xeokit's native binary XGF format
This package allows us to import and export xeokit SceneModels as xeokit Geometry Format
(XGF), xeokit's
compact binary-encoded runtime asset delivery format for SceneModel data.
To import a XGF model into xeokit, use the loadXGF function, which will load the file into
a SceneModel. To export a XGF model, use the saveXGF function, which will save a
SceneModel to XGF.
Installation
npminstall@xeokit/sdk
Usage
In the example below, we will create a Viewer with
a WebGLRenderer and a Scene, which holds model geometry and materials.
On our Viewer, we will create a single View to render it to a canvas element on the page. We will
also attach a CameraControl to our View, allowing us to control its camera with mouse and touch input.
Within the Scene, we will create a SceneModel to hold a model. We will then use
loadXGF to load
a XGF file into our SceneModel.
XGF - xeokit Graphics Format
Import and export SceneModels as xeokit's native binary XGF format
This package allows us to import and export xeokit SceneModels as xeokit Geometry Format (XGF), xeokit's compact binary-encoded runtime asset delivery format for SceneModel data.
To import a XGF model into xeokit, use the loadXGF function, which will load the file into a SceneModel. To export a XGF model, use the saveXGF function, which will save a SceneModel to XGF.
Installation
Usage
In the example below, we will create a Viewer with a WebGLRenderer and a Scene, which holds model geometry and materials.
On our Viewer, we will create a single View to render it to a canvas element on the page. We will also attach a CameraControl to our View, allowing us to control its camera with mouse and touch input.
Within the Scene, we will create a SceneModel to hold a model. We will then use loadXGF to load a XGF file into our SceneModel.
Using saveXGF to export the SceneModel back to XGF: