Got this nice lock on camera working with the Kingdom Hearts code and wanted to share. As far as I can tell it's the same camera as in Zelda: Ocarina of Time. The goal was to keep the lock on target and the player in view at all times but also have the camera avoid clipping walls and have a nice angle on the scene. Lock onto a target high up in the air or below you and the camera will move accordingly Here is the download:

http://www.churness.com/axys/ZeldaLockOn.zip (link should work, if it doesn't read posts below incase url has changed)

All resources in this project are free for you to use in any commercial project. Things are unpolished and the code, even though built upon the Kingdom Hearts code, will have some additions that may be difficult to understand, so use and attempt to understand at your own risk There are plenty of things that could be added to this, I just wanted to show you the lock on code I used 6.5, may be compatible with 6.4, not compatible with 6.3 (due to using time_step etc). Good news is that the models are using ellipoid c_move and c_trace The collision model is separate to the animated model, this is because I run into collision issues when two models collide if they are complexly designed like characters with ellipoid collision, a simple box doesn't run into such issues (ie getting stuck when you touch another entity) so this added a new complexity to the code having to have two functions, one which handles the movement but also needs to control the animation of another entity.

When you are locked onto a target (right click), you can switch to another target in view (and with an arrow on it's head), by right clicking again, this only locks on to the nearest target which is in view and is not the one you are currently locked onto, it wont scroll through all the targets on screen. If more than one target is in view hold S and right click to break the lock on. The jumping is automated from walking off a ledge. And if you hold right click and move you can kind of see the beginnings of what happens when you hold Z when playing Ocarina (although needs to be refined more as the camera doesn't swing around).

Enjoy