CZML Polyline Attachment Point Offsets


I’m investigating some options with czml polylines and hit a wall.

You know how with billboards and labels you can use pixel and eyeoffset as well as horizontal and vertical origin to control where they display in relation to the entity itself? Well i’m curious how one would go about doing this for a Polyline attachement point :smiley:

I.e.: you have an object and the polyline attaches to the ‘center’ of the object, because its reading from “position”. In my experiment i’m making connections between 2 satellite czml objects like this:


However, “polyline” in the czml documentation has no properties that I can tell that would be useful to “shift” the polyline to attach to the “top” of these two objects. Specifically, say the two satellites have 3D models of Cesium_Man.glb, well, at the current time he’s gunna have a polyline sticking through his bellybutton connecting him to his friend. The billboard attached the our object makes it so there’s say an exclamation point above our friends head, and we want to connect the polyline from exclamation point to exclamation point.

At this point; i’m thinking the only way would be to do some fancy way of modifying the “positions” list so that it adds some amount of offset somehow with either math or one of the coordinate systems or something, idk lol. So that’s where i’m at, any ideas or guesses would be welcome, Cheers!

Still trying to figure out some ways to do this.

At present, I could open up each 3D model and shift them down and re-export them until the position of the polyline is “above their head”. But then when the entity is tracked, the tracked part will be above the entity and then looking around on the model will be not centered as desired. Or, another graphic level solution: if the polyline uses an image, we can set the resolution of the image and the width parameters of the image combined with transparency of the image on the bottom half so that just the ‘sliver’ of the top of the polyline is what we see being displayed, and that ‘sliver’ lines up to the connection we need in order to get to the polylines at the ‘top’ of the bubbles.

I have found these two pieces which seem to lead some evidence on ways to hack a polyline to manage an offset…

Between these two examples I feel there’s enough support to do something fancy to get the polylines offset up… But I wish it were as simple as the offset for the billboard and labels.

I attempted to set a Billboard.position, for the references, nothing happened with that I could tell would work for that test.

My next idea is making a polygon/geometry/point in the czml and see if I can use its .position as the reference to get the polyline to somehow hook up to it. Note, this is for moving objects so the position is referencing the moving objects positions, and they are in space, so that makes the ‘height’ property somewhat convoluted to me for using in a solution here.

Hi @mhernandez624,

Thank you very much for taking the time to bring your question to our community. I have somewhat limited experience with the CZML data format, but I will try to help out as much as possible. As always, community input is welcomed!

I just refreshed my memory on the Billboard and Label objects in our API. You are 100% correct. They both have the member eyeOffset.

I suspect that an eyeOffset type member variable was not implemented for polylines because it is unclear what the “center” of a polyline is. This becomes especially evident as polylines become more complicated.

While this functionality is not part of our base API, it seems like you are already exploring a custom workaround.

I read through your ideas and I think you are on the right track. You have explored this issue much more deeply than I have, so I am hesitant to give a strong suggestion. A few high-level thoughts:

  • I wonder if it is possible to position the polyline relative to a Billboard object. You could set the show member of the Billboard object to false and simply use the eyeOffset member to get your desired result. This might be what you are alluding to here “I attempted to set a Billboard.position, for the references, nothing happened with that I could tell would work for that test.”
  • I think you are on to something with your next idea. CZML exposes polyline point position data. You could write a simple algorithm that performs a transform on each point in the CZML data. This would essentially “offset” the data.

Please let me know if you have any other questions or comments. I am looking forward to learning more about your application. This is a really interesting and unique use case.