-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clamp Path to Ground #7133
Comments
There are actually 3 different line types in Cesium: Polyline, GroundPolyline, and PolylineCollection. Only PolylineCollection has suitable performance for dynamic polylines and that's what path uses under the hood. In theory we could re-create a GroundPolyline every frame for the path, but it would be unacceptably slow. |
Hi mramato!From my reading of the code, the path uses PolylineCollection underhood, but it interpolates positions, and then still renders a new "polyline" through shader program for every frame. |
PolylineCollection is a fundamentally different beast than GroundPolyline. While it's true that interpolation happens every frame and new positions get generated, the methods that takes those positions and renders them are vastly different. This is also why PolylineCollection doesn't support features like per-vertex colors. We definitely want to improve the area of Cesium, but there's no ETA as to when that's going to happen. We've even discussed writing a custom PathPrimitive specifically for this use case. |
Thank you very much, Mramato! |
Hi @mramato, do you have an estimated time frame for when this (clamped path) will be implemented? Thank you |
@jimmyangel no sorry, this isn't a priority for us right now so I don't think we'll be able to add this feature very soon. Pull requests are always welcome though! |
Hi @hpinkos, could you please suggest a viable workaround? I would like to animate a path clamped to the ground -- I tried using polyline segments (in CZML) , but the performance is really bad if I have hundreds/thousands of segments. Any suggestions? |
@jimmyangel sorry, I don't have a good solution other than trying to subsample the line on the server and generate CZML. But like you said, performance might not be great for this. We unfortunately can't change |
Any updates on this? It would be extremely useful. I had a customer trying to draw long ground vehicle paths and thus when exporting czml from STK with sparse point definitions the path disappears through the terrain quite often. |
any update on this? I need to solve the same problem |
@iLoveBug is your path static? If so, you can sample the height along the points before creating the path to clamp it to the ground (or set it relative to the ground etc). If you have trouble doing this feel free to open a new thread in the community forum: https://community.cesium.com/. |
This was requested on the forum, to be able to clamp a
Path
to the ground, so clamping the path here for example:https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=CZML%20Path.html&label=CZML
Initially I thought this might be trivial, as you'd only need to pass the "clampToGround: true" since the
PathGraphics
just uses a polyline anyway, but digging a bit into it, it seems like it might not be so straightforward, since a Polyline and a clamped Polyline are two different primitive types?The text was updated successfully, but these errors were encountered: