specialization - third person camera, website
as a gameplay programmer who is in love with cameras, controllers and characters, i wanted to create something useful and important.
my third person camera component was inspired by ubisoft massive's game the division and i would love to have a future there, great eye for detail and player experience!

i set up this website before the course even started and kept on updating it throughout the term. i have always had an interest in creating and designing websites so i started learning html and css and ended up making this website from the ground up.

download here!




• research
after a conversation with my teacher, i found out what i wanted to do - a third person camera inspired by the division. i was stoked!

i asked myself, what makes a camera great? after a couple of hours of searching for valuable information, i had a folder with links and pdfs.
just by skimming through them i realized that there is so much i have not thought of. for example, raycasting from the target to the camera for "collision" and how important field of view is.





since the division was my reference, i played the game and tried to write down every little detail. what feels good? what looks nice? how smart is the camera?

i decided what i wanted and started planning my time!




• follow target
first off, i needed to have a target position to follow. the camera follows the parent's transform by default, there is also an adjustable offset. (imgui)

the camera has two locators to move between, one on each shoulder in my case. if the player hits an object on the side that the camera currently is on, it will move to the other shoulder for better view. a ray is casted from the center to the direction of the current shoulder.

the movement itself happens in another component which affects the transform and since we are following that position, everything works out great.


follow img




• rotate around target
to be able to rotate around the target position we need to do do some matrix multiplications.
i created a rotation matrix with the current cameras position and offset in mind.

the x axis was clamped to limit the camera from going over and under our target since only the y axis is allowed to go 360 degrees.

i also did some smoothing on the delta of the mouse's position which gave the camera a smooth and nice follow.


rotate img




• raycast
when i had the basics down, i wanted to raycast the camera. the reason for this is so that less objects get in the way of our view by moving the camera to the position of where the ray hit.
it turned out to be simpler than i thought! we have physx in our engine and with the help of their rays, basic collision.
we shoot a ray from the target's position in an inverted direction of the camera's forward (backwards).


raycast img




• aim, crouch, sprint
a couple of projects ago, i made a inputmapper where you can attach different keys and buttons to an action. i started by creating "actions" for each of the mechanics i wanted and then attached them to some keys.


input img


for the crouch, i added an offset in the y axis.


crouch img


then i added an "fov while aiming" variable that lerps the cameras current fov to that value!





increasing fov while running is a subtle but effective way to make the player feel fast and immersed.