View Full Version : Moving text along with the primitive objects
05-14-2011, 07:55 AM
I am doing a sliding number puzzle. I am able to write the text on the polygon primitive which is basically a square using glRasterPos() and glutBitmapCharacter() but when i try to move the square the text remains in its position whereas i want the text also to move along with the square. What do i do???
05-14-2011, 10:27 AM
If you are moving your squares in 2D space, then just recalculate position of the text after transforming and draw at that position. But consider using textures. Draw text into the texture and apply texture onto the quad. That will be much easier and you can apply whatever transformation you want. Furthermore, you can generate textures with much better fonts than those provided by glut.
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.