Move the position of perspective camera vertically?

Hi all,

I have a perspective camera, and this is how I set the position of it on the y-axis
camera.position.y = somevalue
however, what I want is to move the camera more to the top (moving it up), whereas this didn’t help me achieve this.

Any thoughts?? any help will be greatly appreciated.

Thanks :slight_smile:

I think you might be looking for one of the translate functions.

Try this:

camera.translateY(1). This will move the camera vertically by one unit.

Docs here: https://threejs.org/docs/#api/en/core/Object3D.translateY

1 Like

I tried this and it didn’t work. :confused:

camera = new THREE.PerspectiveCamera(50, window.innerWidth/window.innerHeight, 1, 1000);

camera.position.x = 5.3257092875456715
camera.position.y =  1.7203243295945108
camera.position.z = 5.867643930449958
cameraCenter.x = camera.position.x;
cameraCenter.y = camera.position.y;
camera.aspect = 2.0678513731825525
camera.zoom = 1.41;
camera.translateY(9.0)
camera.updateProjectionMatrix();

Any thoughts? :smiley:

Maybe you forgot to update the camera target ?
camera.lookAt( x, y, z )

1 Like