How to get Cesium Primitive current position?

Hello everyone,

I am trying to get current position of a Cesium Primitive model. Is it possible ?

Thank you.

The primitive i am trying to get position information on:

var planePrimitive = scene.primitives.add(
  Cesium.Model.fromGltf({
    url: "../SampleData/models/CesiumAir/Cesium_Air.glb",
    modelMatrix: Cesium.Transforms.headingPitchRollToFixedFrame(
      position,
      hpRoll,
      Cesium.Ellipsoid.WGS84,
      fixedFrameTransform
    ),
    minimumPixelSize: 128,
  })
);

Hello @Uygar_Yengin1

You can access the modelMatrix property of the Primitive and use the Matrix4.getTranslation method to extract the Cartesian3 position in world-space.

Here’s a Sandcastle for demonstration.

Hope this helps,
Sam

1 Like

Hello @sanjeetsuhag

Your solution worked without any error. Thank you for your attention.

Uygar.