I believe you need to Invert the result to see vaules you are expecting
 
 
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/CameraControl
 

________________________________

From: osg-users-boun...@lists.openscenegraph.org on behalf of Kris Dale
Sent: Fri 8/21/2009 2:00 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Orienting a model (matrixtrans) toward a 
targetlocation?




Chris 'Xenon' Hanson wrote:
> Kris Dale wrote:
>
> > I've stepped through the calculations the source goes through and that's 
> > all coming out the same as I get when I do it by hand, I just don't 
> > understand where those are coming from.  Obviously the position vector is 
> > inverted (-100 instead of +) and for whatever reason it's not pointing at 
> > the target location...  man.. so confused..  I wish I had paid better 
> > attention in linear.  Hahaha.
> >
>
> The only thing that crosses my mind is that makeLookAt is typically used to 
> composed
> LookAt modelview matrices, not matrices for object positioning. Obviously the 
> code must
> work and be right, since it's used in OSG's positioning code in several 
> places. I'm
> wondering if this usage means there is some non-obvious requirements that 
> make it
> unsuitable for use as an object LookAt?
>
> --
> Chris 'Xenon' Hanson, omo sanza lettere                  Xenon AlphaPixel.com
> PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
> "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
> _______________________________________________
> osg-users mailing list
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>  ------------------
> Post generated by Mail2Forum


Even if that were the case, looking at just the raw numbers and nothing else, 
it's still producing incorrect output isn't it?  If I give it (0,0,100) for the 
eye position, shouldn't (0,0,100, 1) be the final row of the matrix rather than 
(0,0,-100, 1)?  And what about the direction vertices?

If osg::Matrix::makeLookAt doesn't work... it looks like I'm back to my 
original question of trying to figure out what the equations are to finding the 
correct vectors for x and z when I've already set the y vector to point at the 
the target position.  Curse graphics and their reliance on linear algebra!  
Then again, it's better than calculus I suppose.... ;)

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=16581#16581





_______________________________________________
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

Reply via email to