Currently, the entity position is the center of circular cone(cylinder). In my project, I
need to make the entity position as the vertex of it. Is it possible ? If yes, could you give me some guide .
I guess I need to modify the code in CylinderGeometry.createGeometry.
In order to achieve this, you will need to have one entity define and position the cone, and one entity to define the point with a position at (longitude, latitude, coneHeight).
You can use the orientation property to rotate the cone. Here is an example:
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var position = Cesium.Cartesian3.fromDegrees(-105.0, 40.0, 200000.0);
var heading = Cesium.Math.toRadians(135);
var pitch = 45;
var roll = 0;
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);
var redCone = viewer.entities.add({
name : ‘Red cone’,
position: position,
orientation : orientation,
cylinder : {
length : 400000.0,
topRadius : 0.0,
bottomRadius : 200000.0,
material : Cesium.Color.RED
}
});
But the orientation property will rotate the cone from its center, not from its apex.
I think we still need some translation, but I don’t know how to do this.