Click or drag to resize
DigitalRuneCameras

A Camera defines a view into the 3D scene. It defines the projection transformation (see property Projection). DigitalRune Graphics supports

The view transformation (position and orientation of the camera in world space) is defined by creating a CameraNode and adding it to a scene.

C#
// Define a camera.
var projection = new PerspectiveProjection();
projection.SetFieldOfView(
  ConstantsF.PiOver4, 
  graphicsService.GraphicsDevice.Viewport.AspectRatio, 
  0.1f, 
  100.0f);
var camera = new Camera(projection);

// Create a camera node and add it to the scene.
var cameraNode = new CameraNode(camera);
scene.Children.Add(cameraNode);
Tip Tip

The Projection of a camera can be cast to Matrix or Matrix44F to get the projection transformation matrix.

Scenes can have multiple cameras. Renderers use the currently active camera, which needs to be set in the render context (see RenderContextCameraNode).

DigitalRune.Graphics (Cameras)
Class Diagram: Cameras