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

## 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 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 on other sites

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.

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 23
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631768
• Total Posts
3002242
×