I have finally managed to return to my Camera Shake project I started during an AGI hackathon this past year.
The original idea was to add simulated camera shake to our virtual camera in Cesium*/STK**. After a night of coding we were able to get a basic demo working, but as with most hackathon projects it was only just barely working. Now I have the code running in the Cesium Sandcastle – a demo building tool that allows you to tweak code and see results on the fly. Using this interface, I was able to create a demo that provides sliders for camera shake amplitude and frequency (camera pitch and yaw are driven by a couple trig functions), allowing the user to hone in on realistic camera movement.
Next steps:
- Drive amplitude based on camera field of view. The idea is that a lower field of view corresponds to a ‘zoomed in’ view through the camera, which would exhibit a higher camera shake amplitude. (DONE – this works just like I hoped it would with a new “Field of View” slider driving amplitude. As field of view decreases, camera shake amplitude increases)
- Drive amplitude and frequency based on proximity and relative velocity of nearby objects. This would simulate an exaggerated camera shake when a fast object moves past the camera.
- Improve the camera shake equations. I’m essentially jittering the camera pitch and yaw right now. It makes for interesting movement, but I am still trying to find ways to make the movement more realistic.
- Bring the same functionality into STK via the plugin interface. It is easy to test the code/equations of motion in Cesium, but eventually I’d like to see the camera shake functionality in STK, so it can be used when we record our animations. (Basic plugin setup has started – I have a GUI, but it doesn’t do anything yet)