我正在尝试在CesiumJS中创建一个边界框,其中的位置不断更新。我看过 Cesium 的教程,我知道如何创建一个盒子,但我似乎无法创建一个 3D 边界框(如 youtube 视频所示,链接如下)。在文档中,我认为我必须使用boundingRectangle,但它没有显示在 map 上。我有什么遗漏的吗?
我正在尝试实现此 YouTube 视频中显示的图像: https://www.youtube.com/watch?v=Svmfxfu4prs&list=PLJjPiYdF7lFbhsZ_3SstXWP1Afth7sn2v&index=3#
代码:
var boundingBox=new Cesium.BoundingRectangle(-114.084687, 50.938343);
var geometry = Cesium.BoxGeometry.createGeometry(boundingBox);
最佳答案
示例:
// Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.
var center = new Cesium.Cartesian3(1.0, 0.0, 0.0);
var halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3());
var obb = new Cesium.OrientedBoundingBox(center, halfAxes);
关于javascript - CesiumJS 创建 3D 边界框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41947510/