How to draw a cone(cylinder) entity and make entity position as the vertex of circular cone(cylinde)

Hi experts,

By default, the entity position is the center of the cone.

But in my situation, I need to draw the cone and make the position as its vertex, and rotate it with a heading/pitch/roll.

Is there any idea to make this ?

Regards,

Tudou

Hello Tudou,

I don’t think there is an easy way to do this from the Entity API. You’ll need to define a model matrix to provide the correct translation and rotation for your cone. You can do this if you add the cone using the geometry and appearances.

Here is an example from our development demos: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=development/Cylinder.html&label=Development

If you build our code base and run it locally you can see all of the development examples in Sandcastle. We have instructions for building the code base in our Build Guide: https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Documentation/Contributors/BuildGuide

Best,

Hannah

Thanks for you kindly help!

But I am not familiar with the model matrix.

Then I find a possiable solution. As shown in below figure.

Target position is rotated by a pitch/heading/roll from the vertex.

If I find it, I can use entity API to add the cone.

But now, I don’t know how to calculate the target position.

Thanks for you kindly help!

But I am not familiar with the model matrix.

Then I find a possiable solution. As shown in below figure.

Target position is rotated by a pitch/heading/roll from the vertex.

If I find it, I can use entity API to add the cone.

But now, I don’t know how to calculate the target position.