I'm probably going to use this in my Nintendo DS simulator. Keep up the good work!
Thanks! I really look forward to seeing it if you do.
Nice system! It works quite well, but if I were to use this in a game I would make it so that you don't have to start at or end at a specific point and go in a specific direction.
I can get all of the shapes except for the "X" and the "?". Even after reading what you said, it still doesn't work!The recognition is OK, I guess... Try as I might, I could not get it to recognize a square, though. The other shapes were fine though (except for the "X", I couldn't figure out how to draw it). It uses a different method from mine. I think it could be very useful for the formations, though. Very nicely put together. I would encourage anyone reading this to check it out!
Thank you. The question mark uses a "directional string" instead of point angles for its mouse recognition, which makes the question mark less accurate than the other shapes. You can define a question mark using the most accurate pointgrid_add() scripts, but I just wanted to show everyone that you can define shapes in two different ways using this system.
One easy way to create a question mark definition using the pointgrid_add() scripts would be to draw a question mark on the screen, then press F2 to save it to a file. Then you can use the pointgrid_add_file() script, or you can open the file in Notepad to see the point coordinates, and use the pointgrid_add_point() script for each point.
Here's the X code:
xright = gesture_define(xright_grid,0,.95,'','','',0,'',0,'','','',0,300,0,'');
xleft = gesture_define(xleft_grid,0,.95,'','','',0,'',0,'','xright','',0,6000,0,'show_message("X: " + string(gesture_get_score(xleft)*100) +"%")');If you go in the Demo object's creation event, you can change the 300 you see in the "xright" gesture_define() to a higher number to give you more time to draw the X. You can even lower the .95 you see in both the "xright" and the "xleft" definition to .8 for example to make it easier to draw the shape. Or that's what you did?
I could make it so that you can draw the shapes from any point and any direction, but if you define several shapes, it might slow the recognition process down a bit. I'll look into it and see how it works out. Would you guys actually want to be able to draw a shape from any spot on the shape, or would just being able to start at any of the shapes vertices and drawing in any direction be ok?
Well, for now, you have the "flips" and "rotations" gesture_define() arguments, so you can keep the number of shapes you have to define at a minimum. For example, let's say you want to make it so that the triangle can be drawn from any vertex and in any direction. You could do that with just 3 gesture definitions like this:
// Create triangle grids
triangle1_grid = pointgrid_create();
pointgrid_add_triangle(triangle1_grid,15,0,0,15,30,15,false);
triangle2_grid = pointgrid_create();
pointgrid_add_triangle(triangle2_grid,0,15,15,0,30,15,false);
triangle3_grid = pointgrid_create();
pointgrid_add_triangle(triangle3_grid,0,15,30,15,15,0,false);
// Define triangle shapes
triangle1 = gesture_define(triangle1_grid,0,.75,'','0','',45,'',0,'','','',0,0,0,'show_message("Triangle: " + string(gesture_get_score(triangle1)*100) +"%")');
triangle2 = gesture_define(triangle2_grid,0,.75,'','0','',45,'',0,'','','',0,0,0,'show_message("Triangle: " + string(gesture_get_score(triangle2)*100) +"%")');
triangle3 = gesture_define(triangle3_grid,0,.75,'','0','',45,'',0,'','','',0,0,0,'show_message("Triangle: " + string(gesture_get_score(triangle3)*100) +"%")');If it weren't for the 5th argument in each gesture_define(), I would have had to create 6 triangle definitions to cover the entire triangle. But the '0' I placed in the 5th argument of each gesture makes it so that each triangle has a horizontal flip enabled, so you only need 3 definitions.
Edited by Seeker, 10 June 2007 - 04:46 AM.














