# Flip between PerspectiveCamera & OrthographicCamera gets wrong rotation

**URL:** <https://discourse.threejs.org/t/flip-between-perspectivecamera-orthographiccamera-gets-wrong-rotation/61120>\
**Category:** Questions\
**Tags:** controls, camera\
**Created:** [February 5, 2024, 9:15am UTC](https://discourse.threejs.org/t/flip-between-perspectivecamera-orthographiccamera-gets-wrong-rotation/61120 "2024-02-05T09:15:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cggc](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@cggc](https://discourse.threejs.org/u/cggc)\
**Post date:** [February 5, 2024, 9:15am UTC](https://discourse.threejs.org/t/flip-between-perspectivecamera-orthographiccamera-gets-wrong-rotation/61120/1 "2024-02-05T09:15:14Z")

</div>

The code:

```js
function to_Orthographic() {
	console.log("to_Orthographic before camera rotate", camera.rotation);
	var lookAt = get_lookup(camera);
	var factor = calc_zoom(obj);

	orthographicCamera = new THREE.OrthographicCamera( width / -factor, width / factor, height / factor, height / -factor, 0.1, 1000 );
	orthographicCamera.position.copy(camera.position);
	orthographicCamera.rotation.copy(camera.rotation);

	camera = orthographicCamera;
	controls = new ArcballControls(camera, renderer.domElement);
}

function to_Perspective() {

	prespectiveCamera = new THREE.PerspectiveCamera( 45, width / height, 0.1, 1000 );
	prespectiveCamera.position.copy(camera.position);
	prespectiveCamera.rotation.copy(camera.rotation);

	camera = prespectiveCamera;
	controls = new ArcballControls(camera, renderer.domElement);]
}

.....
var controller = new function() {

   this.Perspective = function () {
		to_Perspective();
		
   };
   this.Orthographic = function () {
		to_Orthographic();
   }
	   
}
var gui = new GUI();
gui.add(controller, 'Perspective');
gui.add(controller, 'Orthographic');

```

---

<div class="post-metadata">

**Author:** ![schwyzl](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/schwyzl/32/20693_2.png) [@schwyzl](https://discourse.threejs.org/u/schwyzl)\
**Post date:** [February 5, 2024, 11:29am UTC](https://discourse.threejs.org/t/flip-between-perspectivecamera-orthographiccamera-gets-wrong-rotation/61120/2 "2024-02-05T11:29:46Z")

</div>

You probably want to copy the quaternion, not the rotation.

You are making a new camera and controller each time you switch. Might be better storing both cameras and having a `currentCamera` member/variable that you use to toggle.
