Jump to content
  • Advertisement
Sign in to follow this  
f_shaukat

OpenGL line pattern inside a polygon

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

Hello All, My problem is this: I have a polygon, lets say it is a rectangle. I want to fill the interior of this rectangle with parallel lines. The lines are oriented at 45 degree angle with the x-axis. Lines start from one edge of the rectangle and stop at the other edge of the rectangle. The rectangle might contain holes inside it. How to do this in opengl? Is there any function for filling a rectangle with a line pattern or should i devise an algorithm for it? Does any algorithm already exists? Thanks in advance, Faisal

Share this post


Link to post
Share on other sites
Advertisement
You would just need to do a for loop, I wouldn't be able to think of it from the top of my head, but draw a picture on a piece of paper or something and think about it. But if it is an n sided polygon, then I don't know, that would be really confusing lol.

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!