var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction((movement) => {
// var pickedPrimitive = viewer.scene.pick(movement.position);
var ray = viewer.scene.camera.getPickRay(movement.position);
var cartesian = viewer.scene.globe.pick(ray, viewer.scene);
if (cartesian) {
viewer.entities.add({
id: nombre.toFixed(2),
position: cartesian,
point : {
pixelSize : 10,
color : Cesium.Color.YELLOW
}
});
} else {
alert('Globe was not picked');
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
I want to use the code to get the intersection of a ray and a Cesium3DTileset. But get the intersection of the ray and the background tarrein. How can i get what i want?