New 3d Engine - Help filling 4-sided polygons

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

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.

5 Likes

Native triangle and 4-sided polygon fill is now in beta, courtesy of the wonderful @AqeeAqee! https://arcade.makecode.com/beta#pub:_J7PYHh23dWDw

My usual beta disclaimer: Don’t do anything important in beta or open projects you care about! Beta is for testing new features only!

7 Likes

YAYYYY! When will it get out of beta? It would be cool to see it very soon. Maybe even as a quick patch and not a full update if the next full update will take a while to come out (assuming the code doesn’t have bugs)? Either way, this is super exciting! Can’t wait to play around with it for my game!

2 Likes

haha, I’ll try and do a hotfix for it in the next week or two!

5 Likes

Thanks!!!

2 Likes

A Tangram Puzzles Animation, demo of fillTriangle/fillPolygon4.

(Have to show a snapshot here, Gif can’t record correctly. And thumb doesn’t work, probably project was shared to formal site though I clicked on beta site?)

Inspired by a interesting usage of scene.createRenderable() in one of @richard 's fill triangle demo project

Note, both projects runs on BETA site only, until this feature is published to formal site.

4 Likes

Oh dude, I love tangram! We had a project in school once where we played around with various combinations! That aside, your projects are incredible, the fast filling functions are super advanced, great job!

3 Likes

WOW. I don’t think I’ve ever been more confused in my entire life. Like, I’m actually trying so hard to think of a time I was more confused, but I just can’t find one.

3 Likes

Hey we did a thing

Thanks again for the great prs!

5 Likes

Wow, it is released hah!
No problem! It’s my pleasure, of course, to contribute back to great Makecode Arcade!
Thanks for you and @richard 's trust, this is a wonderful journey. :tada:

4 Likes

Thank you so much @richard, @jwunderl, @AqeeAqee, and whoever else (like other members on the MakeCode team) contributed to this release! This runs super smooth now!

This will also allow for other 3d rendering systems to be developed, not having to work pixel-by-pixel, greatly improving performance! While my project most likely still won’t run on hardware due to the other math, these changes allow for much better performance in the sim! I could see many great uses for filled polygons in the future, and I’m excited for what will be possible in the future!

6 Likes

I wonder if anyone is going to try to expand apon this.

1 Like

I abandoned this project for a while but now I’m back to begin making better collision. For now I just wanted to see how it would run at double res, and its surprisingly good. I will keep it as regular but it was just a fun experiment.

2 Likes

Wow… 1,536 filled polygons…

I added collision DETECTION, except this time its extremely accurate, using a line intersection algorithm (Thanks Bing AI, even though I had to spend like 2 hours debugging the code!), but I didn’t make it do stuff yet. If you open the console log, every time you collide with something, it will show the (assigned) index of the tile column that was collided with. BTW this project DOES run on hardware, it just can’t handle very many polys so the amount has to be cut down to around 40 to run at full perf. So I probably won’t plan on supporting hardware in the future unless I learn fX math. I also plan to add depth sorting in the future.

Also another note: With this same engine, it may be possible to make a DOOM clone if
1: Rotation was added, so all the points in the scene rotate around the player (possibly using a lookup table to save on trig? Though that would make it slightly choppier because of the lack of precision in the amount of directions available.)
2: A new map system was developed, perhaps using the BSP concept for depth sorting
I probably won’t do this, but I might look into it for the future when I finish this project.

5 Likes

Not to be rude but the collision doesn’t work

2 Likes

As I said it’s collision DETECTION, but it doesn’t stop the player yet. It tells when you overlap but doesn’t do anything about it.

4 Likes

oh, oops

3 Likes

Wow very impressive

2 Likes

Here’s the next iteration, involving collision. The collision isn’t super great (a little jittery and it depends on there being a center point), but there also isn’t much documentation or wiki articles so I had to come up with it from scratch. It should work though with the gravity mechanics that I’ll implement.

5 Likes

Wow you can even slide on curves, thats awesome, it’s smooth with a small incline

3 Likes