# 2d camera in processing

**URL:** <https://discourse.processing.org/t/2d-camera-in-processing/33659>\
**Category:** Project Guidance\
**Created:** [November 22, 2021, 2:15am UTC](https://discourse.processing.org/t/2d-camera-in-processing/33659 "2021-11-22T02:15:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SNICKRS](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@SNICKRS](https://discourse.processing.org/u/SNICKRS)\
**Post date:** [November 22, 2021, 2:15am UTC](https://discourse.processing.org/t/2d-camera-in-processing/33659/1 "2021-11-22T02:15:11Z")

</div>

Hello everyone, I need help making a 2d camera for a game I’ve been making. I want to be able to rotate an image to point towards the mouse or “looking”. Unfortunately, I have no idea how to go about this.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 23, 2021, 12:05am UTC](https://discourse.processing.org/t/2d-camera-in-processing/33659/2 "2021-11-23T00:05:33Z")

</div>

> **[Arctangent / Examples](https://processing.org/examples/arctangent.html)**
>
> Move the mouse to change the direction of the eyes. The atan2() function computes the angle from each eye to the cursor.

---

<div class="post-metadata">

**Author:** ![SNICKRS](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@SNICKRS](https://discourse.processing.org/u/SNICKRS)\
**Post date:** [November 23, 2021, 1:50am UTC](https://discourse.processing.org/t/2d-camera-in-processing/33659/3 "2021-11-23T01:50:48Z")

</div>

Ah, I didn’t see that before! Thanks!

---

<div class="post-metadata">

**Author:** ![SNICKRS](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@SNICKRS](https://discourse.processing.org/u/SNICKRS)\
**Post date:** [November 24, 2021, 3:30am UTC](https://discourse.processing.org/t/2d-camera-in-processing/33659/4 "2021-11-24T03:30:55Z")

</div>

Hello, I have one more question: If I want to use atan2 to point an image to the mouse where the image rotates in relation to a point, but I want to alter the position of the image and still have it point to the mouse. I can’t seem to get this to work. In my case, I have a circle with an image over its center, where it rotates towards the mouse pointer. However, I want to be able to move the image to the borders of the circle, so it rotates around the circle in relation to the mouse.
