[quote="Chris 'Xenon' Hanson"]Tony Horrobin wrote: > Hi Kris, > Is the target moving too? > Cheers, >
Not at the moment. Currently I'm only worried about figuring out how to orient in the right direction, I'll worry about tracking at a later time. =) Chris 'Xenon' Hanson wrote: > Thrall, Bryan wrote: > > > There's osg::Matrix::makeLookAt() > > > > Wow. if only that were named something intuitive that I would have thought to > look for. > Or Look At, as the case may be. ;) > > Does that answer your question, Kris? > > -- > 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 Sort of.. that definitely looks like it's going to be what I need, but I can't seem to get it implemented properly. I've tried it this way: Code: osg::MatrixTransform* pMatTrans = dynamic_cast<osg::MatrixTransform*>(node); osg::Matrix m = pMatTrans->getMatrix(); osg::Vec3d v = osg::Vec3d( m(3,0) , m(3,1) , m(3,2) ); // save the location for the eye point // if I understand right, the vectors in order are: eye point, lookat point, up vector, right? m.makeLookAt( v, osg::Vec3d(0.0, 0.0, 0.0), osg::Vec3d(0.0, 0.0, 1.0) ); pMatTrans->setMatrix( m ); When I run the code with this lookat call, the model is translated across the XY plane and doesn't remotely look toward 0,0,0... Prior to lookat the getMatrix call the model's getmatrix result is: Code: Stars between numbers for ease of reading... someone really needs to make up a matrix forum manipulator! =P ____________________________________ | 1.65951e-16 * 1 * 0 * 0 | | -2.47158e-15 * -3.85743e-31 * 1 * 0 | | 1 * -1.65951e-16 * -2.81642e-16 * 0 | | -6366.2 * 3182.6 * 3193.6 * 1 | ____________________________________ After calling makeLookAt the matrix is: Code: ____________________________________ | -0.447157 * 0.366172 * -0.816069 * 0 | | -0.894455 * -0.183057 * 0.40797 * 0 | | 0 * 0.912364 * 0.40938 * 0 | | -1.26565e-13 * 3.71925e-13 * -7801.06 * 1 | ____________________________________ I assume I'm simply calling something wrong somewhere... can someone point me in the right direction?[/code] ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16567#16567 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

