How to attach textures to the timeline?

Dear Cesium developers,

at TUM I am developing a new feature in the 3d City DB. (further information: http://www.3dcitydb.net/3dcitydb/software/) We are using the cesium globe for visualization.

My task is now to add tiles/textures (about solar energy input) of the rooftops of Munich and code a link between textures and timeline in cesium. We have texture data for every month of the year.

Now how can I beste realize this? I especially don't want the textures after one year to disappear, so when time increases by a year, it should loop back to the texture of last years month.

Thanks for any suggestions and support in advance.

Hi there,

Can we have a few more details on your use case and implementation? Depending on what level you’re working at (eg. are you using Entities? ImageryProviders?), the best solution / support will be different.

Thanks,

  • Rachel

Dear Rachel,

let me try to explain better. We have textures of the solar radiation of all buildings in Munich in glTF Format. This data I exported from the open source 3d city DB Projects from the chair of geoinformatics at TU Munich. (http://www.3dcitydb.net/3dcitydb/3dcitydbhomepage/). I now have loaded the glTF data for every month into the web client they designed on basis of the cesium globe. My task is now to establish a connection between the different monthly textures and the integrated cesium time line. At the moment one has to change the textures manually by selecting each month in the upper left corner. What I want is to just swipe the time knob and the textures automatically change when the next month begins. Follo this link to see a screenshot of my recent work state: http://de.tinypic.com/r/29z4mxc/9

Thanks so much for your support,

best
Nik

Hi Nik,

Sounds like an awesome project! You can definitely set your materials programatically. The best method will depend on your exact use case. If you need to update materials continuously, per frame, than using a callback property. For example, here’s a continously color-changing entity: http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=635b076158394095e4a4cfa7b0cb78a6 In your case you’d use a ImageMaterialProperty instead.

However, if your data changes at set intervals instead, you’d be better served by a TimeIntervalCollectionProperty: https://cesiumjs.org/Cesium/Build/Documentation/TimeIntervalCollectionProperty.html

If you’re not using the Entity API at all, you can subscribe to the clock.tick or scene.preRender functions to update your textures each frame.

If none of these work for you, share a little more detail and we’ll try to come up with a more tailored solution.

Hope that helps,

  • Rachel

Hey Rachel,

actually I am having big problems understanding the timeline propeties, as I am new to coding and JS.

Is someone of your team available for maybe a short skype call?

Best Nik

Hi Nik,

Unfortunately we are not available over skype, but we’re happy to continue answering questions on the forum. We’re better able to help if you make your questions as specific as possible.

I’m sorry you’re having some difficulty, but don’t be discouraged! learning new technologies is always a bit daunting at the beginning, but with a little persistence, I’m sure you’ll be able to accomplish whatever you need to. :slight_smile:

Best,

  • Rachel

Ok at the moment I try to come around with a solution to set time intervals for each month of the year, though I actually want to set the monthly intervals for all the years, not only for the recent year. This way I want to ensure that the same textures are shown forn Jan 17, Jan 18, and so on... Do you have an Idea to solve this.

Also I would be very interested in an example for using the timelineIntervallCollection. Do you have some Sandcastle example with that property implemented?

Thanks, Nik

Hi Nik,

Here’s an example with Material Properties: http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=c1b1ef84af7dd0b40b3102ffed164a3d

Hope that helps,

  • Rachel

Hey Rachel,
will study the code to get behind it though it seems like the example is not working; I don't see any blinking. The giant dot just stays red.

ok, never mind. Found the widget to pick the property....was just ti stupid in the first place!

Dear Rachel,

I think I have came to a point where I can describe my needs in more detail:

I want to implement my solution with the following logic:

1. I added a start time and stop time for every glTF layer in the cesium client.
2. With adding this information to each layer I now want to check if the current time fired by the timelime/clock is inside a set layer time interval and then display the corresponding layer.

What would be the best way to get the clock.currentTime of cesium timeline and compare if the current time is within a layer time interval?

Hi Nik,

If you look at the gist I posted, it demonstrates how to change material at set intervals. If you know what your materials should be ahead of time, defining MaterialProperties like that will be sufficient. Once you’ve defined a property, there’s no need to call anything with a specific time. The Entity system is designed to handle the time-dynamic behavior for you. At each frame, the entity will be drawn with the appropriate material as defined in the property.

Hope that helps,

  • Rachel