problem in glcolor after texturing.. help!!!

Started by
2 comments, last by asu80 21 years, 2 months ago
hello... i've been experiencing a problem in nehe lesson 7. if u add this code in the program. it will display a red texturing (because of the axes color).
    
glBegin(GL_POINTS);						glColor3f(1.0f,0.0f,0.0f);			
	// x axes on the right

	glVertex3f(0.0f,-4.0f,0.0f);
	glVertex3f(3.0f,-4.0f,0.0f);		
	glVertex3f(6.0f,-4.0f,0.0f);		
	glVertex3f(9.0f,-4.0f,0.0f);		
	glVertex3f(12.0f,-4.0f,0.0f);		
	glVertex3f(15.0f,-4.0f,0.0f);		
	glVertex3f(18.0f,-4.0f,0.0f);		
	glVertex3f(21.0f,-4.0f,0.0f);		
	
	// x axes on the left

	glVertex3f(-3.0f,-4.0f,0.0f);		
	glVertex3f(-6.0f,-4.0f,0.0f);		
	glVertex3f(-9.0f,-4.0f,0.0f);		
	glVertex3f(-12.0f,-4.0f,0.0f);		
	glVertex3f(-15.0f,-4.0f,0.0f);		
	glVertex3f(-18.0f,-4.0f,0.0f);		
	glVertex3f(-21.0f,-4.0f,0.0f);	
	
	// z axes forward

	glVertex3f(0.0f,-4.0f,3.0f);
	glVertex3f(0.0f,-4.0f,6.0f);		
	glVertex3f(0.0f,-4.0f,9.0f);		
	glVertex3f(0.0f,-4.0f,12.0f);		
	glVertex3f(0.0f,-4.0f,15.0f);		
	glVertex3f(0.0f,-4.0f,18.0f);		
	glVertex3f(0.0f,-4.0f,21.0f);		

	// z axes backward

	glVertex3f(0.0f,-4.0f,-3.0f);
	glVertex3f(0.0f,-4.0f,-6.0f);		
	glVertex3f(0.0f,-4.0f,-9.0f);		
	glVertex3f(0.0f,-4.0f,-12.0f);		
	glVertex3f(0.0f,-4.0f,-15.0f);		
	glVertex3f(0.0f,-4.0f,-18.0f);		
	glVertex3f(0.0f,-4.0f,-21.0f);		

	glEnd();

	// Built a dot between the lines                	glBegin(GL_LINES);

	glColor3f(1.0f,0.0f,0.0f);			

	glVertex3f(-25.0f,-4.0f,0.0f);
	glVertex3f(25.0f,-4.0f,0.0f);

	glVertex3f(0.0f,-4.0f,-25.0f);
	glVertex3f(0.0f,-4.0f,25.0f);
	
	glEnd();    
what i wanna do is to display a nice texturing quad (the texture file is brown) and below it is a nice x and z axes (in red). but it just display ALL of it in red including the texturing quad although it's initial texture is brown. how to solve this? [edited by - asu80 on February 1, 2003 2:07:30 PM]
kiss me to kiss u
Advertisement
first of all , my gueses are that you are confusing texture mapping with coloring ,hence the lack of glBindTexture(); ? ,anyway if still going for texture mapping check if you glEnable(GL_TEXTURE_2D); and draw the quads with glBegin(GL_QUADS); if not you can change the color of the quad with another glColor before the glBegin(GL_QUADS);
quote:Original post by Anonymous Poster
first of all , my gueses are that you are confusing texture mapping with coloring ,hence the lack of glBindTexture(); ? ,anyway if still going for texture mapping check if you glEnable(GL_TEXTURE_2D); and draw the quads with glBegin(GL_QUADS); if not you can change the color of the quad with another glColor before the glBegin(GL_QUADS);


i''m not confusing texture mapping with coloring. i just wanna make a nice x and z axes beneath it (the quad texturing)and in red color. i''ve enable glEnable(GL_TEXTURE_2D); in the InitGL function. also draw the quads with glBegin(GL_QUADS).
quote:Original post by Anonymous Poster
first of all , my gueses are that you are confusing texture mapping with coloring ,hence the lack of glBindTexture(); ? ,anyway if still going for texture mapping check if you glEnable(GL_TEXTURE_2D); and draw the quads with glBegin(GL_QUADS); if not you can change the color of the quad with another glColor before the glBegin(GL_QUADS);


i''m not confusing texture mapping with coloring. i just wanna make a nice x and z axes beneath it (the quad texturing)and in red color. i''ve enable glEnable(GL_TEXTURE_2D); in the InitGL function. also draw the quads with glBegin(GL_QUADS).
kiss me to kiss u

This topic is closed to new replies.

Advertisement