javascript - CesiumJS 创建 3D 边界框

标签 javascript html youtube cesiumjs

我正在尝试在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);

BoundingRectangle

关于javascript - CesiumJS 创建 3D 边界框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41947510/

相关文章:

javascript - MxGraph 中节点、边和 Canvas 的自定义(不同)右键菜单

cordova - 我如何解决这个 : app enables background playing of YouTube videos

javascript - Jquery onclick图像id形成输入字段

JavaScript 日期.getDay()

javascript - 在Javascript中根据其他数组值将数组填充到所需的数量

javascript - 在鼠标悬停时显示一个像 jQuery Tooltip 这样的 div

javascript - 使用弹出式键盘进行 Tab 键需要选择和取消选择文本框

html - 为什么以及如何将图像保存在一张图像中?

ios - 无需用户身份验证即可将视频上传到 Youtube

ios - youtube api播放器无法在iOS上运行吗?