Finding all the the intersection point of a ray on 3D Tile?

i create a cesium.ray with two points,then i want to get all the intersection points of the ray on 3DTiles, but the result is the first intersection point? how to get all the points?

var direction = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(toPoint, fromPoint, new Cesium.Cartesian3()), new Cesium.Cartesian3());
        
 var ray = new Cesium.Ray(fromPoint, direction);
 var results = viewer.scene.drillPickFromRay(ray, 10, objectsToExclude);                

Hi @yanasdf789,

Thank you for your question! It seems like you are using drillPickFromRay, which is the correct function to use here. Are you certain that there are two layers at the point that you are picking?

Best,
Sam

Welcome back @yanasdf789,
As @sam.rothstein suggested you can use drillPickFromRay as suggested in this example. I had similar requirement where I had to show different color line intersection with 3D terrain. This sandcastle link may be helpful to you.

Regards,

1 Like