   Camera Behavior
  Hi, I have setup my view in open scene graph as view->getCamera()->setViewMatrixAsLookAt(eye, center, up); eye, center and up are osg::Vec3 elements. I have my eye and up as constant. When I change my center vector, the Camera's position is changing! Can anyone explain why? Shouldn't the camera's position (X,Y,Z) be fixed if the eye vector is constant? Thank you!    
  I'm assuming that internally it's calling gluLookAt or whatever.In that case:eye: the point at which the camera is lookingcenter: the position of the cameraup: the up vector of the camera.so sounds like it's working correctly-me   ;Quote:Original post by PalidineI'm assuming that internally it's calling gluLookAt or whatever.In that case:eye: the point at which the camera is lookingcenter: the position of the cameraup: the up vector of the camera.so sounds like it's working correctly-meThat's give me a totally weird result. I believe I am correct with the eye, center, up convention where eye represents the camera's position. ;Quote:That's give me a totally weird result. I believe I am correct with the eye, center, up convention where eye represents the camera's position.I Googled a little, and it does look like 'eye' is the camera position and 'center' is the target position (assuming the references I found were correct). If you're finding that the camera position appears to change even when 'eye' remains constant, then I would say that something is probably wrong elsewhere in the code.   ;Quote:Original post by jykQuote:That's give me a totally weird result. I believe I am correct with the eye, center, up convention where eye represents the camera's position.I Googled a little, and it does look like 'eye' is the camera position and 'center' is the target position (assuming the references I found were correct). If you're finding that the camera position appears to change even when 'eye' remains constant, then I would say that something is probably wrong elsewhere in the code.I cannot find any mistakes in my code elsewhere.I am using the following code:viewTwo->getCamera()->setViewMatrix(osg::Matrix::lookAt(osg::Vec3(XCoordinate,YCoordinate,ZCoordinate), osg::Vec3(XCoordinate - 500*sin(Yaw*3.14159/180),YCoordinate + 500*cos(Yaw*3.14159/180),ZCoordinate), osg::Vec3(0,0,1)));And only the Yaw changes in my animation loop with XCordinate, YCoordinate and ZCoordinate being constant. And yet I find my "eye" moving its position!;  Hm, I don't see anything obviously wrong there.Are you certain that the camera position doesn't change? Maybe you could print out the coordinates, just to be sure.What other objects are in the scene? Could it be an illusion caused by the motion of other objects?   ;  I don't think it is an illusion or anything.What is happening is that the eye instead of being fixed at say (X1,Y1,Z1) is revolving around that point in a small circle while pointing to the correct center!   ;  What else is in the scene besides the camera? Is it a complex environment? Or just a few other objects?   ;  It almost sounds like you're performing a translation followed by a rotation... which should be impossible if you're just using built in OpenGL functions. Are you manually applying transformations? If so, are you sure you're performing them in the right order?   ;  Have you seen this site?  If not it might help:http://www.opengl.org/resources/faq/technical/viewing.htmParticularly, notice the part where it talks about: How do I make the camera "orbit" around a point in my scene.If you check out the page, esp that example, you might notice you are doing what it talks about, or you might find the way to do what you want.Hope it helps!   