# New 3d Engine - Help filling 4-sided polygons

**URL:** <https://forum.makecode.com/t/new-3d-engine-help-filling-4-sided-polygons/18641>\
**Category:** Help\
**Tags:** graphics-and-math\
**Created:** [March 20, 2023, 5:06pm UTC](https://forum.makecode.com/t/new-3d-engine-help-filling-4-sided-polygons/18641 "2023-03-20T17:06:21Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)\
**Post date:** [March 27, 2023, 11:07pm UTC](https://forum.makecode.com/t/new-3d-engine-help-filling-4-sided-polygons/18641/21 "2023-03-27T23:07:15Z")

</div>

YES @Brohann , I just added some math and this is what I have now:

> **[renderer-prototype](https://arcade.makecode.com/91608-95195-72120-48917)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Use the second player’s controls to change the angle. (I,J,K,L)

I’ve also been working on adding collision checks, I added the ability to change the number of sides again in-game with up/down (again), but with some amounts of sides the level isn’t shown bc there is the wrong number of columns in the image. The collision checks use some math with angles to efficiently show whether you are inside the tunnel or not (I’m super happy with this logic). I don’t have the collision logic done yet, but the number of hearts switch between 7 and 3 when inside/outside the tunnel.

---

_[View the full topic](https://forum.makecode.com/t/new-3d-engine-help-filling-4-sided-polygons/18641)._
