how to add an image lying on the ground ?

Hi all,

i want to insert an image lying on the ground with one mouse click. How can i do that ?

You would need to add a mouse event listener (either through CesiumJS like in this example, or just directly with JavaScript) and then create a rectangle entity on click. An example of creating a rectangle entity in CesiumJS is in this example:

https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Rectangle.html

Let me know if that helps!

hi Omar,

i follow this example and t dit it, i can insert an image lying on the ground but this image ratio is not as expected. How do I configure the image aspect ratio?
Vào 23:21:32 UTC+7 Thứ Ba, ngày 10 tháng 9 năm 2019, Omar Shehata đã viết:

I think the image will be stretched to fit the rectangle geometry, so you’d have to make sure the dimensions of your rectangle match your image.

when I rotate the rectangle, the image inside it changes proportionally, why ?

Vào 18:46:30 UTC+7 Thứ Tư, ngày 11 tháng 9 năm 2019, Omar Shehata đã viết:

Can you share a video or a Sandcastle example (https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html) of this issue? You can put together a code example there and then click “share” in the top and share that link here. That way I can run it to see what the problem is.