drwhut / tabletop-club

An open-source platform for playing tabletop games in a physics-based 3D environment for Windows, macOS, and Linux! Made with the Godot Engine.
https://tabletopclub.net
MIT License
1.3k stars 57 forks source link

[Feature request] Add “fillet” and “chamfer” for cuboids #182

Open GrimPixel opened 1 year ago

GrimPixel commented 1 year ago

It would feel more realistic to see rectangles and cubes with fillet. East Asian dice usually have a large fillet, which makes their movement harder to predict.

elmodor commented 1 year ago

Can you give an example what exactly you want/mean? Do you have a picture?

GrimPixel commented 1 year ago

In real life, if the corners of cards are right angles, then they will be abraded and utilised for cheating. So they changed it to round corners. It is called “fillet” in CAD and in CSS, it is specified with “border-radius”. The black corners of these cards need to be removed with that “fillet”. https://github.com/MicahBird/tabletop-club-OneCards-asset-pack/blob/main/assets/OneCards/games/One.png

drwhut commented 1 year ago

To be fair, this would make objects like cards look nicer.

One potential problem I just thought about, if this was to become a configurable value for objects like cards, then what would happen if cards with different radii stacked on top of each other? Currently the game optimises stacks of cards by essentially representing it as a thicker card, based on the top and bottom cards. Do we only allow cards with the same radii to stack? Or do we just use the top/bottom card's radii?

I'll label this as an enhancement, but this will be somewhat low priority for now, since this is just for looks.

GrimPixel commented 1 year ago

If their radii are different, then they are from different decks, thus not stackable.

ja-cop commented 1 year ago

For single cards, could this be accomplished with alpha test/alpha clip/cutout? I'm not very familiar with Godot, but maybe this is what Godot calls "alpha scissor"? So, the rounded edge would be determined by the alpha channel in the card texture.

Maybe that doesn't help for stacks, but at least single cards would look nice!

drwhut commented 1 year ago

There's multiple different ways this can be achieved I think, here's what I have in mind so far: