Results 1 to 2 of 2

Thread: Tracing symbols and letters with the mouse

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    21

    Tracing symbols and letters with the mouse

    Hey guys,

    Im wondering if anybody could help me with a link or some ideas on how to acknowledge whether the user successfully traces a letter or symbol on the screen using the mouse in OpenGL.

    Just to clarify, say my program put a large 'S' on the screen. The program would wait until the mouse first entered the 'S' and then monitor the cursor movements, making sure it went all the way around the letter and had a way of recording how many times it went out of the lines.

    I can handle the little extras like counting the mistakes but the general idea of following a letter on the screen confuses me. Thanks for your time!

    ~Matt

  2. #2
    Fanatic Member twanvl's Avatar
    Join Date
    Dec 2001
    Posts
    771

    Re: Tracing symbols and letters with the mouse

    Do you want precise tracing or very rough pattern recognition? From your question it seems like the first case.

    An idea would be to continuously find the distance to the shape. Then draw a small circle around the mouse (depending on the sensitivity), and take the intersection of that with the shape, when you have 'colored' the entire shape this way you are done. This does allow the user to move the mouse back and forth over the same part of the shape, if you want to disallow this you could color areas that are further back (using a larger circle) and that are already visitid in yet a different color; and you detect when the pixel under the cursor is of this color.

    On how to implement this: I would use an image to represent the shape, this allows you to use simple image operations like and/or, drawing circles, and pixel tests.

    This is all just an idea, though, I don't know how well it would work.

    EDIT: This is not really C++ related, you might get better answers in, for example, the math forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width