예제 #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);

            if (this.newElement != null)
            {
                this.element    = this.newElement;
                this.newElement = null;
            }
            {
                mat4 projectionMatrix = camera.GetProjectionMat4();

                mat4 viewMatrix = camera.GetViewMat4();

                mat4 modelMatrix = mat4.identity();

                this.element.projectionMatrix = projectionMatrix;
                this.element.viewMatrix       = viewMatrix;
                this.element.modelMatrix      = modelMatrix;
            }
            element.Render(arg);

            uiLeftBottomAxis.Render(arg);
        }
예제 #2
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);

            if (this.renderState == 2 || this.renderState == 4)
            {
                axisElement.Render(arg);
            }

            if (this.renderState == 3 || this.renderState == 4)
            {
                axisElement2.Render(arg);
            }

            uiLeftBottomAxis.Render(arg);
            uiLeftTopAxis.Render(arg);
            uiRightBottomAxis.Render(arg);
            uiRightTopAxis.Render(arg);

            uiLeftBottomRect.Render(arg);
            uiLeftTopRect.Render(arg);
            uiRightBottomRect.Render(arg);
            uiRightTopRect.Render(arg);
        }
예제 #3
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);
            mat4 projectionMatrix = camera.GetProjectionMat4();
            mat4 viewMatrix       = camera.GetViewMat4();
            mat4 modelMatrix      = mat4.identity();
            mat4 mvp = projectionMatrix * viewMatrix * modelMatrix;

            axisElement.mvp = mvp;
            axisElement.Render(arg);

            uiLeftBottomRect.Render(arg);
            //uiLeftTopRect.Render(arg);
            //uiRightBottomRect.Render(arg);
            //uiRightTopRect.Render(arg);

            legacyUIRect_BeforeRendering(this.legacyLeftBottomRect, arg);
            legacyLeftBottomRect.Render(arg);
            legacyUIRect_AfterRendering(this.legacyLeftBottomRect, arg);
            //legacyLeftTopRect.Render(arg);
            //legacyRightBottomRect.Render(arg);
            //legacyRightTopRect.Render(arg);

            uiLeftBottomAxis.Render(arg);
        }
예제 #4
0
        void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e)
        {
            PrintCameraInfo();

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

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

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

            if (this.newElement != null)
            {
                if (this.element != null)
                {
                    this.element.Dispose();
                }
                this.element    = this.newElement;
                this.newElement = null;
            }
            ShaderDesignerRendererBase element = this.element;

            element.projectionMatrix = projectionMatrix;
            element.viewMatrix       = viewMatrix;
            element.modelMatrix      = modelMatrix;

            element.Render(arg);
            uiLeftBottomAxis.Render(arg);
        }
예제 #5
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);
            uiAxis.Render(arg);
        }
예제 #6
0
        void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e)
        {
            var  arg = new RenderEventArgs(RenderModes.Render, this.camera);
            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);
            element.Render(arg);
            uiAxis.Render(arg);
        }
예제 #7
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);

            legacyUIRect.Render(arg);
            modernUIRect.Render(arg);
            leftUIAxis.Render(arg);
            rightUIAxis.Render(arg);
            element.Render(arg);
        }
예제 #8
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);

            pointSpriteElement.Render(arg);

            uiLeftBottomAxis.Render(arg);
            uiLeftTopAxis.Render(arg);
            uiRightBottomAxis.Render(arg);
            uiRightTopAxis.Render(arg);
        }
예제 #9
0
        private 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);

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

            element.Render(arg);
            uiAxis.Render(arg);
        }
예제 #10
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);
            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;

            if (this.renderState == 2 || this.renderState == 4)
            {
                axisElement.mvp = mvp;

                axisElement.Render(arg);
            }

            if (this.renderState == 3 || this.renderState == 4)
            {
                axisElement2.projectionMatrix = projectionMatrix;
                axisElement2.viewMatrix       = viewMatrix;
                axisElement2.modelMatrix      = modelMatrix;

                axisElement2.Render(arg);
            }

            uiLeftBottomAxis.Render(arg);
            uiLeftTopAxis.Render(arg);
            uiRightBottomAxis.Render(arg);
            uiRightTopAxis.Render(arg);

            uiLeftBottomRect.Render(arg);
            uiLeftTopRect.Render(arg);
            uiRightBottomRect.Render(arg);
            uiRightTopRect.Render(arg);
        }
예제 #11
0
        void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e)
        {
            PrintCameraInfo();

            var  arg = new RenderEventArgs(RenderModes.Render, this.camera);
            mat4 projectionMatrix = camera.GetProjectionMat4();
            mat4 viewMatrix       = camera.GetViewMat4();
            mat4 modelMatrix      = mat4.identity();
            mat4 mvp = projectionMatrix * viewMatrix * modelMatrix;

            pointSpriteElement.mvp = mvp;

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

            pointSpriteElement.Render(arg);

            uiLeftBottomAxis.Render(arg);
            uiLeftTopAxis.Render(arg);
            uiRightBottomAxis.Render(arg);
            uiRightTopAxis.Render(arg);
        }