Jump to content

  • Log In with Google      Sign In   
  • Create Account

GL_LINES and Textures


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 BerLan   Members   -  Reputation: 122

Like
Likes
Like

Posted 26 October 2001 - 10:42 PM

Simple question: How do you assign textures when rendering lines? Textures do work for normal polygons, but i now need to assign textures for lines too. Currently the lines get rendered without any textures, just with the material colorvalues. Here''s a short summary of what i''m doing: (Lines are rendered antialiased) Material (diffuse, ambient, etc) is set. A texture is set. Blending is enabled. LOOP each line Texcoords are set for each line vertex. A normal is set for each line vertex. Line is rendered. END LOOP Setting glPolygonMode for GL_LINES and rendering the lines using polygons would probably solve this, but it doesn''t sound to be a very good solution. Any ideas on this?

Sponsor:

#2 jenova   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 October 2001 - 04:29 AM


glEnable(GL_TEXTURE_2D);
glBegin(GL_LINES);
glTexCoord2f(0.0f, 1.0f);
glVertex2f(0.0f, 1.0f);
glTexCoord2f(1.0f, 0.0f);
glVertex2f(1.0f, 0.0f);
glEnd();


To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

#3 BerLan   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 October 2001 - 07:12 AM

Thanks for your reply.

So basically you mean that i should enable texturing once just before i''m rendering the lines? Sounds odd since i''ve learned that OpenGL is a state machine, and because i''ve already enabled the 2D texture-bit it should stay enabled. Well, off to try it anyway...




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS