• Advertisement

Archived

This topic is now archived and is closed to further replies.

problem in glcolor after texturing.. help!!!

This topic is 5498 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
Guest 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);

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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).

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites

  • Advertisement