Rounded corner for a playing card

Hello everybody, 10 years later, it is time to refresh my flash online card game ( so I am thinking to learn and implement it with a modern stack (node.js/, and as I would like something beautiful, I am making my first steps with babylon js.

A few line of codes on a scaled textured box gives already something impressive (at least for me): Title

Question is about the best way to have nice rounded corners… I did some tries with and exported model from Blender, but hum… beginner there too… Title, wrong texture mapping, but not only, the rounded corners look ugly…

Guidance where to spend my next time would be very appreciated !



1 Like

You should just do as your first test scene, but with alpha on your texture :slight_smile:


Vinc3r is right, you can find a playground for something similar is here:, alpha is used to make the sharp corners invisible.
hi use this
front uv is cyan and bak is magenta in this pic

corner rounded scale and seg scale control by this code
var mesh = geo1({ seg: 60 , scale:0.031 , deep:0.03 , width:3. ,height : 4.2 }).toMesh(scene);


Some tries later, I am having fun and being impressed with what I can produce by putting tutorials together, here is my test scene:

I was thinking to give a try to you example to create the “ardoise” (scoring table) on the right, which is a box with rounded angles… but your example is actually too complicated for me to understand…

I managed to have a “rounded” box more or less where I want, and with more or less the correct rounded corners but I don’t find the way to have my texture applied correctly :slight_smile:

Some hints would be appreciated…

btw: is it normal that I have super perfs on my mobile phone (S7) but awful perfs on y old (2010) mac book air ?

Here is an ardoise built from ExtrudePolygon

Had to add back corners in image.

NOTE ExtrudePolygon uses Earcut, so, in non playground projects, you will have to add a reference to their cdn or download their npm package

1 Like

Thank you some much!
I am enjoying to go back to development and so glad to have found this amazing framework and community :slight_smile:

These results in in a few hours are so promising that I will do my whole game with babylon js, so I’ll be back in the forum, more than often… hope to reach a level that will allow me to help people too one day, hehe

See you

ps: here it is with your ardoise Title, now about to try so nice animation for the 9 cards game opening

1 Like

We are happy to have you with us as well!