Re: [osg-users] NodeTrackerManipulator precision ( [Was] Math problem relative to OSG)

2008-12-05 Thread Robert Osfield
Hi Vincent,

The Quat is stored as doubles, as should the rest of the internal
variables in NodeTracker.

Which version of the OSG are you using?  Older versions didn't use double maths.

Robert.

On Fri, Dec 5, 2008 at 10:51 AM, Vincent Bourdier
[EMAIL PROTECTED] wrote:
 Hi,

 Using a nodeTrackerManipulator to make some tests, I think I get some bug in
 precision...

 I set the tracked node with a PAT.

 Each frame, this PAT is modified with two Quat and one translation.
 Each Quat one is a different rotation... they are added (Q = q1 * q2) and
 applied to the PAT.

 The nodeTracker seems to have a precision problem... the camera do not stay
 motionless relative to the PAT... a little relative translation is visible,
 when running more than 10s.

 So,
 Is the Quat accumulation responsible of that ? is there really a lack of
 precision in the manipulator ?

 Sorry I have no enough time to make a example to show that... but I think
 you can try easily.

 Thanks.

 Regards,
 Vincent.



 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] NodeTrackerManipulator precision ( [Was] Math problem relative to OSG)

2008-12-05 Thread Jean-Sébastien Guay

Hi Vincent,

When I set the PAT as Tracked node... is PAT is rotated and 
translated... camera do not follow it...


Does your PAT have geometry under it? Or is it just a PAT in space 
without any children?


We had a problem like that before, where if a transform (for us it was 
an osgSim::DOFTransform) had no geometry under it, it could not be 
followed by a NodeTrackerManipulator. The reason is that the NTM uses 
the node's bounds to calculate where it should track, and a Transform 
without anything under it has invalid bounds (a default-constructed 
bounding sphere with radius = -1).


What we did to fix it is to add a ComputeBoundingSphereCallback to the 
transform, which returns a bounding sphere of center = 
(transform.translation) and radius = 0.1. That makes the NTM behave 
properly.


Not sure if that's your problem. If it isn't then I don't know, your 
code looks good. If you send me a complete example (perhaps a modified 
osgviewer.cpp with your code) I could have a look.


J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] NodeTrackerManipulator precision ( [Was] Math problem relative to OSG)

2008-12-05 Thread Vincent Bourdier
Hi,

It is not a PAT children problem...

I'll have a look one day on reproducing the problem... but for now it is not
a priority.

Thanks for your help, and thanks a lot to everyone here, I've been very
intrusive this week, sorry for that.

Regards,
Vincent.

2008/12/5 Jean-Sébastien Guay [EMAIL PROTECTED]

 Hi Vincent,

  When I set the PAT as Tracked node... is PAT is rotated and translated...
 camera do not follow it...


 Does your PAT have geometry under it? Or is it just a PAT in space without
 any children?

 We had a problem like that before, where if a transform (for us it was an
 osgSim::DOFTransform) had no geometry under it, it could not be followed by
 a NodeTrackerManipulator. The reason is that the NTM uses the node's bounds
 to calculate where it should track, and a Transform without anything under
 it has invalid bounds (a default-constructed bounding sphere with radius =
 -1).

 What we did to fix it is to add a ComputeBoundingSphereCallback to the
 transform, which returns a bounding sphere of center =
 (transform.translation) and radius = 0.1. That makes the NTM behave
 properly.

 Not sure if that's your problem. If it isn't then I don't know, your code
 looks good. If you send me a complete example (perhaps a modified
 osgviewer.cpp with your code) I could have a look.

 J-S
 --
 __
 Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org