Dynamic billboard animations

1,340 views
Skip to first unread message

Minh Nguyen

unread,
Nov 13, 2014, 5:30:57 PM11/13/14
to cesiu...@googlegroups.com
Is it possible to create animated billboards? For my use case, I'm trying to create a "pulse animation" around a billboard (like this: 

http://jsfiddle.net/Fy8vD/). Initially I created a div on top of the billboard and animated it using CSS3, which worked great except it doesn't adjust its position with the billboard as the map zooms or pans. 

Next, I noticed that the Billboard .image property can be set as an Image or Canvas or Promise, so I created an additional billboard with a Canvas that contains a circle that's animated using requestAnimationFrame where its transparency  (globalAlpha) and scale are changed per animation frame (i.e. creating the pulse animation). Unfortunately, this isn't as smooth as I would like and also I've noticed that it eventually crashes with an error unless I cancel the animation before a number of frames are executed: 

[.WebGLRenderingContext]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete'

I'm guessing this is because I'm setting billboard.image = canvas on every animation frame and Cesium is creating a new image during each step of the animation (I noticed the image GUID changes per animation frame and it seems another user is seeing a similar issue: http://cesiumjs.org/forum.html?place=msg%2Fcesium-dev%2FcF9Vt28Wk-4%2FnJ68p3YONKcJ)

Finally, I looked into creating an Image() object with a src set to an SVG that's animated (after seeing a stackoverflow post about it: http://stackoverflow.com/questions/24869733/how-to-draw-custom-dynamic-billboards-in-cesium-js) but it seems to only render static SVG images rather than displaying the animated SVG.

Any help would be greatly appreciated!

Matthew Amato

unread,
Dec 11, 2014, 1:07:39 PM12/11/14
to cesiu...@googlegroups.com
As you discovered, we don't have good support for animated billboard images yet. Since it's a perfectly valid use case, I submitted a new issue https://github.com/AnalyticalGraphicsInc/cesium/issues/2319 that you can keep an eye on.  Not promises as to when we'll get to it; but as always we appreciate any pull requests.

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

3DBen

unread,
Dec 18, 2014, 12:40:56 PM12/18/14
to cesiu...@googlegroups.com
I first tried using an animated .gif which didn't work, but I have had success animating a billboard using CZML by loading images of the animation in intervals (see code below). However, this method ties the animation to the clock, so I'm not sure it can be looped.

What I'm struggling with now is using "scaleByDistance" so the billboard doesn't scale.

[
    {
        "id":"Target",
        "availability":"2014-11-06T08:11:16Z/2014-11-06T08:32:25Z",

        "billboard":{
            "scale":1.0,
            "scaleByDistance":"undefined",

            "image":[
                {
                    "interval":"2014-11-06T08:32:05Z/2014-11-06T08:32:05.1Z",
                    "uri":"../Images/pyro/explosion_01.png"
                },
                {
                    "interval":"2014-11-06T08:32:05.1Z/2014-11-06T08:32:05.2Z",
                    "uri":"../Images/pyro/explosion_02.png"
                },
                {
                    "interval":"2014-11-06T08:32:05.2Z/2014-11-06T08:32:05.3Z",
                    "uri":"../Images/pyro/explosion_03.png"
                },
                {
                    "interval":"2014-11-06T08:32:05.3Z/2014-11-06T08:32:05.4Z",
                    "uri":"../Images/pyro/explosion_04.png"
                },
                {
                    "interval":"2014-11-06T08:32:05.4Z/2014-11-06T08:32:05.5Z",
                    "uri":"../Images/pyro/explosion_05.png"
                },
                {
                    "interval":"2014-11-06T08:32:05.5Z/2014-11-06T08:32:25Z",
                    "uri":"../Images/pyro/explosion_06.png"
                }
            ],
            
            "show":[
                {
                    "interval":"2014-11-06T08:11:16Z/2014-11-06T08:32:05Z",
                    "boolean":false
                },
                {
                    "interval":"2014-11-06T08:32:05Z/2014-11-06T08:32:25Z",
                    "boolean":true
                }
            ]
        },

        "position":{...}
    }
]

aniket...@gmail.com

unread,
Aug 9, 2018, 12:34:00 PM8/9/18
to cesium-dev
On Thursday, November 13, 2014 at 4:30:57 PM UTC-6, Minh Nguyen wrote:
> Is it possible to create animated billboards? For my use case, I'm trying to create a "pulse animation" around a billboard (like this: 
>
>
> I was trying to achieve the billboard Image with the GIF format.
But no use.
If someone here did use the GIF formats in billboard or atleast in entity api level please help me out.

Gabby Getz

unread,
Aug 10, 2018, 4:25:48 PM8/10/18
to cesium-dev
Hi, I asked Matt to provide his GIF implementation in the GitHub issue here: https://github.com/AnalyticalGraphicsInc/cesium/issues/2319

tosif...@gmail.com

unread,
Nov 13, 2018, 6:14:36 AM11/13/18
to cesium-dev
I tried the solution given by mat for animated bilboards but why the imagery is not coming on the globe. Could you please provide a solution where i can have both animated bilboard and the imagery.

Omar Shehata

unread,
Nov 13, 2018, 2:01:02 PM11/13/18
to cesium-dev
If you're using the old version of CesiumJS linked to in that issue, then imagery doesn't appear because it's now served through ion, and old versions don't support ion. 

The best way would be to copy the changes from Matt's branch (which you can see here https://github.com/AnalyticalGraphicsInc/cesium/compare/animated-billboards ) into the latest version of CesiumJS. This does involve knowing how to edit the source and rebuilding CesiumJS, which can be tricky if you're not comfortable with JavaScript, but here's the build guide:

Reply all
Reply to author
Forward
0 new messages