Sign in to follow this  
michaudj

Begginner : Anti-Aliasing with GL_QUADS : see diagonal line

Recommended Posts

Here i tried some stuff to make a floor with black and white tile ( user define, but testing with black and white ). But when i make it move it create some ugly lines. So i try anti-aliasing... It seems like it works but, it makes a line the color of my background(0.5,0.5,05) diagonaly in each tile... I have put in comment of some of the thing i have tried.

	glClear(GL_DEPTH_BUFFER_BIT);

	glMatrixMode(GL_MODELVIEW);
	glPushMatrix();

	// Inclin of floor
	glRotatef(fAngleIncli,afVecRot[0],afVecRot[1],afVecRot[2]);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);


		// TODO : STILL NEED SOME TESTING
	if(ANTI_ALIASING_ON == (int)a2dCombin[ANTI_ALIASING][VALUE])
	{
		//glEnable(GL_BLEND);
		//glEnable(GL_POLYGON_SMOOTH);
		//glBlendFunc(GL_SRC_ALPHA_SATURATE,GL_ZERO); // GL_ONE
		//glHint(GL_POLYGON_SMOOTH_HINT,GL_FASTEST); // GL_NICEST
		//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

		glEnable(GL_MULTISAMPLE_ARB);
	}










and the floor, // This is only 1 tile, i make a for depending on how many the user wants.
	glBegin(GL_QUADS);//Hauteur = Height and fDemiLarg= Half the total floor
		glVertex3f(-fDemiLarg + fPosX1, HAUTEUR, -fDemiLarg + fPosZ1);
		glVertex3f(-fDemiLarg + fPosX1, HAUTEUR, -fDemiLarg + fPosZ2);
		glVertex3f(-fDemiLarg + fPosX2, HAUTEUR, -fDemiLarg + fPosZ2);
		glVertex3f(-fDemiLarg + fPosX2, HAUTEUR, -fDemiLarg + fPosZ1);
	glEnd();	



Anyone know if it's normal since quad make 2 triangle ? Would it be easier to make texture of tile ? here is what i see
********
**     *
* *    *
*  *   *
*   *  *
*    * *
*     **
********



inside it's either black or white and the diagonale is black, grey or white depending on config or method called ( see comments ) [Edited by - michaudj on January 30, 2008 3:35:51 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this