1. A concise explanation of the problem you're experiencing.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
var heading1 = 0,pitch1 = 0,roll1 = 0,heading2 = 0,pitch2 = 0,roll2 = 0;
var position1,position2;
var hpr1 = Cesium.HeadingPitchRoll.fromDegrees(heading1, pitch1, roll1);
var matrix1 = Cesium.Transforms.headingPitchRollToFixedFrame(position1, hpr1);
var matrix2 = Cesium.Transforms.headingPitchRollToFixedFrame(position2, hpr2);
model.position = position1;
model.modelMatrix = matrix1*matrix2 ???// how can model set the tow rotations
scene.primitives.add(Cesium.Model.fromGltf(model));
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
4. The Cesium version you're using, your operating system and browser.
- A concise explanation of the problem you’re experiencing.
- A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
var heading1 = 0,pitch1 = 0,roll1 = 0,heading2 = 0,pitch2 = 0,roll2 = 0;
var position1,position2;
var hpr1 = Cesium.HeadingPitchRoll.fromDegrees(heading1, pitch1, roll1);
var matrix1 = Cesium.Transforms.headingPitchRollToFixedFrame(position1, hpr1);
var matrix2 = Cesium.Transforms.headingPitchRollToFixedFrame(position2, hpr2);
model.position = position1;
model.modelMatrix = matrix1*matrix2 ???// how can model set the tow rotations
scene.primitives.add(Cesium.Model.fromGltf(model));
- Context. Why do you need to do this? We might know a better way to accomplish your goal.
- The Cesium version you’re using, your operating system and browser.
var hpr2 = Cesium.HeadingPitchRoll.fromDegrees(heading2, pitch2, roll2);
var matrix1 = Cesium.Transforms.headingPitchRollToFixedFrame(position1, hpr1);
var matrix2 = Cesium.Transforms.headingPitchRollToFixedFrame(position2, hpr2);
model.position = position1;
model.modelMatrix = matrix1*matrix2 ???// how can model set the tow rotations
scene.primitives.add(Cesium.Model.fromGltf(model));
在 2018年2月2日星期五 UTC+8下午1:25:35,Bob Alex写道:
var heading1 = 0,pitch1 = 0,roll1 = 0,heading2 = 0,pitch2 = 0,roll2 = 0;
var position1,position2;
var hpr1 = Cesium.HeadingPitchRoll.fromDegrees(heading1, pitch1, roll1);
Use Matrix4.multiply to combine the two rotations into a single matrix.