# How can I retrieve the exact coordinate I clicked on a rotated object

**URL:** <https://discourse.threejs.org/t/how-can-i-retrieve-the-exact-coordinate-i-clicked-on-a-rotated-object/41718>\
**Category:** Questions\
**Tags:** mouse-controls, geometry\
**Created:** [August 22, 2022, 2:23pm UTC](https://discourse.threejs.org/t/how-can-i-retrieve-the-exact-coordinate-i-clicked-on-a-rotated-object/41718 "2022-08-22T14:23:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JSmithOner](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jsmithoner/32/21349_2.png) [@JSmithOner](https://discourse.threejs.org/u/JSmithOner)\
**Post date:** [August 22, 2022, 2:23pm UTC](https://discourse.threejs.org/t/how-can-i-retrieve-the-exact-coordinate-i-clicked-on-a-rotated-object/41718/1 "2022-08-22T14:23:55Z")

</div>

I’ve created this [Stackoverflow Post](https://stackoverflow.com/questions/73439578/calculate-destination-point-on-mouse-click-for-rotated-plane-with-three-js). With [this video](https://drive.google.com/file/d/1k7OvQFdNtRH_7V7gbBLyUWZ4ULJzPlCf/view?usp=sharing).

Basically my problem is that if an object is not rotated when I click on it I get easily the coordinates of the postion clicked on the object. Let’s say my object ( a rectangle ) is 200\*100 then with a simple calculation I can say I’ve clicked on the point ( 10,10 ) of it by making a substraction of the mouse by the object position.

Now if I rotate the object this calculation no longer works.

Do you know how I could perform that?

Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![prisoner849](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prisoner849/32/535_2.png) [@prisoner849](https://discourse.threejs.org/u/prisoner849)\
**Post date:** [August 22, 2022, 2:31pm UTC](https://discourse.threejs.org/t/how-can-i-retrieve-the-exact-coordinate-i-clicked-on-a-rotated-object/41718/2 "2022-08-22T14:31:33Z")

</div>

Hi!  
Do you use `THREE.Raycaster()`?

---

<div class="post-metadata">

**Author:** ![JSmithOner](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jsmithoner/32/21349_2.png) [@JSmithOner](https://discourse.threejs.org/u/JSmithOner)\
**Post date:** [August 22, 2022, 2:36pm UTC](https://discourse.threejs.org/t/how-can-i-retrieve-the-exact-coordinate-i-clicked-on-a-rotated-object/41718/3 "2022-08-22T14:36:08Z")

</div>

Yes on a certain level of my project but I guess I can’t use it in my case. I don’t need to know which object I’ve been clicking on but more which coordinate I’m clicking on the object plane. I would prefer using my own calculation but if you tell me raycaster can do this I’ll look into it a bit more.

---

<div class="post-metadata">

**Author:** ![prisoner849](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prisoner849/32/535_2.png) [@prisoner849](https://discourse.threejs.org/u/prisoner849)\
**Post date:** [August 22, 2022, 2:44pm UTC](https://discourse.threejs.org/t/how-can-i-retrieve-the-exact-coordinate-i-clicked-on-a-rotated-object/41718/4 "2022-08-22T14:44:52Z")

</div>

There are several examples with the using of Raycaster: [three.js examples](https://threejs.org/examples/?q=interactive#webgl_interactive_buffergeometry)  
When you get an array of intersected objects, calling [`.intersectObject( your_plane_mesh )`](https://threejs.org/docs/index.html#api/en/core/Raycaster.intersectObject), the items of the array are objects contain the property “point”, which is a point of intersection in global space coordinates. To cast this point into the local space of the plane, use `your_plane_mesh.worldToLocal( point_of_intersection )`.

---

<div class="post-metadata">

**Author:** ![JSmithOner](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jsmithoner/32/21349_2.png) [@JSmithOner](https://discourse.threejs.org/u/JSmithOner)\
**Post date:** [August 22, 2022, 2:47pm UTC](https://discourse.threejs.org/t/how-can-i-retrieve-the-exact-coordinate-i-clicked-on-a-rotated-object/41718/5 "2022-08-22T14:47:15Z")

</div>

ok many thanks I’ll try resolving my issue with this and get back to you If this doesn’t fit my needs.

Best
