Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: glutBitmapCharacter with glutSolidSphere problem

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2013
    Posts
    10

    glutBitmapCharacter with glutSolidSphere problem

    Hello,

    I am trying to create a scene with GLUT bitmap text and GLUT sphere at the same time (ortho and then pespective matrix).

    Both are displayed well until I try to refresh the scene with glutPostRedisplay(), then the text disappears. But when i try to create the same scene with regular box instead of the GLUT sphere, everything goes fine.

    Any idea why the text keeps disappearing?

    Thanks

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2013
    Posts
    10
    It's somehow affected by polygon count of the sphere. If I lower it to 3, the text is visible, but it's grey instead of white. On higher polygon count, the text isn't visible.

    Any idea why?

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,105
    We need to see the code - it sounds like the text is being hidden by the sphere

  4. #4
    Junior Member Newbie
    Join Date
    Jun 2013
    Posts
    10
    I don't have the code on this computer, but I will post it later.

    In any way, I found out that the problem must be in material used on the sphere or in a ligting of the scene because when I turn these off, everything's fine.

    But how can lighting affect bitmap text in orthogonal projection?

  5. #5
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    474
    Quote Originally Posted by Triffid View Post
    But how can lighting affect bitmap text in orthogonal projection?
    If lighting is enabled, it affects the colour used by glBitmap() (specifically, glRasterPos() calculates the colour in the same manner as glVertex()). If you want to specify the colour directly with glColor(), disable lighting first.

  6. #6
    Junior Member Newbie
    Join Date
    Jun 2013
    Posts
    10
    Quote Originally Posted by GClements View Post
    If lighting is enabled, it affects the colour used by glBitmap() (specifically, glRasterPos() calculates the colour in the same manner as glVertex()). If you want to specify the colour directly with glColor(), disable lighting first.
    Of course you are right.

    Thanks

Posting Permissions

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