How to identify the shape of a line renderer.

Hello, i need help with a project i am doing, basically i have created a script that whenever you press the mouse button it create a new line renderer, and until you put your mouse up it will create a new points, so you can draw things with it. Anyway i would like after you press a key stop/start drawing that it identifys the shape of the thing that the line renderer built. Kinda like this game : http://www.nitrome.com/games/magictouch/

P.S: i am sorry for bad grammer, English isn’t my first laungage

FYI, Many people won’t be able to see that game because it’s Flash, which is now being disabled by default more and more on browsers. So I’m just going by your description.

Shape detection isn’t easy, and certainly not something you’ll be able to figure out from a forum post - we’re talking probably weeks of work to figure it out. My advice would be to search for an existing detection algorithm already written in C#, and then run your points through that.

OK, do you have somewhere i can start?

Google usually works pretty well :slight_smile:

but what should I search? i searched for “unity C# shape-recognition” but it only came up with 1 result that does what I want but you need to buy it :expressionless:

@Sinci1

hi - how about you go to asset store, enter “gesture recognition” into search field?

thanks, sadly none of them are free.

@Sinci1

Yes, TANSTAAFL

Alternatives are always the same;

Do your own research and code,

try find out if free tool exists (then some more of this)

or pay.

1 Like

What sort of shapes are you trying to identify here?

first im trying to do basic(circle,sqaure,bolt), then maybe advanced(stickman,house).

ok thanks for the tips

Doing some quick googling I came up with a Hough Transform:

I haven’t read through the entire thing, but this is where you would probably want to start if you try to code it yourself. you might also find some free libraries implementing this.

Thank you all,after i did some resarch, i found out about P dollar ,a open source shape recognition project, and i searched “P dollar unity C#” and it came up with this : Unity P Dollar gesture recognizer | Aymeric Lamboley

2 Likes