Skip to content

No texture loaded when adding GLTF model #11871

@cstopdown

Description

@cstopdown

What happened?

Summary

Hello! I am a beginner building my own app using Cesium for the first time
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. And I find no any error log info in console.
Please help me to solve the problem, thanks!

Situation

Here is the file tree and code:

503449812008477127
├── I005_013.glb
├── I005_013_textures
│ ├── 0.jpg
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── …
const loadGltfModel = async () => {
  const url = `/citygis-backend/api/3d/getAsset/503449812008477127/I005_013.glb`
  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)
}

screenshots:

validate scene:

image

Cesium scene:

image

Reproduction steps

...

Sandcastle example

No response

Environment

Browser:Microsoft Edge Version:122.0.2365.66
CesiumJS Version:1.112
Operating System:Windows 11
CPU:13th Gen Intel(R) Core(TM) i9-13900HX 2.20 GHz
GPU:NVDIA Geforce RTX 4060 Laptop
GPU Driver:546.65
Memory:64.0 GB

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions