Fill object with variable length

Hi, I’m making a game of snakes and ladders but I want to make it procedural, does anyone know how to fill between two objects so that their length is variable?

I did it manually for the exemple:


Here is the playground:
Dynamic mesh | Babylon.js Playground (babylonjs.com)

I have some advace but the direction sometimes was wrong
Captura de pantalla 2022-11-21 232152
Captura de pantalla 2022-11-21 232417

Dynamic mesh | Babylon.js Playground (babylonjs.com)

Hey @Abner_Corona , how are you doing?

Here, I did a small fix to your playground:
Dynamic mesh | Babylon.js Playground (babylonjs.com)

2 Likes

Wow that a really elegant and shorter solution, thanks a lot!!!

2 Likes

And it should work in 3D as well:

Dynamic mesh | Babylon.js Playground (babylonjs.com)

3 Likes

Thats cool!!
Here is the code for the snake in case someone uses it, it’s not perfect but it works… I think hahaha
Dynamic mesh | Babylon.js Playground (babylonjs.com)