Project Development: UNITY Camera Controls

camcontroller

“ORBITAL” CAMERA DEVELOPMENT

When visualising my application, I felt the user should be able to control their view by using the mouse and keyboard to pan, zoom and rotate around the 3D environment. I was looking to achieve a result much like the camera controls used within the Maya software to navigate around a scene. I therefore listed the following requirements of the orbital camera before starting development.

  • 1. Left mouse click + mouse movement: Rotate around scene
  • 2. Command/Ctrl + left mouse down: Pan across scene
  • 3. Mouse wheel up/down: Zoom in/out within scene
  • 4. Right click + mouse movement: Zoom in/out scene

The orbital camera provides the centrepiece for user interaction within my application. After much time researching camera control scripts, I created a JavaScript file and attached it to the main scene camera which in turn allows users to successfully navigate and interact with the scene. However, the orbital camera is in need of refining as the user can currently zoom indefinitely and also rotate underneath the 3D map floor. I will therefore consider applying limits to the camera axis rotation and zooming ability to fix this issue.

AERIAL CAMERA DEVELOPMENT

In addition to developing an orbital camera, I thought it would be important to provide the user with an option to view the scene from an aerial overhead perspective. Effectively providing a “birds eye view” of the entire scene. This proved a much simpler process than developing the orbit camera. I simply positioned a secondary camera with a lens perspective that covers the entirety of my Unity scene. I then quickly created a C# script and developed a function that enabled users to switch cameras between the orbit camera and the aerial camera. This function was then assigned to a UI button that then implemented the two cameras within the scene. Whilst the camera switching functionality is perfectly working, I feel the transition from camera-camera is far too sudden. A smoothing animation between the camera transitions would provide a far superior experience for the user in my opinion. Therefore I shall investigate and research this issue further.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s