Updating of primitives

1,272 views
Skip to first unread message

Thomas Lefort

unread,
Jan 17, 2014, 10:41:00 AM1/17/14
to cesiu...@googlegroups.com
A bit of a newbie question really.

Is there a way to force the update of a primitive? eg when the geometryInstances have changed? I have tried quite a few hacks but nothing seems to be working. Looking at the implementation of Polygon and some other direct primitive implementations, it looks like they need to be recreated each time (this._createPrimitive flag).

I am trying to generally enhance Primitves so that any geometry contained in a primitive can be edited, whilst keeping the reference to the primitive. My first assesment is that it is currently a bad idea.

Patrick Cozzi

unread,
Jan 20, 2014, 11:34:15 AM1/20/14
to cesiu...@googlegroups.com
Thomas,

In general, you can't modify the positions, e.g., add or remove, in a primitive without recreating it, which allows Cesium to combine primitives for efficient rendering.  Have you seen the geometries tutorial?  This is explained in more detail there.

Patrick

Thomas Lefort

unread,
Jan 20, 2014, 3:35:01 PM1/20/14
to cesiu...@googlegroups.com
Yes. I got confused by polygon and extentprimitive, etc... And the lack of one for ellipse and circle. Now i understand and i extended this implementation for the ones i was missing.
Thanks.

David Taylor

unread,
Aug 13, 2014, 4:21:33 PM8/13/14
to cesiu...@googlegroups.com
Is it possible to force a redraw on a primitive after changing the modelmatrix and or the geometry?

Matthew Amato

unread,
Aug 13, 2014, 5:05:03 PM8/13/14
to cesiu...@googlegroups.com
If you are using either Viewer or CesiumWidget, you can just call render(). But unless you are using a custom render loop, this happens automatically every frame.  While you can change the modelMatrix of an existing primitive (as long as it's a single geometry and you're in 3D), you can update the geometry instances; you need to remove that Primitive and create a new one.  The "fix" for this is adding dynamic buffers to the Geometry system; but that is a few months out.


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

David Taylor

unread,
Aug 14, 2014, 10:29:19 AM8/14/14
to cesiu...@googlegroups.com
Thanks for the update! I appreciate it!

gamedesi...@gmail.com

unread,
Jan 16, 2019, 6:14:32 PM1/16/19
to cesium-dev
I'm seeing posts as far back as 2013 that in order to update cesium primitives, the primitive needs to be removed from the scene and re-added after the update. I see that there is a feature called dynamic buffering that would allow the update of the primitive, but I can't find the status on this feature. Can a primitive's geometry and/or appearance be updated without first removing the primitive from the scene?

Omar Shehata

unread,
Jan 17, 2019, 11:06:06 AM1/17/19
to cesium-dev
Here's the issue on dynamic buffers:


It looks as of today, the only way to update primitives is to recreate them. There's some more discussion and ideas for improvement in this issue as well:

Reply all
Reply to author
Forward
0 new messages