Camera Utilization and Manipulation

Jan 6, 2014 at 9:39 PM
I've been trying to determine effective ways to use the camera and models to make the gameplay happen.

My questions comes down specifically to how to use/implement the camera.
  1. I noticed you can change the camera types in the XAML file. How can I "Steal" the input to manipulate the camera? I noticed you placed some simple controls in the source code.
    One thought I had was creating some type of object, fixing the camera to it, and really manipulate the object and have the camera follow it, but I'm not savy with the Model Viewer camera. I'm shooting for FPS like gameplay.
  2. Can I give the Camera some collision logic, like a collision box? Just trying to figure a way to use it against this large model I'm using as my level, So I can't pass through the wall or any objects that are apart of that mesh.
  3. Can I place more than one camera? Like have one as Model Viewer I could call up when the character is dead to view it's body, but then return to the FPS point of view when we respawn the character. To take it futher, have a third camera to be position way overhead with a RTS like position?
Jan 9, 2014 at 12:01 PM

Basic Camera

public class CameraName : Nine.Transformable, ICamera, IGraphicsObject
        public Matrix View;
        public Matrix Projection;

        void IGraphicsObject.OnAdded(DrawingContext context)
            // if the current camera is null then set this (when added to scene)
            if (context.Camera == null)
                context.Camera = this;

        void IGraphicsObject.OnRemoved(DrawingContext context)
            // if the current camera is this then set to null (when removed from scene)
            if (context.Camera == this)
                context.Camera = null;

        // ICamera requires this
        bool ICamera.TryGetViewFrustum(out Matrix view, out Matrix projection)
            view = this.View;
            projection = this.Projection;
            return true;