Tales of the Rampant Coyote
Adventures in Indie Gaming!


(  RSS Feed! | Games! | Forums! )

Monday, July 04, 2005
 
Cinema-Cam!
Well, I'm almost done with another one of those ridiculous Black Triangles - in this case, I'm reinventing the wheel in many ways, but hey - it's my wheel, and it works.

In this case, I'm working on a cinematic camera. I wasn't too happy with the base camera functionality in Torque, and the Advanced Camera had some really weird bugs in it - and it still didn't meet my needs. I needed a camera that was appropriate for doing cutscenes - smoothly moving around a scene, performing slow automated pans - slowly "autozooming" in and out with real zoom (Field-of-View) behavior. And of course sometimes "cutting" between targets.

Because I'm working on a single-player game, making certain the camera is server-driven is unimportant. Especially since that can introduce the jitters. I took advantage of the fact that it's a single-player game and made some optimizations that would totally break in multiplayer. I left the server's control of the camera as simple, high level commands - like:

%this.camera.setNewTarget(%this.AIPlayer2);
%this.camera.setSmoothPan(2.0);

Which tells the camera to smoothly rotate to face AIPlayer2 over the course of 2 seconds. There's also commands like:

%this.camera.setZoom(60.0,3.0);

Which tells the camera to zoom in (or out, depending on your current field-of-view settings) to a sixty-degree field of view over the course of three seconds. The client handles the slow-zoom and interpolation. This is actually really impressive in action, as it gives the camera a much more organic "feel" to it.
You can combine the behaviors, too. Here's the "before" and "after" shots taken about four seconds apart, as the camera is zooming from a 90 degree FOV to a 30 degree FOV. Simultaneously, the camera moving backwards away from the car (but not as fast as it is approaching), and of course staying focused on the car as it approaches. It looks pretty sharp, though it doesn't serve much purpose right now. Hmmm... maybe I can do a "Blair Witch" style "shakey-cam" effect... :)

It's far from perfect - and definitely not ready for prime-time. But it's good enough for now so I can move on and improve on the functionality when dealing with interactive objects. I would also like to incorporate the existing Torque-camera functionality to allow it to follow splined paths. But right now I don't need it.

I'm just excited to be able to move on to something else now.

Did you enjoy this post? Feel free to share it: del.icio.us | Digg it | Furl | reddit | Yahoo MyWeb

Comments: Post a Comment

Links to this post:

Create a Link



<< Home

Powered by Blogger