Advertisement
Guest User

Untitled

a guest
May 16th, 2011
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.28 KB | None | 0 0
  1.     class Game : MiNGLe.Game
  2.     {
  3.         public Game(int displayWidth, int displayHeight)
  4.             : base(displayWidth, displayHeight)
  5.         {
  6.         }
  7.  
  8.  
  9.         Model model, model2;
  10.         protected override void LoadContent()
  11.         {
  12.             Mesh mesh;
  13.             model = new Model(Mesh.Cube(1.0F, 1.0F, 1.0F));
  14.             var v = Vector3.Forward; v.Add(Vector3.Left); v.Multiply(8F);
  15.             model.World = Matrix4x4.FromTranslation(ref v);
  16.  
  17.             model2 = new Model(Mesh.Cube(1.0F, 1.0F, 1.0F));
  18.             v = Vector3.Forward; v.Multiply(5F); // var v2 = Vector3.Right; v2.Multiply(1.0F); v.Add(v2);
  19.             model2.World = Matrix4x4.FromTranslation(ref v);
  20.         }
  21.  
  22.  
  23.         protected override void DrawBody(float deltaTime)
  24.         {
  25.             Device.Clear(Color.Blue);
  26.  
  27.             // Device.SetTransform(TransformState.Projection, Matrix4x4.Orthographic(16, 10, 0.001F, 10000F));
  28.             Device.SetTransform(TransformState.Projection, Matrix4x4.PerspectiveFov(Math2.PI / 4.0F, 1.6F, 0.001F, 10000F));
  29.             Device.SetTransform(TransformState.View, Matrix4x4.LookAt(Vector3.Zero, Vector3.Forward, Vector3.Up));
  30.  
  31.             model.Draw();
  32.             model2.Draw();
  33.  
  34.             base.DrawBody(deltaTime);
  35.         }
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement