Hi Justin,

I have now checked in a better approach for determining the
orientation that avoids the singularity whilst provide far better
continuity in sideVector axis, the sideVector code now checked in to
SVN is:

       osg::Vec3d sideVectorLV = lookVector ^ cv->getLookVectorLocal();
       osg::Vec3d sideVectorUP = lookVector ^ cv->getUpLocal();

       osg::Vec3d sideVector = sideVectorLV.length() > sideVectorUP.length() ?
           sideVectorLV :
           sideVectorUP;

       sideVector.normalize();

This code computes the side vector based on the main cameras
lookvector and the upvector and then chooses the longest of the the
two.  When the overlay lookvector is closer to the main cameras look
vector then the sideVectorUP will be chosen safely avoiding any
singularity.  The cross over between the two happens at about 45
degrees and is a seamless hand over - the side vector doesn't ping to
a new orientation.

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

Reply via email to