Cesium 加载gltf

Cesium 加载gltf_第1张图片

Cesium 加载gltf_第2张图片

imageBasedLightingFactor:指定基于漫射和高光图像的照明因子参数

    let position = Cesium.Cartesian3.fromDegrees(
      104.17401, 30.65793, 10
    );
    const heading = Cesium.Math.toRadians(135);
    const pitch = 0;
    const roll = 0;
    const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
    const orientation = Cesium.Transforms.headingPitchRollQuaternion(
      position,
      hpr
    );
    viewer.entities.add({
      name: "C3",
      position: position,
      orientation: orientation,
      model: {
        uri: "./C3.gltf",
        minimumPixelSize: 128,
        maximumScale: 20000,
        heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND,
        imageBasedLightingFactor:new Cesium.Cartesian2(4,1)
      },
    });

你可能感兴趣的:(前端,javascript,开发语言)