   How to save camera correctly
  i know how to rotate the view, but i have a problem: i want to design a camera that only rotates when the user presses a mouse button and stops rotation if he releases the button...after releasing the button i have to store the current view matrix/world matrix whatever...how can i do this...till now it works, but not correct...i save the view matrix after releasing the mousebutton and when pressing the mousebutton again this is the new initial view matrix...but with this method its impossible to rotate back to the origin (i have a cube in the scene at the origin...my camera is  at 0,0,10 pointing down the z-axis to the origin...when i rotate the view for the first time, everything works...but when i rotate the view to one of the corners, release the button and then try to rotate the view back to the center, the cube is rotated to along the z-axis)p.s. only yaw and pitch should be possible, no roll... 
  It sounds like you are experiencing gimbal lock.  Lots of games have it - counter-strike, for instance.  If you look up at the sky and try to turn, you just spin around.One popular way to avoid gimbal lock is using things called quaternions.  They are basically homogenous expressions of rotations in 3D, but the math is sort of complicated.  I think there are a couple articles on gamedev about them, and certainly more on google.HTH ;  Yea, you should try quaternions.  Try searching this forum for ''quaternion camera'' (you should get hundreds of results), take a look at any of the articles here or on other sites, or you can look at the camera system in the Cull example included with the SDK.  The function that you will probably want to look at there is UpdateCamera().   Dustin Franklin   Mircrosoft DirectX MVP ;  When using quaternions to store orientation information, be warned that gimbal lock occurs as long as you''re using euler angles.  If you''re converting from euler angles to quaternions, you''re still going to get gimbal lock problems. ;  ok, thanks for the quick response...i''ll try it with quaternions instead of euler angles.... 