cesium加载.gltf数据出现的问题

Cesium数据资源 · yushiyang · 于 3年前 发布 · 5085 次阅读

我想请问下,加载gltf数据报这个错,这个是什么问题? message: "Failed to load model: ./CesiumMilkTruck.gltf↵Unexpected token < in JSON at position 0" name: "RuntimeError" stack: "Error↵ at new RuntimeError (http://localhost:8080/js/about.js:72566:19)↵ at http://localhost:80

代码: var viewer = new Cesium.Viewer('cesiumContainer', {

    geocoder: false,
    homeButton: false,
    sceneModePicker: false,
    baseLayerPicker: false,
    fullscreenButton: false,
    scene3DOnly: true, //如果设置为true,则所有几何图形以3D模式绘制以节约GPU资源
    navigationInstructionsInitiallyVisible: false,
    navigationHelpButton: false,
    animation: false,
    timeline: false,
    fulllscreenButtond: false,
    vrButton: false,
    infoBox: false
});

//加载gltf格式数据到cesium
var scene = viewer.scene;

var position = Cesium.Cartesian3.fromDegrees(123.2856, 41.76692, 0);
var heading = Cesium.Math.toRadians(135);
var pitch = 0;
var roll = 0;
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);

var entity = viewer.entities.add({
    position: position,
    orientation: orientation,
    model: {
        uri: "./CesiumMilkTruck.gltf",
        minimumPixelSize: 128,
        maximumScale: 20000
    }
});
viewer.trackedEntity = entity;
共收到 0 条回复
没有找到数据。
添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics