[osg-users] Quaternion problem

Antonin Linares Antonin.Linares at onera.fr
Tue Mar 17 01:59:44 PDT 2009


Thanks Steven

Yes i have, but i get something very strange (rot * correction) == 
(correction * rot)
Also actually i made:

   //Set up alignment with terrain
   float rotation;
   osg::Vec3f origine;
   pat->getAtitude().getRotate(rotation, origine);

   if((osg::Vec3f(0,0,1)*normal) != 0){
      osg::Quat corect;
      corect.makeRotation(osg::Vec3f(0,0,1), normal);

      osg::Quat rot(rotation, osg::Vec3f(0,0,1));
      pat->setAtitude(rot * corect);   //Yes rot must be applied last
  }

Here the tank is well aligned with terrain, but now the rotation angle 
are increase each frame, so the tank rotate with.

Antonin  Linares


Steven Saunderson a écrit :
> Have you tried : pat->setAtitude(rot*corect); ?
> I'm wondering if the factor that should be applied last (i.e. rot) should be first in the multiply here.
>
> ------------------------
> -- Steven Saunderson
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=8557#8557
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>   




More information about the osg-users mailing list