Beispiel #1
0
        public void Draw()
        {
            GL.Enable(EnableCap.StencilTest);
            GL.Clear(ClearBufferMask.StencilBufferBit);

            GL.StencilFunc(StencilFunction.Always, 1, 0xff);
            GL.StencilOp(StencilOp.Replace, StencilOp.Replace, StencilOp.Replace);

            GL.ColorMask(false, false, false, false);

            model.Reset();

            model.Translate(manipulator.Position);
            model.Scale(Editor.CurrentEditor.editorCamera.Position.Z * 0.2f * 0.94f);

            model.Draw();

            GL.StencilFunc(StencilFunction.Notequal, 1, 0xff);
            GL.ColorMask(true, true, true, true);

            model.Color = Color;

            model.Reset();

            model.Translate(manipulator.Position);
            model.Scale(Editor.CurrentEditor.editorCamera.Position.Z * 0.2f);

            model.Draw();

            GL.Disable(EnableCap.StencilTest);
        }
Beispiel #2
0
    public void Draw()
    {
        rectModel.Color = Selected ? Color.White : Color.Yellow;

        rectModel.Reset();

        rectModel.Translate(Position);
        rectModel.Scale(0.015f * editor.editorCamera.Position.Z);

        if (Selected)
        {
            GL.LineWidth(2f);
        }

        rectModel.Draw(PrimitiveType.LineLoop);

        GL.LineWidth(1f);

        if (Hovered)
        {
            rectModel.Color = new Color(1f, 1f, 1f,
                                        (mouse[MouseButton.Left] && !editor.DisableSelect && !editor.selectionBox.Active) ? 0.8f : 0.4f);

            rectModel.Scale(0.6f);
            rectModel.Draw(PrimitiveType.Polygon);
        }
    }
    public void Draw()
    {
        if (origin != null && Active)
        {
            SYS.RectangleF r = Rectangle;

            selectModel.Reset();

            selectModel.Translate(r.X, r.Y);
            selectModel.Scale(r.Width, r.Height);

            selectModel.Color          = Color.Green;
            selectModel.TextureEnabled = false;
            selectModel.Draw(OpenTK.Graphics.OpenGL.PrimitiveType.LineLoop);

            selectModel.TextureEnabled = true;
            selectModel.Color          = new Color(0, 1f, 0f, 0.2f);
            selectModel.Draw();
        }
    }
Beispiel #4
0
    public void Draw()
    {
        if (!Enabled)
        {
            return;
        }

        vertexModel.Color = new Color(1f, 1f, 1f, Alpha);

        vertexModel.Reset();
        vertexModel.Translate(position);
        vertexModel.Draw();

        if (Selected)
        {
            vertexModel.Color = TKTools.Color.Yellow;

            vertexModel.Scale(1.4f);
            vertexModel.Draw(OpenTK.Graphics.OpenGL.PrimitiveType.LineLoop);
        }
    }
Beispiel #5
0
        public void Draw()
        {
            Matrix4 mat = ModelMatrix;

            xAxis.ModelMatrix = mat;
            yAxis.ModelMatrix = mat;
            plane.ModelMatrix = mat;

            xAxis.Color = Color.Green;
            yAxis.Color = Color.Red;
            plane.Color = Color.Yellow;

            xAxis.Draw(PrimitiveType.LineLoop);
            yAxis.Draw(PrimitiveType.LineLoop);
            plane.Draw(PrimitiveType.LineLoop);

            xAxis.Color = GetAxisColor(Axis.X);
            yAxis.Color = GetAxisColor(Axis.Y);
            plane.Color = GetAxisColor(Axis.Plane);

            xAxis.Draw();
            yAxis.Draw();
            plane.Draw();
        }