   camera translation issues
  right, i had a directx engine where my camera matrix was as simple as going:rotate using the cameras rotations,then translate...this would then make z always point down the view vector, and translate according to that.now im making a camera class for GL, the rotations work fine, my camera can look around fine with mouse, but the translation doesnt work? any ideas whats goin on? 
  how are you managing your camera and doing translations? usually translations should always happen along the rotated axes (just dont try something like translate(cam.right.x, cam.right.y, cam.right.z).. ;void Camera::SetView( GLdouble planex, GLdouble planey, GLdouble planez,  GLdouble yaw, GLdouble pitch, GLdouble roll ){glMatrixMode( GL_MODELVIEW );glLoadIdentity();glRotated(roll, 0.0, 0.0, 1.0);glRotated(pitch, 1.0, 0.0, 0.0);glRotated(yaw, 0.0, 1.0, 0.0);glTranslated( -planex, -planey, -planez );}^ this code should... 1 rotate the axis of my camera, then translate along that axis, such that z is always along the view....as opposed to translating first...but GL is different... doesnt have a view matrix like directx, so im a bit lost pressing W for example, will change planex only! [edited by - supagu on February 9, 2004 7:30:07 AM];  hm, maybe im missing the point. after rotating translate(0,0,x) will move you back/forward etc.. the thing that might confuse you is that object transformations and view transformation are both stored in the modelview, as its the same thing. if you move your camera into place with rotate and translate calls you will have to read it back, invert it and send it back (so its better to store the matrix in your camera class, apply all transformations to that and invert it once per frame to set up the view).also: what do you mean with "rotate the axis of my camera". it has more than one and if you talk about the view direction then your translation will _not_ be along that direction unless planex and planey are 0 *confused* ;  OGL having no view matrix confuses me if i can manage to get a vector pointing the way my rotations should go, i should be able to use the vector to translate my world. ;  Well, having written a GL camera class, here''s my advice:Store 3 vectors: Your camera''s location (call it a point, if you will, but everything in 3d is vector), your Look vector (the direction you''re looking), and your Up vector (the direction that points "up" from the camera).If you''re unfamiliar with vectors and camera classes, check out GameTutorial.com''s OpenGL tutorials. They have a good basic camera class that they build there. And if you want to learn more about the vector math in rotations, check out Paul Bourke''s Geometry webpage. Neat place for everything you ever wanted to know about geometry. Ever.And if you _really_ want to get fancy, look into Quaternions. Very cool way to store rotations. Sorry, no links to resources for this one--- I dug it up in my own math book and haven''t been out on the web looking for good places to learn more.Hope it helps.  "Remember:  Silly is a state of Mind, Stupid is a way of Life." -- Dave Butler;quote:Original post by supagu  OGL having no view matrix confuses me if i can manage to get a vector pointing the way my rotations should go, i should be able to use the vector to translate my world.   the reason it doesnt is that you dont need it. you set your modelVIEW matrix to the view matrix before anything else and go from there. and as its just the inverse of the cameras transformation and moving everything else the other way its the perfect place for it.