# Did anyone make a Controller for Mouse to steer camera pos and look At in 3D?

**URL:** <https://discourse.processing.org/t/did-anyone-make-a-controller-for-mouse-to-steer-camera-pos-and-look-at-in-3d/43598>\
**Category:** Project Guidance\
**Created:** [January 1, 2024, 1:37am UTC](https://discourse.processing.org/t/did-anyone-make-a-controller-for-mouse-to-steer-camera-pos-and-look-at-in-3d/43598 "2024-01-01T01:37:07Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [January 1, 2024, 1:37am UTC](https://discourse.processing.org/t/did-anyone-make-a-controller-for-mouse-to-steer-camera-pos-and-look-at-in-3d/43598/1 "2024-01-01T01:37:07Z")

</div>

Hello all,

did anyone make a Controller with onscreen buttons for the Mouse  
to steer the camera pos and look At in P3D?

Thanks!

Happy new year!

Chrisir

---

<div class="post-metadata">

**Author:** ![scudly](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/scudly/32/5597_2.png) [@scudly](https://discourse.processing.org/u/scudly)\
**Post date:** [January 1, 2024, 8:48pm UTC](https://discourse.processing.org/t/did-anyone-make-a-controller-for-mouse-to-steer-camera-pos-and-look-at-in-3d/43598/2 "2024-01-01T20:48:01Z")

</div>

I use the arrows and ASDW to control the flying in [https://infinitefunspace.com/p5/fly/](https://infinitefunspace.com/p5/fly/), but you could presumably map whatever controls you like to it.

p5 has the orbit controller which uses an outside-in control where the camera rotates about the lookAt point rather than around the eye point. See [https://infinitefunspace.com/p5/ball/](https://infinitefunspace.com/p5/ball/) for an example. Swipe with the mouse or your fingers on a touch screen to rotate.

---

<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:** [January 1, 2024, 11:51pm UTC](https://discourse.processing.org/t/did-anyone-make-a-controller-for-mouse-to-steer-camera-pos-and-look-at-in-3d/43598/3 "2024-01-01T23:51:16Z")

</div>

I can’t see the source code there

I was thinking more of processing though

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [January 2, 2024, 1:18am UTC](https://discourse.processing.org/t/did-anyone-make-a-controller-for-mouse-to-steer-camera-pos-and-look-at-in-3d/43598/4 "2024-01-02T01:18:32Z")

</div>

> [@Chrisir](#):
>
> I can’t see the source code there

Inspect in Google Chrome will help.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/e/4/e49b6b565ef6c74a9bd8e2bb098e372f043c15ea.jpeg)

`:)`

---

<div class="post-metadata">

**Author:** ![scudly](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/scudly/32/5597_2.png) [@scudly](https://discourse.processing.org/u/scudly)\
**Post date:** [January 2, 2024, 5:52pm UTC](https://discourse.processing.org/t/did-anyone-make-a-controller-for-mouse-to-steer-camera-pos-and-look-at-in-3d/43598/5 "2024-01-02T17:52:55Z")

</div>

Hit F12 to “inspect” as @glv said.

The orbit controller is deeply embedded in the p5 camera controls, so that would be hard to port, but the keyboard controls in my fly program are simple to convert to Processing. Just replace each `p5.Vector` with `PVector` for the most part.

---

<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:** [January 5, 2024, 2:45pm UTC](https://discourse.processing.org/t/did-anyone-make-a-controller-for-mouse-to-steer-camera-pos-and-look-at-in-3d/43598/6 "2024-01-05T14:45:24Z")

</div>

very impressive

I made my own now when anyone is interested

These are the commands. You enter a key 0…5 and this changes what the mouse does when you move.

- 0 to change camera Pos x/y with mouse (click and hold outside the green box, the dist to the box is the speed)

- 1 camera Pos XZ

- 2 LookAt x/z (circle)

- 3 LookAt x/y

- 4 Camera Pos moves in a Circle around LookAt

- 5 Move both Camera Pos and LookAt x/y

- Esc reset camera

Have I forgotten something?

Chrisir
