When I rotate qx (move cursor on the x axis of the window) the camera do not rotate on the z axis of the camera, Dir is the direction of view camera.
glutMouseFunc(MouseCallback);
glutMotionFunc(MotionCallback);
MotionCallback(0, 0);
void Simulation::MouseCallback(int button, int state, int x, int y)
{
mx = x;
my = y;
}
void Simulation::MotionCallback(int x, int y)
{
int dx = mx - x;
int dy = my - y;
Dir.normalize();
N.cross(Dir,NxVec3(0,1,0));
NxQuat qx(NxPiF32 * dx * 20/ 180.0f, NxVec3(0,1,0));
qx.rotate(Dir);
NxQuat qy(NxPiF32 * dy * 20/ 180.0f, N);
qy.rotate(Dir);
mx = x;
my = y;
}