Draw OrientedBoundingBox

Can someone help me draw the OBB that is created in the following Sandcastle example? It seems like I should use computePlaneDistances(), but I’m not sure how to do that.

Thanks.

var points = [

Cesium.Cartesian3.fromDegrees(147.389000, -4.479600, 2836.0),

Cesium.Cartesian3.fromDegrees(147.206900, -4.683600, 5362.0),

Cesium.Cartesian3.fromDegrees(147.295500, -4.541000, 3177.0),

Cesium.Cartesian3.fromDegrees(147.201400, -4.640000, 3818.0),

Cesium.Cartesian3.fromDegrees(147.211300, -4.629900, 4486.0),

Cesium.Cartesian3.fromDegrees(147.223800, -4.713700, 5743.0),

Cesium.Cartesian3.fromDegrees(147.211400, -4.659300, 4826.0),

Cesium.Cartesian3.fromDegrees(147.233900, -4.726600, 5784.0),

Cesium.Cartesian3.fromDegrees(147.321500, -4.522700, 621.0),

Cesium.Cartesian3.fromDegrees(147.249300, -4.749300, 6124.0),

Cesium.Cartesian3.fromDegrees(147.222800, -4.673200, 4839.0),

Cesium.Cartesian3.fromDegrees(147.235600, -4.708000, 4647.0),

Cesium.Cartesian3.fromDegrees(147.234600, -4.695300, 5130.0),

Cesium.Cartesian3.fromDegrees(147.310600, -4.519400, 994.0),

Cesium.Cartesian3.fromDegrees(147.245500, -4.707500, 5252.0),

Cesium.Cartesian3.fromDegrees(147.262500, -4.610100, 3915.0),

Cesium.Cartesian3.fromDegrees(147.238300, -4.666000, 3820.0),

Cesium.Cartesian3.fromDegrees(147.252500, -4.659100, 4469.0)
];

var obb = Cesium.OrientedBoundingBox.fromPoints(points);

var center = Cesium.Cartographic.fromCartesian(obb.center);

console.log(" Center: (" +

center.longitude * Cesium.Math.DEGREES_PER_RADIAN +

", " + center.latitude * Cesium.Math.DEGREES_PER_RADIAN +

", " + center.height +

“)”);

``

You can find the code we use to render debug views of bounding volumes around terrain tiles here:
https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/GlobeSurfaceTileProvider.js#L849

Then, just add the primitive returned by getDebugOrientedBoundingBox to the scene.

Dan