Hi,

I did some experiments today.

While the FBX/DAE plugin is indeed able to read/write data in double
precision, rendering them with OSG outputs the dreaded warning message
about TriangleFunctor not supporting Vec3d* vertex arrays.

In fact, the osgDB::Options::PrecisionHint is only used by the FBX/DAE
plugin to either create a Vec3Array or a Vec3dArray to attach to the
osg::Geometry::_vertexArray member variable, nothing more. And in the
case osgDB::Options::PrecisionHint has DOUBLE_PRECISION_VERTEX bit,
you'll hit the TriangleFunctor warning above, as my custom
reader/writer...

     Émeric


2014-10-30 21:30 GMT+01:00 Émeric MASCHINO <[email protected]>:
> Robert,
>
> I think I get your point, but just to be sure.
>
> Dealing with double precision data involves:
> - the native data (double precision), stored in an osg::Vec3dArray,
> attached to an osg::Geometry object,
> - the data reduced to floats, stored in the _vertexArray member
> variable of the osg::Geometry object for rendering,
> - attaching the osg::Geode to an osg::MatrixTransform (double
> precision), so that both the double precision data in the
> osg::Vec3dArray and the simple precision data in
> osg::Geometry::_vertexArray are affected by the same transformation
> matrix.
>
> Did I understand correctly?
>
>      Émeric
>
>
>
> 2014-10-30 18:35 GMT+01:00 Émeric MASCHINO <[email protected]>:
>> Hi Robert,
>>
>>> For instance for GIS whole world databases the usual way to manage things is
>>> to load the data in doubles then transform to a local origin and reduce any
>>> vertex data from doubles to floats in the process and store this data in
>>> straight osg::Vec3Array in an osg::Geometry.  You then place the object in
>>> the correct world space by decorating the subgraph with a Transform
>>> (typically a MatrixTransform) that places the local origin in it's correct
>>> world position and orientation.
>>
>> So data are duplicated? There's the original dataset in double
>> precision and a transformed one in single precision?
>>
>>> If you look at osgEarth and
>>> VirtualPlanetBuilder this is how they manage whole earth databases,
>>> maintaining floats where OpenGL hardware requires it, but using double
>>> MatrixTransforms and the use of double ModelView Matrices in the OSG cull
>>> traversal that ensures maintenance of precision as long as possible before
>>> one finally has to copy the data to OpenGL.
>>
>> Thanks for the pointer.
>>
>> Unfortunately, osgEarth is such a huge beast to reverse-engineer! And
>> their Coordinates Systems git page [1] isn't that much informative
>> about the implemented architecture in this regard.
>>
>> I was wondering, since both the FBX/DAE plugin is able to handle
>> double precision data, isn't there a -maybe- similar mechanism in
>> straight OSG that allows for rendering a FBX/DAE mesh? Or is the
>> double to float reduction internally handled by the plugin?
>>
>>      Émeric
>>
>> [1] 
>> https://github.com/gwaldron/osgearth/blob/master/docs/source/developer/coordinate_systems.rst
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to