Thank you for sharing some information about your project. What data are you rendering along the path outlined in blue? In general, our API does not provide a simple way to render data that is in close proximity to a polyline. However, I am guessing that after a few seconds, the data loads in and you are getting the desired results. If you are would like to learn more about how to control how 3D Tiles are loaded into your viewer, I suggest checking out the following demo.
This demo showcases how the level of detail can be optimized at runtime. See the “optimizations” tab. Let me know if you have any other questions or concerns.
To give you some broader scope on why I’m doing this, I’m trying to find a way to get all the points of intersection between a ray/polyline (basically2 points) and buildings/terrain.
This is what I’ve tried so far
IntersectionTests doesn’t have a way (that I know of) to get intersections either with the terrain (using viewer.scene.globe.ellipsoid doesn’t work for Cesium.IntersectionTests.rayEllipsoid) or buildings;
Using viewer.scene.globe.pick only gives me the last intersection and only works for terrain, so that doesn’t work either
So finally what I’m trying to do is create a polyline, then clamp it to the ground (since viewer.scene.clampToHeightMostDetailed works for both terrain and buildings) and compare the angles created by the polyline clamped to the ground and the vector connecting the origin and target points. So if the sum of angles is above 0 there’s and intersection and when the sum is 0 or less the intersection has ended
Here’s an image of what that would look like so that it’s easier to understand (at least I hope so )
And here is where I have the problem I began exposing, the clampToHeightMostDetailed only gives me the points for the best render that it has at that time, so when the camera is really far away from the point being clamped I get results like shown before.
If there’s a easier way to do this or a method already implemented please tell me
Thank you for providing some more details on the issue that you have encountered. The image that you added really helps me understand your problem. From my research, I think you are going about tackling this issue correctly. However, it is always useful to bounce ideas off of other developers. I wonder if any other community members have any suggestions or thoughts.
I am going to continue investigating this use case and check in with the rest of the CesiumJS squad about it. However, at the current moment, I do not have much to add here.
Hi, Cesium always have enough features to fulfill all kind of GIS requirements. I had similar requirement where I need to get the intersection point(location) of a polyline when it passes from terrain. Here is the working sandcastle example.
one of our requirements is to calculate a viewshed and we used a ShadowMap/CameraModel, but have problems with the tiles loaded at a specific time stamp - at this part I can’t use sampleTerrainMostDetailed