# How to set EXACT same camera position like before using OrbitControls

**URL:** <https://discourse.threejs.org/t/how-to-set-exact-same-camera-position-like-before-using-orbitcontrols/54578>\
**Category:** Questions\
**Tags:** orbit-controls, camera\
**Created:** [August 2, 2023, 11:48pm UTC](https://discourse.threejs.org/t/how-to-set-exact-same-camera-position-like-before-using-orbitcontrols/54578 "2023-08-02T23:48:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justusik](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@Justusik](https://discourse.threejs.org/u/Justusik)\
**Post date:** [August 2, 2023, 11:48pm UTC](https://discourse.threejs.org/t/how-to-set-exact-same-camera-position-like-before-using-orbitcontrols/54578/1 "2023-08-02T23:48:53Z")

</div>

Hello. I want to rotate a camera around model, but only on X axis. I tried to do it by using OrbitControls, but something is wrong. After using OrbitControls my camera looked at different place. I’ve found that changing controls.target is what i needed to do. And here is my problem. I literally can’t set it to make it look good! How can i set controls and camera to have exact same view like camera before using OrbitControls?

Before using OrbitControls:  
 ![Before](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/8/d/8d1a5733c421b87848fb86a445e8dc44cccdff9f.png)  
After using OrbitControls:  
 ![Screenshot - Godzina (01-47-43), Data (2023-08-03)](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/1/3/137cd1e4a34865b719868416a3c49b10e21097a1.png)

Here is my code:

```javascript
  //Camera
  const camera = new THREE.PerspectiveCamera(45, 390 / 844, 0.1, 100)
  camera.position.set(0, 2.8, 5.5)
  scene.add(camera)
//Renderer
  const renderer = new THREE.WebGLRenderer({
    canvas: canvas.value,
    alpha: true,
    antialias: true,
  })
  renderer.setPixelRatio(window.devicePixelRatio)
  renderer.setSize(350, 250)
//Controls
  const controls = new OrbitControls(camera, renderer.domElement)
  controls.enableDamping = true
  controls.enableZoom = false;
  controls.minPolarAngle = Math.PI/4;
  controls.maxPolarAngle = Math.PI/4;
//Animate loop
  function animate() {
    requestAnimationFrame(animate);
    if (globalGltf) {
      globalGltf.rotation.y -= 0.005
    }
    renderer.render(scene, camera)
  }

  animate();

```

---

<div class="post-metadata">

**Author:** ![PavelBoytchev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pavelboytchev/32/38639_2.png) [@PavelBoytchev](https://discourse.threejs.org/u/PavelBoytchev)\
**Post date:** [August 3, 2023, 4:45am UTC](https://discourse.threejs.org/t/how-to-set-exact-same-camera-position-like-before-using-orbitcontrols/54578/2 "2023-08-03T04:45:13Z")

</div>

Is this similar to what you want to achieve (rotate the scene to see the effect):  
[Smoothly resetting camera angle with OrbitControls](https://codepen.io/boytchev/pen/BaGppmJ)
