Camera Controller?

I'm currently working on a game that needs to be able to alternate between various camera modes (top view, side view, cockpit view, rear view, and third-person view) and I've been using CameraNode up to this point but I don't believe that's the best way to handle this is it?  I was thinking about writing a custom Controller that would take the Camera, a Spatial, and you can specify what mode you want to be in and change it at any time.  Is this worth the effort or is this something that is easily done another way that I'm not seeing?



I'm sure many projects have to deal with this already and was wondering how it is being accomplished there?

I'm having issues with this topic, too. I'd thank any help.



It seems like using CameraNodes, I have to build a lot of Camera instances too. Then use Renderer.setCamera() to select the one I want to use. In the other side, this has some advantages, like having different fov in each camera if I like.



The question is still open: how do you manage multiple cameras?


Well, I personally would prefer to use a single Camera because ultimately I'd like to actually slide the camera to the new view instead of just jump there and I also want to offer free-form camera placement eventually as well.

Mojo? Renanse? Llama? Irrisor? Any other developers?  I'd like some feedback on this before I jump off and just start creating a massive controller system for various camera views.  :stuck_out_tongue:

I think the most simple thing would be using multiple camera nodes (with the same camera) which are attached to your player node. Maybe CameraNode has to be altered to support switching it off and on. When you want to interpolate between camera position you could also use a single camera node and dummy spatials for the position, while using a spatial transformer to move the camera node accordingly…

Hmmm…is using a CameraNode better than if I were to write a CameraController?  I mean, is there any performance advantages there really?

performance? I don't think so.

Okay, I'll probably give this a try tonight and see if I can get anywhere.

You might be able to use CameraNode and null cameras.  (Again, may need some extra null checks in the CameraNode class.)  Basically only set your camera on one of the CameraNodes you are using.  null the camera on the node you leave.

Interesting…I'll toy around with this tonight.

darkfrog said:

Well, I personally would prefer to use a single Camera because ultimately I'd like to actually slide the camera to the new view instead of just jump there and I also want to offer free-form camera placement eventually as well.



Have you looked at the nenya library from Three Rings? It's available at:

      http://www.threerings.net/code/nenya/


It includes an extremely useful CameraHandler class that allows you to dynamically move a camera along a defined path to an arbitrary location and allows orbiting, tiling, zooming, panning, etc.  I find it extremely useful and if I'm reading your original question correctly, it seems like it's exactly what you need.

Stan

Wow, that does sound nice.  I'll take a look and see if it is what I need.



Thanks