« maybe there is hope for humanity, after all... | Main | Tuesday: Zbigniew Rybczynski @ Cinefamily »

OCD example

Here's a cleaned-up version of the OCD camera example that we worked on in class.

Link

I changed/added a few features:

1. I switched from using the modifier keys to specific letter keys to change modes - there weren't enough modifier keys for all the modes. 'l' for lookaround, 't' for travel, 'f' for forklift, 'o' for orbit. Added 'z' for zoom, 'w' for walk, 's' to toggle stroke.
2. The 'a' key (for auto) toggles between automatically returning to 'lookaround' mode when you release a key, or staying in the last mode selected.
3. I added two new methods to OCDCamera.java (truck_walk and dolly_walk) so that you can walk (keeping a constant height) instead of flying (the default, in which you travel towards the lookat point, changing your height as you move).
4. I added a second (fixed) camera for two heads-up information displays. You can toggle the HUD strips with the 'r' (for readout) and 'h' (for 'help') keys. 'Readout' reports the current camera parameters, and 'Help' reports the current camera mode and settings, along with a list of keyboard shortcuts.
5. To enable the camera readout, I added some 'get' methods to OCDCamera.java.
6. I added a mouse tracking factor, which you can change using the '-' and '+' keys. The higher you set it, the more quickly the camera moves, and vice versa.

(big thanks to Kristian Linn Damkjer for his excellent OCD library.)

Post a comment