Jump to content
  • Advertisement
Sign in to follow this  
alanX

OpenGL Program a 10x10 quadrilateral mesh for a plane(GL_LINES only)

This topic is 4313 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 ALL, I have problems on how to Program a 10 x 10 quadrilateral mesh for a plane using GL_LINES only. ( ax + by + cz + d = 0) Can anyone give me some hint or useful websites? I am new to OpenGL.

Share this post


Link to post
Share on other sites
Advertisement
Aside from the detail of rasterizing the lines, the problem isn't specific to OpenGL. Anyway, note that there is no unique grid, mesh, or whatnot corresponding to a given plane; the grid could be placed anywhere and in any orientation so long as it lies in the plane, so you must choose a position for the origin of the grid, and an appropriate orientation.

The position can be any point on the plane, and the orientation can be built as an arbitrary orthonormal basis using the plane normal as a reference. From there you can easily iterate through the vertices of the grid in the coordinate system you've defined and plot the resulting points.

If you get stuck on the details, post back with any specific questions you have.

Share this post


Link to post
Share on other sites
Thank you for quicky reply

In fact, i have some ideals,as follows,in my mind. But I don't know if the direction is right or not. Please comment and help!

Procedures:
(1) To define a quadrilateral plane equation with 3D coordinate. (ax+by+cz+d=0)
(2) Using "for loop(x,y,z)" to find out the 100 points matching the defined equation and then plot the 10x10 quadrilateral plane with "GL-LINES".

Problems during the programming stage:
(1) It seems fo difficult to define a quadrilateral plane equation with a length of 10 and an area of 100.
(2) Using "for loop(x,y,z)" to find out appropriate 100 points seems so difficlut as GL_LINE plots the lines in order of {point1,point2),{point3,pont4},...{point99,point100). Points seems not easy to be verified.

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!