Jump to content
  • Advertisement
Sign in to follow this  
codeman_nz

Multiple line strips

This topic is 2441 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 Everyone,

Is it possible to have multiple calls to line strip using different vertices.

What I am doing is I have a loop with a bezier curve. In the loop it calculates the bezier point and another point above and below the point and the goal is to draw three separate lines with each of those points. At the moment I just put them into three arrays and then call glVertexPointer and glDrawArrays but it looks too ugly.

Any ideas?

Share this post


Link to post
Share on other sites
Advertisement

Hi Everyone,

Is it possible to have multiple calls to line strip using different vertices.

What I am doing is I have a loop with a bezier curve. In the loop it calculates the bezier point and another point above and below the point and the goal is to draw three separate lines with each of those points. At the moment I just put them into three arrays and then call glVertexPointer and glDrawArrays but it looks too ugly.

Any ideas?


You could use a geometry shader to expand the points into line segments. Not sure how it works in OpenGL but in Directx, I'd have a buffer only of the points in the curve and then run it through the geometry shader to have it emit line segments based on the two points you are calculating and then render those. That would probably do the trick for what you're trying to do.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!