protected override void OnLoad(EventArgs e) { base.OnLoad(e); GL.ClearColor(0f, 0f, 0f, 0f); GL.Enable(EnableCap.DepthTest); GL.Enable(EnableCap.Texture2D); GL.EnableClientState(ArrayCap.VertexArray); GL.EnableClientState(ArrayCap.NormalArray); GL.EnableClientState(ArrayCap.TextureCoordArray); GL.Enable(EnableCap.ColorMaterial); GL.Enable(EnableCap.Lighting); GL.Enable(EnableCap.Light0); GL.Enable(EnableCap.Light1); GL.Enable(EnableCap.Blend); GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); GL.Viewport(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height); Matrix4 projection = Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 4, Width / (float)Height, 1.0f, 10000.0f); GL.MatrixMode(MatrixMode.Projection); GL.LoadMatrix(ref projection); //helicopter = new TexturedObject("helicopter.obj", "Textures/fuse.png", new OpenTK.Vector3()); building = new TexturedObject("Building-1.obj", "Textures/Building_1.bmp", new OpenTK.Vector3(10, 0, 20)); building.Pivot = new OpenTK.Vector3(-building.Size.X / 2, 0, -building.Size.Z / 2); skyBox = new TexturedObject("skybox.obj", "Textures/skybox_cubemap.png", new OpenTK.Vector3()); blocoC = new TexturedObject("BlocoC.obj", "Textures/BlocoC.png", new OpenTK.Vector3(100, 0, 200)); blocoC.Pivot = new OpenTK.Vector3(-blocoC.Size.X / 2, 0, -blocoC.Size.Z / 2); texture_grass = TexturedObject.LoadTexture("Textures/grass.bmp"); bussola = TexturedObject.LoadTexture("Textures/bussola.png"); Hud = TexturedObject.LoadTexture("Textures/Hud.png"); textRederer = new TextRenderer(Width, Height); helicopter = new Helicopter(); camera = new Camera(helicopter); m.Instrument(0, 125); m.NoteOn(0, 60, 127); }
public Camera(Helicopter helicopter) { this.helicopter = helicopter; }