As a 360º projection facility, the Data Arena affords an intimate and immersive visual experience. To utilise this, we’ve included an mode called 3D scene mode, where you control the movements of a first person camera, rather than moving objects from a static viewpoint.
To make this possible, we’ve used the fantastic PeasyCam library because of its rotation calculations that are impervious to gimbal lock. PeasyCam is traditionally a mouse-operated camera that exists on a hypothetical sphere around the centerpoint of your sketch. As you click and drag, the camera revolves around this sphere, effectively simulating rotating objects in your scene. By using vector calculations, this system can be altered to move this camera sphere in the direction you’re currently facing, creating a first-person simulation. If you’d like to integrate such a system into your sketch, it’s recommended that you become familiar with PeasyCam and the da_3D_scene_mode_solar_system demo first.
As mentioned in the previous mode, Processing’s perspective()
function will become your best friend when trying to debug distorted objects, and the perfect settings will change between different sketches.
Note: It’s best to experiment with the distance variable when initialising a PeasyCam camera. You can find out more about this value in the library’s documentation, but it is essentially the size of the sphere that correlates to the distance between the camera and its look at point. A value of about 10 units works best in this first-person mode. A small unit like 1 will cause shaking at far distances due to a lack of detail when calculating the direction vector, but a large distance will begin to simulate a movement around objects rather than just turning your head from side to side.