Results 1 to 2 of 2

Thread: Moving text along with the primitive objects

  1. #1
    Junior Member Newbie
    Join Date
    May 2011
    Posts
    1

    Moving text along with the primitive objects

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

  2. #2
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,214

    Re: Moving text along with the primitive objects

    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.

Similar Threads

  1. OpenGL, c++, moving text
    By dsfedorov in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-17-2017, 06:42 AM
  2. Moving text horizontally
    By Bargros in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-24-2016, 02:00 PM
  3. Moving text around the circle
    By daimous in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 12-12-2009, 07:09 AM
  4. Texturing non-primitive objects...
    By Anonymous Coward in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-08-2002, 06:00 AM
  5. Texturing non-primitive objects...
    By Anonymous Coward in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 08-15-2000, 02:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean