/Rendering/CameraTests/Tutorials.cs
C# | 122 lines | 77 code | 10 blank | 35 comment | 0 complexity | 6f962566cd0b49ee0d191e117c682281 MD5 | raw file
Possible License(s): Apache-2.0
- using Delta.Engine;
- using Delta.Rendering.Basics.Drawing;
- using Delta.Rendering.Cameras;
- using Delta.Utilities.Datatypes;
-
- namespace Delta.Rendering.CameraTests
- {
- public class Tutorials
- {
- #region UseLookAtCamera (Static)
- /// <summary>
- /// Tutorial: Camera Tutorial 1: Look-At Camera
- /// Difficulty: Easy
- /// Description: Use a simple "Look At" camera.
- /// Image: http://DeltaEngine.net/Icons/CameraTutorial1.png
- /// </summary>
- public static void UseLookAtCamera()
- {
- // Create the camera. It will be activated automatically.
- LookAtCamera camera = new LookAtCamera(new Vector(20f, 25f, 40f));
-
- Application.Start(delegate
- {
- Grid.Draw();
- });
- }
- #endregion
-
- #region UseIsometricCamera (Static)
- /// <summary>
- /// Tutorial: Camera Tutorial 2: Isometric Camera
- /// Difficulty: Easy
- /// Description: Use a simple Isometric camera.
- /// Image: http://DeltaEngine.net/Icons/CameraTutorial2.png
- /// </summary>
- public static void UseIsometricCamera()
- {
- // Create the camera. It will be activated automatically.
- IsometricCamera camera = new IsometricCamera(new Vector(0f, 0f, 5f));
- camera.Distance = 15f;
- camera.Target = Vector.Zero;
-
- Application.Start(delegate
- {
- Grid.Draw();
- });
- }
- #endregion
-
- #region UseFreeCamera (Static)
- /// <summary>
- /// Tutorial: Camera Tutorial 3: Free Camera
- /// Difficulty: Easy
- /// Description: Use a simple free camera.
- /// Image: http://DeltaEngine.net/Icons/CameraTutorial3.png
- /// </summary>
- public static void UseFreeCamera()
- {
- // Create the camera. It will be activated automatically.
- FreeCamera camera = new FreeCamera(new Vector(0f, 0f, 5f));
-
- Application.Start(delegate
- {
- Grid.Draw();
- });
- }
- #endregion
-
- #region UseGameCamera (Static)
- /// <summary>
- /// Tutorial: Camera Tutorial 4: Game Camera
- /// Difficulty: Easy
- /// Description: Use a simple game camera.
- /// Image: http://DeltaEngine.net/Icons/CameraTutorial4.png
- /// </summary>
- public static void UseGameCamera()
- {
- // Create the camera. It will be activated automatically.
- GameCamera camera = new GameCamera(new[]
- {
- Matrix.CreateTranslation(20, 20, 20),
- Matrix.CreateTranslation(-20, 20, 20),
- Matrix.CreateTranslation(-20, -20, 20),
- Matrix.CreateTranslation(20, -20, 20),
- });
-
- Application.Start(delegate
- {
- Grid.Draw();
- });
- }
- #endregion
-
- #region UsePathCamera (Static)
- /// <summary>
- /// Tutorial: Camera Tutorial 5: Path Camera
- /// Difficulty: Easy
- /// Description: Use a simple path camera.
- /// Image: http://DeltaEngine.net/Icons/CameraTutorial5.png
- /// </summary>
- public static void UsePathCamera()
- {
- // Create the camera. It will be activated automatically.
- PathCamera camera = new PathCamera(new[]
- {
- new Vector(20, 20, 20),
- new Vector(-20, 20, 20),
- new Vector(-20, -20, 20),
- new Vector(20, -20, 20),
- }, new[]
- {
- Vector.Zero,
- });
-
- Application.Start(delegate
- {
- Grid.Draw();
- });
- }
- #endregion
- }
- }