[quote="Jason Daly"]Kris Dale wrote: > > I just read the man page for gluLookAt, and I think I get the problem. > Hopefully, I can describe the issue adequately :-) > > gluLookAt (and, by extension, osg::Matrix::makeLookAt), is designed to create > a ModelView matrix with the given parameters. If you know how OpenGL works, > you'll understand that a modelview matrix combines the modeling matrix (which > places objects in the world) with the view matrix (which places the world > with respect to the view). > > With this in mind, the resulting matrix makes perfect sense. Think of it this > way, instead of moving the viewpoint to (0, 0, 100), you keep the view at the > origin and move the world to (0, 0, -100). > > Does that help? > > To get what you're looking for, you might try inverting the result of > makeLookAt (not sure if this is the answer, but it could be). > > --"J" > > ------------------ > Post generated by Mail2Forum
That does actually help a bit. Running the matrix through invert didn't work but I'm slowly starting to get an understanding of might be required to achieve the result I'm looking for.. and it's a bit more than I originally anticipated. It turns out that I haven't entirely been asking the right questions, so it's been hard to get the right answers. In a way the answer is simple matrix math, though obviously enough as you've seen from me not THAT simple as it involves some linear algebra and I'm not a big fan... anywho, the thing I hadn't been considering is that not only do I have to come up with the y-vector (which I was using as the target vector), but as I realized from someone bringing up gluLookAt and it's osg relative, I need to know what my up-vector is going to be. Trying to go at this without an up-vector has been a major part of why I've been hitting such a deadlock. Earlier in this thread someone asked if the target was moving and I said that I would worry about animation later and that right now I was only worried about making the model face the target, and that I would worry about movement later. The idea was more that I would worry about animating the movement of the model from it's current orientation toward it's new target orientation later. The problem is, assuming the model can be positioned anywhere oriented in any direction in space, it occurs to me I think if I'm going to know what the up-vector for the model is going to be for the object at the time it points at the target-vector, I'm going to have to know it each step of the rotation toward it... And I hadn't considered how complicated this was going to be... ooo boy... Man this gets more complicated by the minute... -_- MY BRAIN HURTS (Monty Python reference anyone?) ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16588#16588 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

