Can I texture a line?

Started by
5 comments, last by spiffgq 21 years, 9 months ago
In reality, line segments are infinitly thin. However, in OpenGL, lines can have thickness, but a solid color line is boring. Can I texture map lines with 1D/2D textures?
SpiffGQ
Advertisement
Not sure about texturing, but you can stipple. You can also draw lines as quads and manually texture them, of course.

[twitter]warrenm[/twitter]

Yes, texturing works fine for lines and points.
---I write code.DelphiGL (http://delphigl.cfxweb.net)
quote:Original post by ZealousElixir
Not sure about texturing, but you can stipple. You can also draw lines as quads and manually texture them, of course.


I was considering the quad idea.

quote:Original post by Jallen
Yes, texturing works fine for lines and points.


So, would 2D textures work? I imagine 1D textures work fine, perhaps something like this:


  glBegin (GL_LINES)   glTexCoord1f(0.0f);   glVertex3fv (firstVertexCoords);   glTexCoord1f (1.0f);   glVertex3fv (secondVertexCoords);   /* ect */glEnd ();  
SpiffGQ
Yes. Try it and see.

____________________________________________________________
www.elf-stone.com

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

1D texturing works for best with the lines and points.



The pain is coming...this sommer!!!
Yeah, 2D textures work fine. Some old cards don''t support it (I just remember that I used to own a card which wouldn''t texture a line or fog a line either. I think it was a voodoo, though, so you''re probably safe these days )

If I had my way, I''d have all of you shot!

codeka.com - Just click it.

This topic is closed to new replies.

Advertisement