[osg-users] problem with PolytopeIntersector and double

Peter Hrenka p.hrenka at science-computing.de
Tue Apr 5 02:58:48 PDT 2011


Hi Suneel,

Am 05.04.2011 02:26, schrieb suneel suresh:
> Hi,
> 
> i have point picking implemented which works fine when i store the data as 
> osg::Vec3Array and set it in the geometry as geometry->setVertexArray(vec3_vertArr)

This is not implemented (yet). The only supported
VertexArray format is Vec3, see include/osg/TemplatePrimitiveFunctor
and include/osg/TrianglePrimitiveFunctor.

Feel free to implement and submit it!

Up until very recently double precision
was not supported by OpenGL-Hardware
at all and therefore the broad use of
doubles has been discouraged in OSG.
Even if your hardware and drivers
support double precision you will still
suffer a very large performace penalty
(think a factor of 5 to 8 slower).

So you should still ask yourself if you
really need vertex arrays with double
precision. Transformation matrices
are handled with double precision
by OSG and there is database paging
for very large DataSets.


> But i choose to store it as a double, ie
> osg::Vec3dArray and set it in the geometry as geometry->setVertexArray(vec3d_vertArr)
> 
> then point picking fails using the same PolytopeIntersector.
> below is a the code for detecting the intersections
> 
> 
>[...]
>
> 
> Whats the solution?

Cheers,

Peter
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 





More information about the osg-users mailing list