Jump to content
  • Advertisement
Sign in to follow this  
Ey-Lord

OpenGL Moving as if we were drawing a letter

This topic is 4929 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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 )

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!