Example #1
0
        public override void Initialize() {
            GL.Enable(EnableCap.DepthTest);
            GL.Enable(EnableCap.CullFace);
            GL.Enable(EnableCap.Lighting);
            GL.Enable(EnableCap.Light0);

            cameraPlane = new Plane();

            Resize(MainGameWindow.Window.Width, MainGameWindow.Window.Height);

            grid = new Grid(true);
            model = new OBJLoader("Assets/test_object.obj");

            GL.Light(LightName.Light0, LightParameter.Position, new float[] { 0.0f, 0.5f, 0.5f, 0.0f });
            GL.Light(LightName.Light0, LightParameter.Ambient, new float[] { 0f, 1f, 0f, 1f });
            GL.Light(LightName.Light0, LightParameter.Diffuse, new float[] { 0f, 1f, 0f, 1f });
            GL.Light(LightName.Light0, LightParameter.Specular, new float[] { 1f, 1f, 1f, 1f });

            for (int i = 0; i < 6; i++) {
                frustum[i] = new Plane();
            }
            MouseState mouse = OpenTK.Input.Mouse.GetState();
            LastMousePosition = new Vector2(mouse.X, mouse.Y);
            viewMatrix = Move3DCamera(0f);
        }
Example #2
0
        public override void Initialize()
        {
            GL.Enable(EnableCap.DepthTest);
            GL.Enable(EnableCap.CullFace);
            GL.Enable(EnableCap.Lighting);
            GL.Enable(EnableCap.Light0);

            cameraPlane = new Plane();

            Resize(MainGameWindow.Window.Width, MainGameWindow.Window.Height);

            grid  = new Grid(true);
            model = new OBJLoader("Assets/test_object.obj");

            GL.Light(LightName.Light0, LightParameter.Position, new float[] { 0.0f, 0.5f, 0.5f, 0.0f });
            GL.Light(LightName.Light0, LightParameter.Ambient, new float[] { 0f, 1f, 0f, 1f });
            GL.Light(LightName.Light0, LightParameter.Diffuse, new float[] { 0f, 1f, 0f, 1f });
            GL.Light(LightName.Light0, LightParameter.Specular, new float[] { 1f, 1f, 1f, 1f });

            for (int i = 0; i < 6; i++)
            {
                frustum[i] = new Plane();
            }
            MouseState mouse = OpenTK.Input.Mouse.GetState();

            LastMousePosition = new Vector2(mouse.X, mouse.Y);
            viewMatrix        = Move3DCamera(0f);
        }