cesium设置/获取模型俯仰角

693 阅读1分钟

设置模型俯仰角

const position = new Cesium.Cartesian3(0, 0, 0)
const hpr = Cesium.HeadingPitchRoll.fromDegrees(heading, pitch, roll)
const orientation = Cesium.Transforms.headingPitchRollQuaternion(
  position,
  hpr
)
entity.orientation = new Cesium.ConstantProperty(orientation)

获取模型俯仰角

const matrix = entity.computeModelMatrix(Cesium.JulianDate.now())
const hpr = Cesium.Transforms.fixedFrameToHeadingPitchRoll(matrix)