problem with outline text
I encountered some problems with outline text.
The problem is:
before i display the outline text everything is rendered ok ( i am loading my model from 3ds file). after i display my outlined text the objects in the model are rendered backwords ( it looks like problem with glCullFace()) but i tried to force the correct CullFace before i rendered. i havent got a clue where is my problem i have pictires to deminstrate the problem.
before displaying outline font:
before.jpg
after displaying outlined font:
After.jpg
10x in advance
Avishay
Your right, this does look like a glCullFace problem. Can you post the render code for your outline text?
Cheers,
- llvllatrix
Cheers,
- llvllatrix
well here it is
The first method builds the font and the display lists
and the second one render the text on the screen.
The first method builds the font and the display lists
and the second one render the text on the screen.
void Text::BuildOutlineFont(void){ HFONT font; // Windows Font ID baseOutline = glGenLists(256); // Storage For 256 Characters font = CreateFont( -12, // Height Of Font 0, // Width Of Font 0, // Angle Of Escapement 0, // Orientation Angle FW_BOLD, // Font Weight FALSE, // Italic FALSE, // Underline FALSE, // Strikeout ANSI_CHARSET, // Character Set Identifier OUT_TT_PRECIS, // Output Precision CLIP_DEFAULT_PRECIS, // Clipping Precision ANTIALIASED_QUALITY, // Output Quality FF_DONTCARE|DEFAULT_PITCH, // Family And Pitch "Comic Sans MS"); // Font Name SelectObject(hDC, font); // Selects The Font We Created wglUseFontOutlines( hDC, // Select The Current DC 0, // Starting Character 255, // Number Of Display Lists To Build baseOutline, // Starting Display Lists 0.0f, // Deviation From The True Outlines 0.2f, // Font Thickness In The Z Direction WGL_FONT_POLYGONS, // Use Polygons, Not Lines gmf); // Address Of Buffer To Recieve Data}void Text::showOutLineText(Point3D &p,Color &color,string &text){ if(!(initMode & INIT_OUTLINE_FONT)) { if(hDC==NULL) { throw Exception("Could Not Show Text hDC is NULL"); } BuildOutlineFont(); initMode = initMode | INIT_OUTLINE_FONT; } glDisable(GL_TEXTURE_2D); glColor3f(color[0],color[1],color[2]); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(p.getX(),p.getY(),p.getZ()); glPushAttrib(GL_LIST_BIT); // Pushes The Display List Bits glListBase(baseOutline); // Sets The Base Character to 0 glCallLists(text.length(), GL_UNSIGNED_BYTE, text.data()); // Draws The Display List Text glPopAttrib(); // Pops The Display List Bits glPopMatrix(); glEnable(GL_TEXTURE_2D);}
hmm...nothing too obvious. Can you query the state of the cull face property before and after the calls to these functions?
Cheers,
- llvllatrix
Cheers,
- llvllatrix
i tried this insted i think it has the same effect ... but no luck
where menu.showMenu();
uses the methods above to show each option in the menu.
and the CullFace is the same as in the init... agian no luck.. but i will try any way to trace a change in the cull face.
other ideas ?
10x
where menu.showMenu();
uses the methods above to show each option in the menu.
if(inMenu) { menu.showMenu(); } else { glCullFace(GL_CW); cam.Render(); world.draw(); }
and the CullFace is the same as in the init... agian no luck.. but i will try any way to trace a change in the cull face.
other ideas ?
10x
August 09, 2005 09:59 PM
set glfrontface(GL_CCW) right after rendering your font - Crappy windows bug.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement