TransWikia.com

Entity (point) is not show in 3D mode of Cesium?

Geographic Information Systems Asked by Tarlan Mammadzada on March 30, 2021

I’ve added an entity:

var debris = cesiumViewer.entities.add({
  position : { 
    value : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 1000) ,
    referenceFrame : Cesium.ReferenceFrame.FIXED 
  },
  point : {
    color : Cesium.Color.YELLOW,
    pixelSize : 6
  }
});

The point is shown in 2D and Columbus mode, but hidden in 3D mode. Also, in Columbus mode it looks like the altitude iz 0.

Added also cesiumViewer.scene.globe.depthTestAgainstTerrain = true;

Where is the issue?

2 Answers

var debris = cesiumViewer.entities.add({

  position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 1000) ,  

  point : {
    color : Cesium.Color.YELLOW,
    pixelSize : 6
  }
});

Answered by baloola on March 30, 2021

You don't need to specify ReferenceFrame.FIXED, as that's the default. Try this:

var debris = cesiumViewer.entities.add({
  position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 1000),
  point : {
    color : Cesium.Color.YELLOW,
    pixelSize : 6
  }
});

If you really do need to specify a reference frame, you can construct that like this:

var debris = cesiumViewer.entities.add({
  position : new Cesium.ConstantPositionProperty(
    Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 1000),
    Cesium.ReferenceFrame.FIXED 
  ),
  point : {
    color : Cesium.Color.YELLOW,
    pixelSize : 6
  }
});

Answered by emackey on March 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP