# Orthographic Camera Zoom to Mouse Position

**URL:** <https://discourse.threejs.org/t/orthographic-camera-zoom-to-mouse-position/13249>\
**Category:** Questions\
**Tags:** camera\
**Created:** [March 3, 2020, 11:47am UTC](https://discourse.threejs.org/t/orthographic-camera-zoom-to-mouse-position/13249 "2020-03-03T11:47:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DarkfireHellspawn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/darkfirehellspawn/32/7111_2.png) [@DarkfireHellspawn](https://discourse.threejs.org/u/DarkfireHellspawn)\
**Post date:** [March 3, 2020, 11:47am UTC](https://discourse.threejs.org/t/orthographic-camera-zoom-to-mouse-position/13249/1 "2020-03-03T11:47:45Z")

</div>

Hi,

I was wondering if anyone could help me figure out how to zoom to mouse position using an orthographic camera. I can’t get it quite right. It seems the position is off.

Sample here: [https://stackblitz.com/edit/three-orthographic-zoom-to-mouse](https://stackblitz.com/edit/three-orthographic-zoom-to-mouse)

Any help will be appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [March 3, 2020, 12:20pm UTC](https://discourse.threejs.org/t/orthographic-camera-zoom-to-mouse-position/13249/2 "2020-03-03T12:20:30Z")

</div>

Related:

> <https://github.com/mrdoob/three.js/pull/17145>

You might wanna use this code for your own project.

---

<div class="post-metadata">

**Author:** ![DarkfireHellspawn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/darkfirehellspawn/32/7111_2.png) [@DarkfireHellspawn](https://discourse.threejs.org/u/DarkfireHellspawn)\
**Post date:** [March 3, 2020, 1:22pm UTC](https://discourse.threejs.org/t/orthographic-camera-zoom-to-mouse-position/13249/3 "2020-03-03T13:22:28Z")

</div>

Thank for this.

I have an issue with this line: [https://github.com/mrdoob/three.js/blob/70294c4461c5b20d5fe23c01228a3b6769d8ae4c/examples/jsm/controls/OrbitControls.js#L623](https://github.com/mrdoob/three.js/blob/70294c4461c5b20d5fe23c01228a3b6769d8ae4c/examples/jsm/controls/OrbitControls.js#L623)

It seems that when the camera’s up is (0, 1, 0), v1 dot is 0, I don’t know why.
