# Seeking for some resources to create a Camera controller

**URL:** <https://discourse.threejs.org/t/seeking-for-some-resources-to-create-a-camera-controller/63141>\
**Category:** Questions\
**Tags:** trackball-controls, pointerlockcontrols, controls, orbit-controls\
**Created:** [March 22, 2024, 7:33pm UTC](https://discourse.threejs.org/t/seeking-for-some-resources-to-create-a-camera-controller/63141 "2024-03-22T19:33:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugoh](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hugoh/32/45991_2.png) [@hugoh](https://discourse.threejs.org/u/hugoh)\
**Post date:** [March 22, 2024, 7:33pm UTC](https://discourse.threejs.org/t/seeking-for-some-resources-to-create-a-camera-controller/63141/1 "2024-03-22T19:33:55Z")

</div>

Hey there.

I would like to work on a camera controller, inspired by TrackBallControls with pointerLock API but I haven’t really saw useful resources to work with. My goal is to have a controller behaving like TrackBallControls (unlimited rotation, with a target but with pointerLock API like in PointerLockControls).

But I don’t really know where to start. I saw this repo when I was digging some examples and it’s pretty well documented/commented, and the controls behave almost like I want to (except for the pointerLock API).

> **[GitHub - JaneliaSciComp/three-orbit-unlimited-controls: A THREE.js camera...](https://github.com/JaneliaSciComp/three-orbit-unlimited-controls)**
>
> A THREE.js camera controller that improves on OrbitControls and TrackballControls. - JaneliaSciComp/three-orbit-unlimited-controls

But it seems like I need some basics in camera controlling, rotating around an object, etc… And because PointerLockControls behave differently than TrackBallControls, especially with coordinates values and calculation, I can’t use the same calculation for rotation methods as in TrackBallControls…

So yep, seems like a big project for me ! So idk if anyone has some advices, some tips or some resources to read about camera controlling/rotation, so maybe I can try to code a controller module from scratch ?

Thanks,

---

<div class="post-metadata">

**Author:** ![manthrax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/manthrax/32/2596_2.png) [@manthrax](https://discourse.threejs.org/u/manthrax)\
**Post date:** [March 22, 2024, 7:35pm UTC](https://discourse.threejs.org/t/seeking-for-some-resources-to-create-a-camera-controller/63141/2 "2024-03-22T19:35:22Z")

</div>

My advice is to read the source of all of them. each of them is like 2 or 3 pages of code.

---

<div class="post-metadata">

**Author:** ![hugoh](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hugoh/32/45991_2.png) [@hugoh](https://discourse.threejs.org/u/hugoh)\
**Post date:** [March 22, 2024, 8:07pm UTC](https://discourse.threejs.org/t/seeking-for-some-resources-to-create-a-camera-controller/63141/3 "2024-03-22T20:07:31Z")

</div>

yep I tried to, but I can’t really understand how calculation works for like interpreting mouse movements to rotate the camera around an object or something like that. Idk if just copying the formula is a good thing to do.

I learned a bit of Euler angles since three.js implements Euler but again I don’t know if it can be a solution to work with that or not (TrackBallControls doesn’t seems to use Euler calculations).

It’s like I’m missing basics of camera interaction or something like that 😅 but I can’t find any useful resources detailing systems like camera controllers. (maybe I’m searching badly)

---

<div class="post-metadata">

**Author:** ![manthrax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/manthrax/32/2596_2.png) [@manthrax](https://discourse.threejs.org/u/manthrax)\
**Post date:** [March 22, 2024, 8:11pm UTC](https://discourse.threejs.org/t/seeking-for-some-resources-to-create-a-camera-controller/63141/4 "2024-03-22T20:11:54Z")

</div>

It’s a complicated topic and there isn’t a lot of documentation about cameras specifically.

OrbitControls uses polar coordinates to create/limit the rotations

and Trackball uses Quaternions i think.

They use different techniques because they have different goals.

[![](https://img.youtube.com/vi/oNd_AaJ7dwA/maxresdefault.jpg "ThreeJS - Easy Camera control with Groups") ](https://www.youtube.com/watch?v=oNd_AaJ7dwA)

[![](https://img.youtube.com/vi/bR_bBG0m3Pc/hqdefault.jpg "7a Best camera controls for three.js? Camera-controls.js") ](https://www.youtube.com/watch?v=bR_bBG0m3Pc)

[![](https://img.youtube.com/vi/oqKzxPMLWxo/maxresdefault.jpg "Building a Simple First Person Camera") ](https://www.youtube.com/watch?v=oqKzxPMLWxo)

> [@Implement own camera controller](https://discourse.threejs.org/t/implement-own-camera-controller/29592):
>
> im working on a similar game to an RTS in web and i am looking for ways to directly manipulate the camera position, look (pitch/yaw) that is custom to our game, I cant seem to find the needed necessary getter/setter for Perspective camera to manipulate its access manuly like its look, right and up (unit) vector so i can implement our own camera system/input controls. Is there any available resources on how to implement custom camera controllers like the Orbit or FPS controller, etc. example of…

---

<div class="post-metadata">

**Author:** ![hugoh](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hugoh/32/45991_2.png) [@hugoh](https://discourse.threejs.org/u/hugoh)\
**Post date:** [March 22, 2024, 8:17pm UTC](https://discourse.threejs.org/t/seeking-for-some-resources-to-create-a-camera-controller/63141/5 "2024-03-22T20:17:06Z")

</div>

Oh ok I see, thank you very much for the infos. I’ll check these videos and give it a try by coding step by step
