PDA

View Full Version : glutBitmapCharacter with glutSolidSphere problem



Triffid
06-12-2013, 04:16 PM
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

Triffid
06-12-2013, 04:47 PM
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?

tonyo_au
06-12-2013, 07:19 PM
We need to see the code - it sounds like the text is being hidden by the sphere

Triffid
06-13-2013, 02:23 AM
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?

GClements
06-13-2013, 03:21 AM
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.

Triffid
06-13-2013, 04:58 PM
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