problem with outline text

Started by
5 comments, last by BlackRyder 18 years, 8 months ago
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
Advertisement
Your right, this does look like a glCullFace problem. Can you post the render code for your outline text?

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.

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

	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
set glfrontface(GL_CCW) right after rendering your font - Crappy windows bug.
Thanks alot it worked
maybe it will be good if you put it in the tutorial of Out Line font.

This topic is closed to new replies.

Advertisement