CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.73k stars 3.45k forks source link

Ability to specify line width in meters #1170

Open mramato opened 10 years ago

mramato commented 10 years ago

I think we call it a ribbon line, but I don't know how standard that term is.

A Google KML extension, gx:physicalWidth, allows for specifying the width of a polyline in meters. In order to support KML at the same level of Google Earth, we need this feature in Cesium. I would hope this is just a new polyline-specific material, but I don't know enough about the material system to know what's possible.

pjcozzi commented 10 years ago

We can do this now with CorridorGeometry without an extrusion. This is our "ribbon line", which is a standard-ish term I think.

See if this works for you. We may need to add a outline material for it (shouldn't be hard).

We could also write a polyline appearance (not material; appearance includes the vertex shader, which we would need) if that simplifies the higher-level code.

pjcozzi commented 7 years ago

CorridorGeometry should work here unless it is required that the line is aligned to the viewport.

mramato commented 7 years ago

CorridorGeometry will work in most cases, since it does not need to be aligned to the viewport. However, KML lines specified in meters can still have a different altitude for each point, which corridor does not support.