Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Game : MiNGLe.Game
- {
- public Game(int displayWidth, int displayHeight)
- : base(displayWidth, displayHeight)
- {
- }
- Model model, model2;
- protected override void LoadContent()
- {
- Mesh mesh;
- model = new Model(Mesh.Cube(1.0F, 1.0F, 1.0F));
- var v = Vector3.Forward; v.Add(Vector3.Left); v.Multiply(8F);
- model.World = Matrix4x4.FromTranslation(ref v);
- model2 = new Model(Mesh.Cube(1.0F, 1.0F, 1.0F));
- v = Vector3.Forward; v.Multiply(5F); // var v2 = Vector3.Right; v2.Multiply(1.0F); v.Add(v2);
- model2.World = Matrix4x4.FromTranslation(ref v);
- }
- protected override void DrawBody(float deltaTime)
- {
- Device.Clear(Color.Blue);
- // Device.SetTransform(TransformState.Projection, Matrix4x4.Orthographic(16, 10, 0.001F, 10000F));
- Device.SetTransform(TransformState.Projection, Matrix4x4.PerspectiveFov(Math2.PI / 4.0F, 1.6F, 0.001F, 10000F));
- Device.SetTransform(TransformState.View, Matrix4x4.LookAt(Vector3.Zero, Vector3.Forward, Vector3.Up));
- model.Draw();
- model2.Draw();
- base.DrawBody(deltaTime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement