Rendering Triangulated mesh at given latitude, logitde and height

Hello Team,
I have vertices of a cube in local coordinate system
Like below -

var positions = new Float64Array([
  100, 100, 40,//v0
  100, 200, 40,//v1
  200, 200, 40,//v2
  200, 100, 40,//v3
  100, 100, 60,//v4
  100, 200, 60,//v5
  200, 200, 60,//v6
  200, 100, 60 //v7
]);

With indices information as follow -

var indices = new Uint16Array([
  //Front
  0, 4, 7,
  0, 7, 3,
  //Back
  1, 5, 6,
  1, 6, 2,
  //Top
  4, 5, 6,
  4, 6, 7,
  //Bottom
  0, 1, 2,
  0, 2, 3,
  //Left
  0, 4, 5,
  0, 5, 1,
  //Right
  3, 7, 6,
  3, 6, 2
]);

What I want to do is I want to render this cube at specific latitude, longitude and height,
How can I do it ? is it possible to do so ?
the problem that I am trying to solve, is it conceptually right ?

I am adding link to the sandcastel - Sandcastel link

Any kind of related disscussion, thoughts and ideas are welcomed and appreciated.

Thank you !!

Hi, in order to make the cube be on the surface of globe, perhaps you need to change the positions to a world wide cartesian3 position. use Cesium.Transforms.eastNorthUpToFixedFrame funtion

below is a modify sandcastel(in the sample, center is 12(longitude degree),32(latitude degree),100( height meter). It could be changed as whatever you want.

1 Like