Hi Don & Antoine,

One trick I've used in the pass is to use the osgUtil::Tesselator to automatically convert GL_POLYGON primitives using the GLU teselator code inside osgUtil::Tesselator. 

There is also a osgUtil::Optimizer::TESSELATE_GEOMETRY option in the Optimizer for tesselating concave polygons.

Robert.

On 8/22/06, Don Burns <[EMAIL PROTECTED]> wrote:
Hi Antione,

I've looked closely at your data file,  the osg Shape loader and the ShapeFile spec and I believe it all to be working correctly.

First, with respect to coordinate windings.  The Spec does not specify a parameter that indicates which way to order the polygons.  Consequently, the Shape loader simply reads them in in the order that they arrive from the datafile and passes them to osg::Geometry this way.  OpenGL honors counter clockwise winding of coordinates to indicate front faces for convex faces.  I didn't find anything in the SHapefile spec that indicated otherwise, but if, indeed, it is there, then we should flip a flag in the Shape loader.

Second, your file contains a shape of type "Polygon", which we interpret directly as an osg::Geometry::POLYGON, or an OpenGL GL_POLYGON.  How this is implemented under the hood is up to the driver.  In this case, it seems that GL_POLYGON is implemented as a triangle fan, which, indeed, is problematic for non-convex shapes. 

The right approach here is probably to use GLU for building non-convex polygons.  I'll experiment with this a bit and see if Ican improve on it.

-don

On 8/21/06, Antoine Hue < [EMAIL PROTECTED]> wrote:
Don Burns wrote:
> HI Antoine,
>
> The ESRI SHape file loader has been added as part of an SBIR project
> funded by the Air Force for doing terrain deformation software based
> on target position.  More information is here:
> http://www.andesengineering.com/Projects/TDS/
>
> According to the spec, terrain files will use OpenFlight and targets
> will use ESRI shape files.  This required the addition of the shape
> loader to OSG as it hadn't previously existed.
>
Hi Don,

Thank you for the answer. In the related software, were you using a
scene graph geode as target?

I have tried the loader on a shape file with country boundaries and it
is flipped upside down: top face is culled as on image below but also,
the boundaries are not represented as polyline but fans which is
problematic for concave countries like Italy. Note, all of this may come
from my datafile.

Antoine




_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to