Hi all.

Im +working in a project where we are rendering objects on Center of Earth
(ECC) so we have a z-coordinate of 6.7E6Meters.
So obviously we need to transform objects close to origo to be able to
render them.

I noticed that I got quite a few anomalies in the rendering,
flickering/jumping objects.

This probably comes from that I do some custom OpenGL rendering in a
Drawable, where I update the bounding box of the drawable.

In this update of the bounding box, I have the large translation built in,
so the BoundingBox will contain the 6.7E6 coordinates and this obvious
affects the resolution of the float used everywhere in BoundingBox
calculations...


So I wanted to use double for this, but this caused quite a lot of problems
during build because its more or less hardcoded that Vec3f is default:

To avoid this, I would have to apply this translation above the Drawable,
instead of sending the matrix to my custom drawable (where I do
glMultMatrix()).
Now as this transformation is a result of a Physical simulation (in the ECC
coordinate space) its not that trivial to get to the result I want, it would
more or less require me to get the transformation for each simulated object
and multiply with the inverse before sending it to the rendering. This is of
course possible, but I was wondering if it would be possible to switch to
Vec3d implementation of Vec3 using for example a flag in CMake?

I guess all the Vec3Array etc, is still depending on Vec3f for OpenGL
compatibility so in theory it would be possible.
But in BoundingBox for example float is used explicitly for
getMin()/getMax() etc..

Here is the beginning of the list of compilation errors I got when I tried
to change Vec3 to Vec3d (in the Vec3 header file):


2>C:\projects\algoryx\agx_dependencies\OpenSceneGraph\include\osg/Array(458)
: error C2535: 'void osg::ValueVisitor::apply(osg::Vec3 &)' : member
function already defined or declared
2>
C:\projects\algoryx\agx_dependencies\OpenSceneGraph\include\osg/Array(444) :
see declaration of 'osg::ValueVisitor::apply'
2>C:\projects\algoryx\agx_dependencies\OpenSceneGraph\include\osg/Array(492)
: error C2535: 'void osg::ConstValueVisitor::apply(const osg::Vec3 &)' :
member function already defined or declared
2>
C:\projects\algoryx\agx_dependencies\OpenSceneGraph\include\osg/Array(480) :
see declaration of 'osg::ConstValueVisitor::apply'
2>C:\projects\algoryx\agx_dependencies\OpenSceneGraph\include\osg/BoundingBox(82)
: error C2440: 'return' : cannot convert from 'osg::Vec3d::value_type' to
'float &'
2>C:\projects\algoryx\agx_dependencies\OpenSceneGraph\include\osg/BoundingBox(85)
: error C2440: 'return' : cannot convert from 'osg::Vec3d::value_type' to
'float &'
2>C:\projects\algoryx\agx_dependencies\OpenSceneGraph\include\osg/BoundingBox(88)
: error C2440: 'return' : cannot convert from 'osg::Vec3d::value_type' to
'float &'
2>C:\projects\algoryx\agx_dependencies\OpenSceneGraph\include\osg/BoundingBox(91)
: error C2440: 'return' : cannot convert from 'osg::Vec3d::value_type' to
'float &'
2>C:\projects\algoryx\agx_dependencies\OpenSceneGraph\include\osg/BoundingBox(94)
: error C2440: 'return' : cannot convert from 'osg::Vec3d::value_type' to
'float &'
2>C:\projects\algoryx\agx_dependencies\OpenSceneGraph\include\osg/BoundingBox(97)
: error C2440: 'return' : cannot convert from 'osg::Vec3d::value_type' to
'float &'
2>C:\projects\algoryx\agx_dependencies\OpenSceneGraph\include\osg/Plane(222)
: error C2535: 'int osg::Plane::intersect(const std::vector<_Ty> &) const' :
member function already defined or declared
...



-- 


________________________________________________________________
Anders Backman               Email:    [EMAIL PROTECTED]
HPC2N/VRlab                  Phone:    +46 (0)90-786 9936
Umea university              Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN         Fax:      +46 90-786 6126

http://www.cs.umu.se/~andersb<http://www.cs.umu.se/%7Eandersb>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to