Getting rid of imageSubRegion: new BoundingRectangle(27, 103, 22, 22),
made it appear; using eyeOffset: new Cartesian3(0.0, 0.0, -10.0),
made it appear more readily. It’s still getting stuck a bit into the terrain, but it’s visible:
Interestingly, the eyeOffset’s value determines how close one can get to the Earth before it disappears completely…if it’s -10, you can get 10 metres away before it disappears; if it’s -100, you can get 100 metres away before it disappears; etc. That’s not related to the terrain, but rather the camera’s distance to the object in question.
EDIT:
You can completely prevent it from clipping by using disableDepthTestDistance
, which I’ve set to the diameter of the Earth (after which it begins to clip)
For those looking, my entity creation looks like:
viewer.entities.add({
name: 'Marker of Entity Location',
id:'marker',
position : worldPosition,
billboard : {
color : Color.RED.withAlpha(0.7),
image: "/resources/images/x.png",
scale: 0.2,
eyeOffset: new Cartesian3(0.0, 0.0, -10.0),
heightReference: HeightReference.CLAMP_TO_GROUND,
verticalOrigin: VerticalOrigin.CENTER,
horizontalOrigin: HorizontalOrigin.CENTER,
disableDepthTestDistance: 1.2742018*10**7 // Diameter of Earth
},
label: {
text: "Entity Location",
font: "20px sans-serif",
showBackground: true,
eyeOffset: new Cartesian3(0.0, 0.0, -10.0),
horizontalOrigin: HorizontalOrigin.CENTER,
pixelOffset: new Cartesian2(0.0, -20.0),
pixelOffsetScaleByDistance: new NearFarScalar(
1.5e2,
3.0,
1.5e7,
0.5
),
disableDepthTestDistance: 1.2742018*10**7
},
});
Thank you for all the help!