Jump to content
  • Advertisement
Sign in to follow this  

Draw connected lines with different thickness

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

Hi Everybody, I use the following commands to draw a set of connected lines with different colors. glLineWidth(Thickness); glLineStipple(1, LinePattern); glVertexPointer(3, GL_FLOAT, 0, pVertex3D); glColorPointer(4, GL_FLOAT, 0, pColor4D); glDrawElements(GL_LINES, TotalIndex, GL_UNSIGNED_INT, pIndex); The information for the colors are kept in pColor4D. Right now all the lines have the same thickness. Is there any way to draw the lines with different thickness? Just like what I did with colors here? Thank you, Ali

Share this post

Link to post
Share on other sites
I don't know too much about line thickness, but I do know some about point size. They seem close enought that one might apply to another.

For point size, there is only one way to change the size in an array like that. You have to use a Vertex program in order to change it. I know you can in cg, I'm not sure about the other languages. But that is the only way to efficiently change size. If efficiency isn't a problem (not at all), then you'll have to do something like this:

for(all points){

So if setting up a vertex program isn't too hard, then I'd give that a try. If you need help writing a simple cg program to change the size, I could try and help you out there.

remember I'm not 100% sure line width will work the same way as point size.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!