private void glCanvas1_OpenGLDraw(object sender, RenderEventArgs e)
        {
            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);

            element.Render(Objects.RenderModes.Render);
        }
Exemple #2
0
        void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e)
        {
            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);
        }
Exemple #3
0
        void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e)
        {
            mat4 projectionMatrix = camera.GetProjectionMat4();
            mat4 viewMatrix       = camera.GetViewMat4();
            mat4 modelMatrix      = mat4.identity();
            mat4 mvp = projectionMatrix * viewMatrix * modelMatrix;

            element.mvp = mvp;

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

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

            element.Render(arg);
        }
Exemple #4
0
        void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e)
        {
            rotation        += 3.0f;
            modelMatrix      = glm.rotate(rotation, new vec3(0, 1, 0));
            viewMatrix       = this.camera.GetViewMat4();
            projectionMatrix = this.camera.GetProjectionMat4();
            mat4 mvp = projectionMatrix * viewMatrix * modelMatrix;

            element.mvp = mvp;

            //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);
        }
        void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e)
        {
            mat4 projectionMatrix = camera.GetProjectionMat4();

            projectionMatrix = glm.translate(projectionMatrix, new vec3(translateX, translateY, translateZ));//
            mat4 viewMatrix  = camera.GetViewMat4();
            mat4 modelMatrix = mat4.identity();
            mat4 mvp         = projectionMatrix * viewMatrix * modelMatrix;

            pyramidElement.mvp = mvp;
            textElement.mvp    = mvp;

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

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

            pyramidElement.Render(arg);
            textElement.Render(arg);
        }
        private void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e)
        {
            rotation += 3.0f;
            mat4        modelMatrix = glm.rotate(rotation, new vec3(0, 1, 0));
            const float distance    = 0.7f;

            viewMatrix = glm.lookAt(new vec3(-distance, distance, -distance), new vec3(0, 0, 0), new vec3(0, -1, 0));
            int[] viewport = new int[4];
            GL.GetInteger(GetTarget.Viewport, viewport);
            projectionMatrix = glm.perspective(60.0f, (float)viewport[2] / (float)viewport[3], 0.01f, 100.0f);
            mat4 mvp = projectionMatrix * viewMatrix * modelMatrix;

            pyramidElement.mvp = mvp;

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

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

            pyramidElement.Render(arg);
        }