How to change height of 3DModels?

Hi everyone, I am trying to change the height of the 3D Model layer in this example but it doesn’t seem to work, I don’t know where I am wrong, someone help me
(Cesium Sandcastle)

Hello, welcome to the community!
The function fromCartesian takes a Cartesian3. That means that the input argument needs to be an instance of a Cartesian3. I see you have a point as an array. You can create a Cartesian3 from it by using the function Cartesian3.fromArray.

So instead of

const cartographic = Cesium.Cartographic.fromCartesian( = [1215023.915542779,
-4736356.058240178, 4081642.5349159874]

We can do

const cartographic = Cesium.Cartographic.fromCartesian(
-4736356.058240178, 4081642.5349159874])

and it should work as you expect.

1 Like

sorry friend i copied the wrong link :frowning: can you help me check in this example, i am trying cesium Cesium Sandcastle

it seems the way 3Dmodel works is different from 3DSettile :thinking:


You can use Matrix4.multiplyByPoint to multiply x,y,z of cartesian3 as given below:

  .getObservable(viewModel, "height")
  .subscribe(function (height) {
    height = Number(height);
    if (isNaN(height)) {
    const cartographic = Cesium.Cartographic.fromCartesian(
    const surface = Cesium.Cartesian3.fromRadians(
    var newHpos = Cesium.Matrix4.multiplyByPoint(Cesium.Transforms.eastNorthUpToFixedFrame(surface),
                new Cesium.Cartesian3(0, 0, height), new Cesium.Cartesian3());

Here is the working sandcastle example.

  • Regards
1 Like

fantastic, thank you very much, it’s so helpful

please help me with the case of rotating a 3Dtileset