# 3D Polygons

**URL:** <https://community.cesium.com/t/3d-polygons/7128>\
**Category:** CesiumJS\
**Created:** [July 6, 2018, 8:33pm UTC](https://community.cesium.com/t/3d-polygons/7128 "2018-07-06T20:33:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick.ht.janssen](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@patrick.ht.janssen](https://community.cesium.com/u/patrick.ht.janssen)\
**Post date:** [July 6, 2018, 8:33pm UTC](https://community.cesium.com/t/3d-polygons/7128/1 "2018-07-06T20:33:49Z")

</div>

**1. A concise explanation of the problem you’re experiencing.**

How to create polygons that float in 3d?

When I create a polygon geometry with the perPositionHeight, what is rendered on the screen is a polygon which goes down to the ground. I only want the top of the extruded polygon.

**2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.**

[Sandbox](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=tZNRb5swEMe/yomXUCk1ZFGlKqNR03TapFVLtVV7GXtw4QpWjY3OhoxW/e4zmLYsfZu2Q0L47v//GXxHywlagXskOAOFe9iiEU3Fvg+5cJYNy61WlguFNDt6n6r+ap1PE1cFXmvZFVo5u+cwVFZYgYbxPA8fUwUuFK8QVjDbDRaoR89e2BJqpONaG+dxmRJFUVoDXOWgGyvdprO5ZzybVjBC+ygFEqes7Fx6fPUtJ+ueuFqyO9LVJRaEaDZEvPvk6eGP40V8yuI5vDvp74u4j/kr9S/DUeP/R13G/5h6+kpdDtSfRxMu/rLU5Jj7M1vBdE/XsuuxY77sTt+pcSKpuEUSXE76oqUmtvu6+fLxA+s7v5F1ycOYnUy3HZv+FjgWBsoh9OJqs/3spU+penoZUj+QD1pXNzo8GM9eFMyDxNhO4tqbz0VVa7LQkAwZiyxWtXTfYaLbJrtHyzIz2JLo2ZTkogWRn6XBwY+SBpBJboyr3DVSfhMPmAbrJHL6P2xS81yoYtciSd71knKxvvJJxlgSueVbl9Va3nKaEH8D).

**3. Context. Why do you need to do this? We might know a better way to accomplish your goal.**

3D modelling

**4. The Cesium version you’re using, your operating system and browser.**

Sandbox, Win7, latest Chrome

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [July 6, 2018, 9:04pm UTC](https://community.cesium.com/t/3d-polygons/7128/2 "2018-07-06T21:04:05Z")

</div>

If you remove extrudedHeight:0, [does this look like what you want it to be](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=tZNvb5swEMa/isWbUCk1ZFGkKqVR02xqpUVLtE17U/riClewZmx0NkR06nef+dOWpu+m9ZAQPj/PD7g710CsFnhAYhdM4YFt0Iiq4L+6nD9JuuVGKwtCIU1OzmPVXrXzaQKV4V7LJtPK2XsOR2WFFWg4pKn/J1bMhYIC2ZJNdp2FlYPnIGzOSqTTUhvncZkcRZZbw0ClTFdWupdOpj3j2bRkA7SNXCABJXnj0sOnb4CsewI15w+ki8+YEaJZE0Fz09P929NZeMbDKfu0aO+zsI3pK/Ufw1HDj6POw/9MPXulzjvq3cmI69qyH7rSl81V2FKFI0kBFkmAHNVeS01893397foLb7u7lmUOfsgXY/TQ2PfAYaOjHEOvtuvN1176FKunl0Hsh+5R6+Kn9o9GsBV5Uy8ytpG46s2Xoig1WVaR9DkPLBaldP9hgvsq+Y2WJ6azRcGzKUpFzUR6EXtHhyH2WCLBGLfzUEn5Qzxi7K2iwOnf2KSGVKhsVyNJaFpJPltt+yTnPArc8r3Lai3vgUbEvw)?

---

<div class="post-metadata">

**Author:** ![patrick.ht.janssen](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@patrick.ht.janssen](https://community.cesium.com/u/patrick.ht.janssen)\
**Post date:** [July 7, 2018, 2:49am UTC](https://community.cesium.com/t/3d-polygons/7128/3 "2018-07-07T02:49:52Z")

</div>

Yes, that is it. The answer was so simple, I thought I has already tried it.  
Thanks

---

<div class="post-metadata">

**Author:** ![patrick.ht.janssen](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@patrick.ht.janssen](https://community.cesium.com/u/patrick.ht.janssen)\
**Post date:** [July 7, 2018, 8:12am UTC](https://community.cesium.com/t/3d-polygons/7128/4 "2018-07-07T08:12:50Z")

</div>

Hi Omar,

I have created a new sandcastle using primitives instead of entities. I am doing this because:

a) I will be generating models with many polygons, and

b) as far as I understand, primitives with instances will be more efficient than entities

Could you take a look at my function, is there anything else I could optimise?

[Sandcastle](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=vVfhTiM3EH4Viz+3kbYOkFJ0kEMNHCmnQoMgulYi6GR2naxVx17ZXkiu4t07tte7GxOEqNoikNae8Tcz34zHQ7+PNDWoKpEpKHpk9GkmHolyX1ShT0jQJ3RGNauW+KvbSz5kbnkmhSFMUPUhRX/NBIIfXZBcPml0hIyqaOo3DVUK9G697CiA+fWVzCk+/210enn+eSaee8czMRP9fq7IEyLOMzlHpeTrhRQaMYEGOao0EwuUEWUAiQiUSalyJggs7Vkbh1RsAcq6pBmbM6pdcFyKRcqJCVJAttvbgOAkyWhAI2LBaQT2QImybnjZXMklElKZAhkZoa4QWTGdWudzulDUejmvRGaYFC60QZ54j1KPlnpH9DcCxK17gdx+fzWXaomWxCi28ns2U0UZpemCEohicc1MVtxIzpN6/4qYAht5A1IidOJs9VK0C7+W94AH+IBXn5kqULVmNS4i2KkcsxXNx4osaRMAOBOwgtdMaENEBjTacHRrKAj0GOzd3R9vkUy6EnAjsVLPjk3fBk81Ta1pb35BJbDMhNHtrkXxe138FzZaE13wALBaf295OgvpHmBbCyPrUeLO9o5fHnW228NXLqM/4mXFDSv5+nR9bRUSyERqzaTd7LaWkl6M7WPCZaWLxH13FZ5f5WdJjVojWdqKjFiy0okXgL8xCxRcWY2hOqBkmot9TdWXOn9nkks1Kku4K3aJv57fTM//+Dae3FyNpmnkO1XXUjNr6oKyRWE2u0gbousFF4wqorJiDVodcq4jqWdB9zosHL9Bw5xxTvOXLIxhf/Oe1cZ+qU8mHa56r1hp7sI2K1b40kqAD5wmURIax48aNyPKiIHyeqigakAnOo2gwCFHbfZcymKbo4DgitupJF19/PvFl+l5bxO6U2/PXT7aa+8LNYTdeyszsjIc3pstBeoFW7NTy/5RkrYatNKtBt+ZqBrj/8/V6eXo7Nf35mrS5qp2PKg9hz5fKraE6/u4Wdx+jsA6o4LiRkVjkudJN1tB0mVtEYVmOWmrp8NcO3e8Olx0tEnTkKLm8WrjilNp7KvIK4jJdqk54Zp2CayJadpzl5u6pvR/zM7kX413DlPT1m78DiKe7WRnJyo/Kvgps57EXntGP/t5KdnbHeDDw4PDnw7SPTzY3f94eBAmRfcMh/e9nQ727MN+t+umm4P7FN0dRN/2b7ALq42lHQVakP23QH5oUDaW98E3N8ZqSJN7tsDBaNz7CPp3tcNh6tu/b4ZgpktO1t4jXRZURR3nVFbCjmS3Ttag7tF9C1HXVgbjmSLYriJ9D9m97jvpzlCbNacnfu9ntixhqEWV4gnGfUOX4BAkqP9QZX9SgzPtmuiwHw4Nc/aIWP5pthP9jzDbQRknWoNkXnF+y77T2c7JEGJ83DjGpRsyJzBa2NBBpdg7ufSbGONhH5YvTxkp+QNRHcS/AQ).

Patrick

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [July 7, 2018, 3:23pm UTC](https://community.cesium.com/t/3d-polygons/7128/5 "2018-07-07T15:23:59Z")

</div>

I think you’re on the right track! There are many ways to optimize an application. In terms of graphics, often times the bottleneck is the amount of calls you’re making between the CPU and GPU, so combining things (whether that’s putting all your textures into one big image, so you only send one instead of many) or putting a bunch of different geometries into one primitive are all good ideas. This page on Geometry and Appearances talks a bit about efficiently rendering a large amount of polygons under the “Combining Geometry” section:

> **[Documentation | cesium.com](https://cesium.com/docs/)**
>
> Cesium is geospatial. Use Cesium ion's simple workflow to create 3D maps of your geospatial data for visualization, analysis, and sharing. For developers, use the open-source CesiumJS library to create custom 3D mapping apps.

Best of luck!
