Ejemplo n.º 1
0
        void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e)
        {
            PrintCameraInfo();

            GL.ClearColor(0x87 / 255.0f, 0xce / 255.0f, 0xeb / 255.0f, 0xff / 255.0f);
            GL.Clear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);

            var arg = new RenderEventArgs(RenderModes.Render, this.camera);

            element.Render(arg);
            uiAxisElement.Render(arg);
        }
Ejemplo n.º 2
0
        void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e)
        {
            PrintCameraInfo();

            mat4 projectionMatrix = this.camera.GetProjectionMat4();
            mat4 viewMatrix       = this.camera.GetViewMat4();
            mat4 modelMatrix      = mat4.identity();

            element.mvp = projectionMatrix * viewMatrix * modelMatrix;

            var arg = new RenderEventArgs(RenderModes.Render, this.camera);

            GL.Clear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);

            element.Render(arg);
            uiAxisElement.Render(arg);
        }