Moving as if we were drawing a letter

Started by
3 comments, last by kburkhart84 18 years, 11 months ago
Hi guys ! I wana be able to move an object ( lets say a small ball ) so that she is drawing a letter . I really dunno how to do this . If that can help, im using opengl / sdl ( all that in c++ ) . Im currently using bitmap font . I'll use a Non-regular font ( ex -> a gothic one or something ) . If you got any ideas ...
Advertisement
You could make the object follow an arbitrary path. This can be done by defining a series of waypoints which the object should traverse in order. For the object this means it should move in the direction of the next waypoint until it is met. Then dequeue that waypoint and start moving towards the next one if there is still a next waypoint.

This approach allows you some flexibility, because the shape not necessarily has to be a font. If you want the object to follow a font, simply define the waypoints according to your font bitmap. You could interpolate the waypoints linearly or more continuous like splines, if you want. Note that some (non-bitmap) fonts are actually defined much like this and those would certainly fit nicely into your application.

Greetz,

Illco
i dunno if its exactly what yoou told me, but someone suggested that i could record the (x,y) pos of myself moving my mouse, writing every letter ; and then use those coord into my app.
It will work but may not be smooth ( because im a very bad drawer :p )
Yes that would work with what I described, but is a very coarse method of getting the right waypoints. A better suggestion would, in my opinion, be to open a graphics package and write a really huge version of the letter in a nice script font. Then trace the outline with mouse clicks and adjust them where necessary until you cover the letter nicely with small straight line segments. Then record the positions of the waypoints and put them in your program.

Greetz,

Illco
The last method is probably best, though I don't think the letter has to be huge, just big enough for the job, though that really doesn't matter anyway.


This topic is closed to new replies.

Advertisement