Sign in to follow this  
alanX

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

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this