Hello! I’m first to use the CesiumJS to build my own app. When I use the Entities API to load the GLTF2.0 Model which converted by Mayo, the model is showed, but no any textures were loaded. I try to use Online 3D Viewer to validate my model and find all well. Please help me to solve the problem, thanks!
Here is the file tree and code:
503449812008477127
├── I005_013.glb
├── I005_013_textures
│ ├── 0.jpg
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── …
code:
const loadGltfModel = async (assetId) => {
const url = /citygis-backend/api/3d/getAsset/503449812008477127/I005_013.glb
// fetch for glb file
const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0, 0.0)
const heading = 89.5354
const pitch = 0
const roll = 0
const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll)
const orientation = Cesium.Transforms.headingPitchRollQuaternion(
position,
hpr
)
const entity = await viewer.entities.add({
name: url,
position: position,
orientation: orientation,
model: {
uri: url,
}
})
viewer.zoomTo(entity)
}
validate scene:
in Cesium:
My native language is not English, please forgive any unclear expressions. Thank you!