Asynchronous Entity Rendering in Cesium 1.7

1,015 views
Skip to first unread message

p.gre...@gmail.com

unread,
Mar 10, 2015, 6:14:49 PM3/10/15
to cesiu...@googlegroups.com
I've been working with Cesium for a bit now and I started when Primitive Collections were the thing to use. I had click and drag primitive rendering working, but now I want to upgrade Cesium and move on to entities. I moved over the code, refactored, and can click and drag to draw shapes; however, before I was able to flip the asynchronous flag and it would render as I moved the mouse. Now, I'm unable to do that. I tried setting 'allowDataSourcesToSuspendAnimation' on the viewer to false, but to no avail. Any help would be extremely appreciated.

vasc...@aol.com

unread,
Mar 11, 2015, 4:08:44 PM3/11/15
to cesiu...@googlegroups.com
I have a similar issue with the drawing of polylines in Cesium version 1.7.1. I first disable the camera by doing the following:

scene.screenSpaceCameraController.enableRotate = false; scene.screenSpaceCameraController.enableTranslate = false; scene.screenSpaceCameraController.enableZoom = false; scene.screenSpaceCameraController.enableTilt = false; scene.screenSpaceCameraController.enableLook = false;

With the camera disabled, I'm adding new positions while the mouse is moving with the left click pressed (freestyle drawing). The issue I'm having is that the polyline is rendered or updated on the map after I release the mouse.
Is there a way to allow the rendering of polylines or any other geometry on the map synchronously  instead of asynchronously while I'm drawing or dragging?

Thanks,

Alberto


I've been working with Cesium for a bit now and I started when Primitive
Collections were the thing to use. I had click and drag primitive rendering
working, but now I want to upgrade Cesium and move on to entities. I moved over
the code, refactored, and can click and drag to draw shapes; however, before I
was able to flip the asynchronous flag and it would render as I moved the mouse.
Now, I'm unable to do that. I tried setting 'allowDataSourcesToSuspendAnimation'
on the viewer to false, but to no avail. Any help would be extremely
appreciated.

-- 
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.

Matthew Amato

unread,
Mar 15, 2015, 10:50:53 PM3/15/15
to cesiu...@googlegroups.com
We plan on making this easier and better documenting it, but check out this thread for some info. https://groups.google.com/d/msg/cesium-dev/DTJ6TEN04U8/AbG14Wm-z98J

Basically, when you assign a raw value to an entity you are assigning the value as a constant (and Cesium optimizes to support that).  If you want to assign a value over and over (as is the case for interactive editing) you need to use a dynamic property to indicate that.

Paul Greaney

unread,
Mar 16, 2015, 11:26:44 AM3/16/15
to cesiu...@googlegroups.com
Is there any plan on supporting this type of behavior natively in future patches? It would be amazing to have real time editing.

You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/BqhefLtPsLg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Paul Greaney
Software Engineer

Matthew Amato

unread,
Mar 17, 2015, 2:08:36 PM3/17/15
to cesiu...@googlegroups.com
Built in support for object editing may be too "high-level" for core Cesium, since a lot of assumptions about the application need to be made in order to implement it.  That being said, having first class support via a plug-in or other project is certainly possible, but given everything else we have on our plate, it's not on our own near term schedule.

Sergio Flores

unread,
Apr 28, 2015, 12:34:32 PM4/28/15
to cesiu...@googlegroups.com
I also found the same problem today, we had implemented real time dragging/scaling/etc of shapes and now when we tried porting the codebase to the new entity API the editing is not real-time anymore, dragging a shape takes 2 to 3 seconds to update...

I think what the other guys asked was just support for syncronous imediate updates, not actually having object editing inside Cesium.
Is there any special reason entities don't have a asyncronous property?

Without a way to update stuff in real-time the whole entity API is worthless to us, and we really wanted to port the codebase to it in order to simplifiy lots of code and make use of the new stuff (tracking, pop up descriptions, etc).

Am I missing something? Or else how the CZML system updates entities without having this delay?

Matthew Amato

unread,
Apr 28, 2015, 1:09:55 PM4/28/15
to cesiu...@googlegroups.com
One of the main points of the Entity system is to efficiently handle dynamic data, (we are just lacking a good tutorial on the subject because I haven't had time to write one).  There are two different forms of dynamic data, 1) data that varies with animation time 2) data that varies due to external user interaction or stimulus.  Cesium uses a Property system to allow for users to provide information about their data so that dynamic data can be efficiently rendered.  This is touched on at the end of the Visualizing Spatial Data tutorial  If you have a look at the ref doc for the various properties, you will hopefully be able to get a sense for how each one would be used.


You can also implement custom properties if needed. For object editing, CallbackProperty usually makes the most sense.  I'm floating the idea of adding a DynamicProperty but I'm not sure we need it because it's ultimately less efficient than CallbackProperty.  Don't get me wrong, there's lots of rooms for improvement here; and perhaps the best thing we can do is improve the documentation of what we already have.

Here's a couple links to other discussions that may be helpful too (though there are plenty more if you search the forums).

Sergio Flores

unread,
Apr 28, 2015, 1:23:48 PM4/28/15
to cesiu...@googlegroups.com
Wow Matthew, thanks for the very faster answer, and that is actually what we needed, the CallbackProperty is great, it will allow us to remove tons of updating code!

Just in case someone needs some help in this topic, here's how to make an ellipse with a position that can be updated in real-time from a custom function.

        me
.entity = new Cesium.Entity({
            id
: myID,
            position
: new Cesium.CallbackProperty(function() {
                   
return me.ellipsoid.cartographicToCartesian(me.center);
               
}, false),
            ellipse
: me.getEllipseData()
       
});

Fidel Perez-Smith

unread,
Apr 7, 2017, 8:17:31 AM4/7/17
to cesium-dev, rel...@gmail.com
Sergio, thanks so much for coming back and posting your answer. It helped me work out my problem. Thank you Matthew also.
Reply all
Reply to author
Forward
0 new messages