Mathematical geometry of costume shap

that block sucks

when touching a wall and turning, it might get stuck

this is what I meant.

Yes. And I wanted to make say this.

Cocos2dx. It's a game engine.

I looked it up, so I know, Also, I was trying to do a coconut joke.

Screenshot 2024-05-16 10.58.41 AM
ex: i would need to find all corners in this

Could you use raycasting?

slow. but in theory you would only have to do it once. but in snap i dont know how accurate it is

No really. Snap! has the pic
block, which can be used to do raycasting.

how

Right, you want the convex hull, as @bluebaritone21 suggested. Look it up.

Or use the analog method: Bang nails into the plane at the corners, stretch out a rubber band to enclose the whole shape, and let go.

how would i do that

If you mean the analog method, you get a piece of wood, a hammer, some nails, and a big rubber band! Convex hull is famous as being a problem much more easily solved without a computer than with one. But look it up; I'm sure Wikipedia will tell you what to do.

I thought of a method, you could have a loop that goes for 1 to 360 (higher or lower number for more or less precision) and raycasts in a circle around the sprite to its center, adding each point to a list. This way you can get the rough outline of a shape, with even some (but not all) of the concave areas.

hmm

that's a result of buggy code, not .