Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript CesiumJS创建三维边界框_Javascript_Html_Youtube_Cesium - Fatal编程技术网

Javascript CesiumJS创建三维边界框

Javascript CesiumJS创建三维边界框,javascript,html,youtube,cesium,Javascript,Html,Youtube,Cesium,我试图在CesiumJS中创建一个边界框,在这里位置不断更新。我看过Cesium的教程,我知道如何创建一个框,但我似乎无法创建3D边界框(如youtube视频中所示,下面的链接)。在文档中,我想我必须使用boundingRectangle,但它没有显示在地图上。我有什么遗漏吗 我正在尝试实现youtube视频中显示的图像: 代码: 例如: // Create an OrientedBoundingBox using a transformation matrix, a position whe

我试图在CesiumJS中创建一个边界框,在这里位置不断更新。我看过Cesium的教程,我知道如何创建一个框,但我似乎无法创建3D边界框(如youtube视频中所示,下面的链接)。在文档中,我想我必须使用boundingRectangle,但它没有显示在地图上。我有什么遗漏吗

我正在尝试实现youtube视频中显示的图像:

代码:

例如:

// 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);
示例:

// 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);

如何将定向边界框添加到地图?我尝试了
viewer.entities.add(obb)
,但该框似乎没有显示在地图上。如何将定向边界框添加到地图上?我尝试了
viewer.entities.add(obb)
,但该框似乎没有显示在地图上。