Jump to content
  • Advertisement

Archived

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

spiffgq

Can I texture a line?

This topic is 5807 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

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?

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!