Polygon Rasterization / Triangulation

I have some fluid dynamic data which I am displaying as surfaces. Essentially I have a series of Streamlines which can be considered to form a stream tube.

Each line has an indeterminate but roughly similar number of points and is roughly similar in length The spacing between streamlines is very small compared to the streamline length.

For example streamline 1: 630 points from X = 0 to x =8.0 and streamline 2: 490 points from X = 0.02 to X = 8.0. Distance between streamlines around 0.01

I have used polygons, adding points going “downstream” along one streamline and then “upstream” on the adjacent streamline.

This seems to give sensible results until I start using light shading.

When opengl rasterizes a polygon does it divide it into triangles internally? (this seems to be implied by the spec) It almost looks like I am getting a set of triangle fans anchored at two opposite endpoints based on the reflected light.

Is there a way to control the polygon rasterization or do I need to massage my data so I can use triangle strips? Would tessellation work on this type of data?

Any insight is appreciated.


  • Andy R

Hmm, I’d suggest you take a look at the order you’re passing the polygon points to OpenGL. F.e, if you pass some polygon vertices in a clock wise manner and the next ones in a counter-clock wise manner, the automatically computed normals would point into just opposite directions, thus affecting the light computations. Check carefully the specs (http://www.eecs.tulane.edu/www/Terry/OpenGL/Primitives.html)

And polygons have to be planar. If not, the result are undefined. I think that HW treats polygons as a triangle fan and render that. You might get better results when you render triangles between the stream lines…