cesiumjs3d-modelczml

using 3D models in CZML file to move an object


I am creating a CZML file, I have a path that I want my object to follow that path and move on it location by location (I defined positions based on time epoch.)

It works perfectly with billboard with an image, but when I change my code to have a model, for example one of the 3D models in sandcastle, instead of billboard it is not working. It does not even show the model. I just have a label, moving around the path, but no sign of model.

What is the problem? I deeply want to use 3D model in CZML files, not in javaScript. I will be delighted if someone could help me with it.

I saved the my data in .czml file and then I will load them in html by javaScript as follow:

viewer.dataSources.add(Cesium.CzmlDataSource.load('../../SampleData/fstsp_solution.czml'));

and a copy of my czml file is:

[
  {
    "id":"document",
    "version":"1.0"
  },
  {
    "id":"Vehicle",
    "availability":"2012-08-04T16:00:00Z/2012-08-04T17:04:54.9962195740191Z",
    "model":{
    "show":true,
      "gltf":"../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.bgltf",
      "scale":2,
      "minimumPixelSize":25
    },
    "oriantation":{
      "interpolationAlgorithm":"LAGRANGE",
      "interpolationDegree":1,
      "epoch":"2012-08-04T16:00:00Z",
      "unitQuaternion":[some numbers, I am working on it]
    },
    "position":{
      "interpolationAlgorithm":"LAGRANGE",
      "interpolationDegree":1,
      "epoch":"2012-08-04T16:00:00Z",
      "cartographicDegrees":[time,long,lat,height,time,long,lat,height,time,long,lat,height]
    }
  }
]

Thanks


Solution

  • I found the problem, I didn't give it the right place to find the model on my computer, when I was using my local host, I actually should give it the full address form my localhost or Cesium address, so I should enter it as "gltf":"../../Apps/SampleData/models/CesiumMilkTruck/CesiumMilkTruck.bgltf", rather than just give it the address of "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.bgltf", so it works now, thanks everyone who helped!