# ArcRotateCamera always in the center of the mesh, but mesh on different positions on canvas

**URL:** <https://forum.babylonjs.com/t/arcrotatecamera-always-in-the-center-of-the-mesh-but-mesh-on-different-positions-on-canvas/6775>\
**Category:** Questions\
**Created:** [November 4, 2019, 1:47pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-always-in-the-center-of-the-mesh-but-mesh-on-different-positions-on-canvas/6775 "2019-11-04T13:47:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nogalo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nogalo/32/120_2.png) [@nogalo](https://forum.babylonjs.com/u/nogalo)\
**Post date:** [November 4, 2019, 1:47pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-always-in-the-center-of-the-mesh-but-mesh-on-different-positions-on-canvas/6775/1 "2019-11-04T13:47:08Z")

</div>

Hi.

So I am not sure is this possible. On the other hand it might be really simple but I cannot see it.

What I would like to achieve is this.

1. I want to have canvas element over the full screen height and width (so 100% both). OK got that

2. I want to be able to orbit around the mesh properly (so the target is in the center of the mesh) OK got that.

3. But I would like to be able to have mesh anywhere on the canvas (so anywhere on the screen, see image). But wherever it is I want rotations to behave the same way (so target is still in the center of the mesh, and I rotate around that mesh).

 ![Screenshot_1](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/7/781ce0033debc6993f27735f805c737a98124745.jpeg)

[https://playground.babylonjs.com/#L4BACB](https://playground.babylonjs.com/#L4BACB)

Thank you.

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [November 4, 2019, 2:10pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-always-in-the-center-of-the-mesh-but-mesh-on-different-positions-on-canvas/6775/2 "2019-11-04T14:10:40Z")

</div>

camera.target requires a Vector3 [ArcRotateCamera - Babylon.js Documentation](https://doc.babylonjs.com/api/classes/babylon.arcrotatecamera#target)

camera.lockedTarget requires a Vector3 or a mesh.  
[https://doc.babylonjs.com/api/classes/babylon.arcrotatecamera#lockedtarget](https://doc.babylonjs.com/api/classes/babylon.arcrotatecamera#lockedtarget)

Use  
camera.lockedTarget = box

---

<div class="post-metadata">

**Author:** ![nogalo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nogalo/32/120_2.png) [@nogalo](https://forum.babylonjs.com/u/nogalo)\
**Post date:** [November 4, 2019, 2:29pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-always-in-the-center-of-the-mesh-but-mesh-on-different-positions-on-canvas/6775/3 "2019-11-04T14:29:02Z")

</div>

Okay. Thank you. But that’s not my issue I believe.

As I said, I want to be able to move box around the whole canvas (change position), but whenever I click to rotate I want it to rotate as if target is in the center of the mesh.

At the moment, when I change position of the mesh, it still stays in the center of the screen (which is understandable of course), but I want it to be positioned let’s say all the way to the left of the canvas (screen)

---

<div class="post-metadata">

**Author:** ![nogalo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nogalo/32/120_2.png) [@nogalo](https://forum.babylonjs.com/u/nogalo)\
**Post date:** [November 4, 2019, 2:31pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-always-in-the-center-of-the-mesh-but-mesh-on-different-positions-on-canvas/6775/4 "2019-11-04T14:31:33Z")

</div>

If I for example, don’t lock target to the mesh.

[https://playground.babylonjs.com/#L4BACB#1](https://playground.babylonjs.com/#L4BACB#1)

So I want to move box to this position let’s say, but I want that rotation is around center of the mesh. Not offsetted like in the example above.

---

<div class="post-metadata">

**Author:** ![nogalo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nogalo/32/120_2.png) [@nogalo](https://forum.babylonjs.com/u/nogalo)\
**Post date:** [November 4, 2019, 2:36pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-always-in-the-center-of-the-mesh-but-mesh-on-different-positions-on-canvas/6775/5 "2019-11-04T14:36:10Z")

</div>

Oh, I just found this

camera.targetScreenOffset.

This is exactly what I needed.

[https://playground.babylonjs.com/#L4BACB#2](https://playground.babylonjs.com/#L4BACB#2)
