Draw polygon with Cesium

Currently I use Cesium 1.19, I need to draw a polygon as a rectangle.

Until then, I can draw this polygon but using 4 points to place. (I click on the map and I recovered coordinated to draw this polygon as the figure below (Figure 1))
Now I ask you, if possible, of tutorial or code snippet showing a mouse movement polygon tracing (Figure2.swf.html)


Figure2.swf (395 KB)

Figure2.swf.html (831 Bytes)

Figure 1.png

Hello Jules,

Instead of using a polygon, you might want to use our rectangle geometry type: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Rectangle.html&label=Geometries

For drawing, you will need define click event handlers to handle dragging. Check out the code example in this forum post for dragging around a billboard to draw a wall: https://groups.google.com/forum/#!msg/cesium-dev/nypZFdPLjhs/rRH_NdUvhVIJ

We’re currently working on putting together a blog post to demonstrate how to add drawing functionality to Cesium. Keep an eye on the website for that.