gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Tracing objects, writing to files, ordering graphics

#106451 - MattC - Thu Oct 19, 2006 7:57 am

As the subject reads, I'm trying to figure out if there's a common way that you can tell if someone has traced a graphic? Basically, I want to know if someone traces any object, like a letter or shape, something like that.

The only way I could think of is by writing a library that captures some user input, that defines what a "good" trace is, and writing some coordinates to a file in order to store the information. Which is my second question, could I do this on the DS, or would I have to create the files in advance, and compile them into the rom?

Also, how do I move one image in front or in back of another? I'm currently using PALib to handle graphics, but I don't mind using the NDS library. I tried swapping the sprite numbers, but it never works.

-Matt

#106460 - PypeBros - Thu Oct 19, 2006 8:57 am

i'm not a guru here, but as far as i know, most "drawing recognition" programs tries to fit the pixels on a line which is constructed from the previous points. As long as you can find a straight line which is at most k pixels away from the furthest pixel, you'll go on with that line, otherwise, you just enqueue the segment you add and start with a fresh segment using the last two values.

You might want to run a similar algorithm for curves fitting too, so that you can recognize round shapes by another mean than just looking at a bunch of disorganized tiny segments.
_________________
SEDS: Sprite Edition on DS :: modplayer