Skip to main content

LCC for Web Manual · v0.6.3 · Page 7 of 68

LCCRender::load

Loads LCC data and returns an LCCObject.

The Web SDK supports Three.js and CesiumJS engines. Pass the corresponding engine parameters to load an LCC model.

Version Requirement

SDK v0.2.0+

Engine Support

Three.js / CesiumJS

API

LCCRender::load(param: LoadOptions, successFunc: SuccessFunc, progressFunc: ProgressFunc, failureFunc: FailureFunc, preProcessFunc?: PreProcessFunc): LCCObject

Parameters

param (Three.js)

ParameterTypeRequiredDefaultDescription
param.cameraTHREE.PerspectiveCamera / THREE.OrthographicCameraYes-Three.js camera object.
param.sceneTHREE.SceneYes-Three.js scene object.
param.renderLibTHREEYes-Three.js library reference, e.g., import * as THREE from 'three'.
param.renderLibWebgputypeof import('three/webgpu')No-Three.js WebGPU module reference, e.g., import * as THREE_WEBGPU from 'three/webgpu'.
param.renderLibTSLtypeof import('three/tsl')No-Three.js TSL module reference, e.g., import * as TSL from 'three/tsl'.
param.rendererTHREE.WebGLRendererYes-Three.js renderer.
param.dataPathString / ObjectYes-LCC data path. Supports string path (.lcc / .lcc2 / meta.lcc with token) or path descriptor object.
param.canvasHTMLCanvasElementYes-Canvas element for rendering, available via renderer.domElement.
param.appKeyStringNo-AppKey for removing the watermark.
param.useEnvBooleanNo-Whether to display environment data.
param.useIndexDBBooleanNotrueWhether to enable local data caching. SDK v0.5.0+
param.useLoadingEffectBooleanNofalseWhether to enable loading effects. SDK v0.5.1+
param.loadingEffectCenter{ x: number, y: number, z: number }No-Center position of the loading effect. SDK v0.5.1+
param.pointsColorStringNo'default'Point cloud display style: 'default' (original color) or 'rainbow' (elevation color).
param.modelMatrixTHREE.Matrix4No-Model matrix. SDK v0.5.2+
param.maxHostCacheSizenumberNo-Host cache size. SDK v0.5.4+
param.maxGpuCacheSizenumberNo-GPU cache size. SDK v0.5.4+
param.usePrecisionRaycastBooleanNotrue (PC)Enable high-precision raycasting. Enabled by default on PC; not supported on mobile. SDK v0.6.3+

param (CesiumJS)

ParameterTypeRequiredDefaultDescription
param.cameraCesium.CameraYes-Cesium camera object.
param.sceneCesium.SceneYes-Cesium scene object.
param.renderLibCesiumYes-CesiumJS library reference, e.g., import * as Cesium from 'cesium'.
param.dataPathString / ObjectYes-LCC data path. Supports string path (.lcc / .lcc2 / meta.lcc with token) or path descriptor object.
param.canvasHTMLCanvasElementYes-Canvas element for rendering, available via viewer.scene.canvas.
param.modelMatrixCesium.Matrix4No-Model transformation matrix. Not required for RTK georeferenced data.
param.appKeyStringNo-AppKey for removing the watermark.
param.useEnvBooleanNo-Whether to display environment data.
param.useIndexDBBooleanNotrueWhether to enable local data caching. SDK v0.5.0+
param.useLoadingEffectBooleanNofalseWhether to enable loading effects. SDK v0.5.1+
param.loadingEffectCenter{ x: number, y: number, z: number }No-Center position of the loading effect. SDK v0.5.1+
param.pointsColorStringNo'default'Point cloud display style: 'default' (original color) or 'rainbow' (elevation color).
param.maxHostCacheSizenumberNo-Host cache size. SDK v0.5.4+
param.maxGpuCacheSizenumberNo-GPU cache size. SDK v0.5.4+
param.usePrecisionRaycastBooleanNotrue (PC)Enable high-precision raycasting. Enabled by default on PC; not supported on mobile. SDK v0.6.3+

Callback Functions

ParameterTypeRequiredDescription
successFunc(model: any) => voidYesModel load success callback. Parameter is the constructed mesh.
progressFunc(progress: number) => voidYesModel load progress callback. Parameter is the percentage (0–1).
failureFunc() => voidYesModel load failure callback.
preProcessFunc(buffer: ArrayBuffer, filename: string) => Promise<{ data: ArrayBuffer; rawData: ArrayBuffer }>NoData pre-processing callback for processing data before rendering. SDK v0.5.0+

dataPath Format

dataPath supports two formats:

Option 1: String path (recommended)

Pass a string directly specifying the LCC data path:

  • Full .lcc file path, e.g., http://example.com/data/xxxx.lcc. SDK v0.4.1+ (recommended)
  • Full .lcc2 file path, e.g., http://example.com/data/xxxx.lcc2. SDK v0.6.0+ (recommended)
  • meta.lcc file path with token and other parameters for encrypted data scenarios, e.g., https://example.com/data/meta.lcc?token=xxx&other=xxx
  • Directory path requiring a meta.lcc file in the directory, e.g., https://example.com/data (deprecated)
const lccObject = LCCRender.load({
    // ...other params
    dataPath: 'http://example.com/data/xxxx.lcc',
}, successFunc, progressFunc, failureFunc);

Option 2: Path descriptor collection (SDK v0.5.0+)

Use an object to customize all file paths with encryption support, applicable to LCC format.

File path descriptor format:

{
    "fileName": {
        "url": "xxxxxxxxxxxx",
        "header": { "field1": "xxx", "field2": "yyy" }  // Optional, added to HTTP request headers
    }
}

Example:

const dataPath = {
    meta: { url: 'http://example.com/xxx/meta.lcc' },
    index: { url: 'http://example.com/xxx/index.bin' },
    data: { url: 'http://example.com/xxx/data.bin' },
    environment: { url: 'http://example.com/xxx/environment.bin' },
    collision: { url: 'http://example.com/xxx/collision.lci' },
    shcoef: { url: 'http://example.com/xxx/shcoef.bin' },
};

const lccObject = LCCRender.load({
    // ...other params
    dataPath: dataPath,
}, successFunc, progressFunc, failureFunc);

Return Value

LCCObject — LCC model object with interfaces for raycasting, clipping, render control, and more.

Notes

  • Three.js engine requires calling LCCRender.update() in the render loop.
  • The param.useSH parameter is deprecated; use the LCCObject.useShcoef() method instead.
  • The param.gpuAcceleration parameter is deprecated.
  • dataPath supports .lcc format (SDK v0.4.1+) and .lcc2 format (SDK v0.6.0+).
  • LCCRender::unload()
  • LCCRender::update()
  • LCCRender::dispose()

XGRIDS documentation, reproduced as published and captured on October 27, 2026. Read this page on docs.xgrids.com

Stuck on a Step?

QRC supports every scanner and software seat it sells. Send us the page you are on and we will walk you through it.

Contact Us
Request a Quote