Hi all,
I'm trying to use the entity api to draw a rotated cone. I am specifying a position and then an orientation that specifies a 90 degree roll to rotate the cone on its side. The problem I'm having is that I'm trying to rotate the cone from its apex, instead of from its center. That is, I want the apex to appear at the position and then to rotate about this point. No matter what I seem to do, I cannot seem to get the entity to rotate in this manner. What am I missing?
var viewer = new Cesium.Viewer('cesiumContainer');
var position = Cesium.Cartesian3.fromDegrees(-75, 40);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(
position,
Cesium.Math.toRadians(0.0),
Cesium.Math.toRadians(0.0),
Cesium.Math.toRadians(90.0)
);
var entity = viewer.entities.add(new Cesium.Entity({
position: position,
orientation: orientation,
point: {
color: Cesium.Color.YELLOW,
show: true,
pixelSize: 20
},
cylinder: {
topRadius: 0,
bottomRadius: 5,
length: 20,
material: Cesium.Color.YELLOW.withAlpha(0.5)
}
}));
viewer.zoomTo(viewer.entities);