Jump to content
  • Advertisement
Sign in to follow this  
alimarandi

Draw connected lines with different thickness

This topic is 4990 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
Advertisement
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){
glLineWidth(something);
glBegin(GL_LINES);
glVertex3fv(something);
glVertex3fv(something_else);
glEnd();
}

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.

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

Sign me up!