PDA

View Full Version : surface Rendering

Rucha
01-15-2001, 11:45 PM
I am trying to write code to generate a mesh around a surface defined by
several irregular planes. Can I use glEvalMesh for the same to generate the surface part by part. Kindly let me know if anyone has the solution for the same.

martin_marinov
01-16-2001, 02:39 AM
can you be more specific and explain "a surface defined by
several irregular planes" and the terms "irregular planes" and "around"?

Rucha
01-16-2001, 03:08 AM
The Surface that I am trying to render is not a regular geometric surface.I have hand drawn 2d contours on several z-planes. I need to render the surface with regards to these contours to view the entire shape (irregular) in 3D. The surface rendered is to be represented by a mesh.

martin_marinov
01-16-2001, 08:08 AM
Hi
What I may suggest you is the following technique :
it asserts that your contours don't have self interesections
every contour is planar
the contours' planes are parallel (here parallel also to Oxy, which is not necessary)
The planes are sorted in z - order
So:
for every two successive planes make the mesh so:

1. create a mapping between your 2d contours - one way to do this is :
for every angle fi (fi in [0:2*pi], choose step s) find the intersection point of a line L in the first plane (incident with the origin of the local plane coordinate system, Angle(L, Ox) = fi) with the contour in the first plane
Do the same in the second plane.
Lets say the intersection points' pair are (Fk, Sk) ( for every angle fi)
(Fk in the first plane, Sk in the second)
So after that you will have a map between the two contours.

2. Draw the lines (Fk, Sk) for every fi . for every t (t in [0;1] , choose step s) take the plane parallel to Oxy
with Z = Zt = Zf + t(Zs - Zf) (where Zs, Zf are Z koordinates of the second and the first plane). Find the intersection points Pk of the plane and the segment (Fk, Sk) for every k - draw the strip contour {Pk} . Now you have a something like "contour morphing" http://www.opengl.org/discussion_boards/ubb/smile.gif) in the plane with Z = Zt;

repeat this until the last plane...

So - I have never tested or implemented the algorithm - It's only a suggestion. Try it at own risk http://www.opengl.org/discussion_boards/ubb/smile.gif Maybe it'll produce very "ugly" results,who knows http://www.opengl.org/discussion_boards/ubb/smile.gif . It's a product only of my experience with surface tessellation and geometrics.

Hope this helps
Martin