PointerLockControls in XY ground Z vertical world

hello ,
ive tried PointerLockControls.js in XZ ground Y vertical world , it is working very well . But if i want to work in a XY ground world + Z vertical , it doesn’t work like i does wish . Ive read PointerLockControls.js and i ve seen there is no rotation around Z in onMouseMove so i don’t understand how the camera stay horizontal after an Y rotation + X rotation .

i ve tried too an
camera.up = new THREE.Vector3(0,0,1);
camera.lookAt(0,0,0);
with the idea if camera start horizontal , it will stay horizontal with Y rotation + X rotation . But dont work

so my question is : can i set PointerLockControls to work in XY ground Z vertical world . thank.

if i’am right there is an XYZ axis which are bound to camera ,and if i look the screen , X is on the left , y on the bottom , z in the back ? so if want to turn camera to the left i ve to set a negative rotation around Y . if i want to turn to down i ve to set a positive rotation around X . so something like that
euler.y += movementX * 0.002;
euler.x -= movementY * 0.002;

but in PointerLockControls.js it is like this
euler.y -= movementX * 0.002;
euler.x -= movementY * 0.002;

i dont understand

ok i ve found a part of solution .

euler is absolute …so i have to turn camera around Z first , and after X so
in PointerLockControls i change
var euler = new THREE.Euler( 0, 0, 0, ‘YXZ’ );
to
var euler = new THREE.Euler( 0, 0, 0, ‘ZXY’ );

and in onMouseMove i change
euler.y - = movementX * 0.002;
euler.x -= movementY * 0.002;

to

euler.z -= movementX * 0.002;
euler.x -= movementY * 0.002;

work fine . now i ve just a problem with limit of euler.x
euler.x = Math.max( PI_2-scope.maxPolarAngle, Math.min( PI_2-scope.minPolarAngle, euler.x ) );

ok i ve solves myy problem in PointerLockControls.js

i ve replaced
var euler = new THREE.Euler( 0, 0, 0, ‘YXZ’ );
by
var euler = new THREE.Euler( 0, 0, 0, ‘ZXY’ );

and in onMouse Move i ve replaced
euler.y -= movementX * 0.002;
euler.x -= movementY * 0.002;

	euler.x = Math.max( PI_2 - scope.maxPolarAngle, Math.min( PI_2 - scope.minPolarAngle, euler.x ) );

by
if( euler.y<=0.01 && euler.y>=-0.01){
euler.z -= movementX * 0.002;
euler.x -= movementY * 0.002;
if (euler.x < 0) { euler.x=0;}
if (euler.x > PI_2) { euler.x=euler.x-0.01; euler.y=Math.PI; euler.z=euler.z-Math.PI; }
}
else { euler.z -= movementX * 0.002;
euler.x += movementY * 0.002;
if(euler.x<0) {euler.x=0; }
if (euler.x > PI_2) { euler.x=euler.x-0.01;euler.y=0;euler.z=euler.z-Math.PI; }
}

work fine now

add: i ve forgetten to notice . cause vec.crossVectors( camera.up, vec ) in moveForward function , i have to set
camera.up=new THREE.Vector3(0,0,1)