private static void Initialize2DUI(ScientificVisual3DControl scientificVisual3DControl)
        {
            SceneElement parent = scientificVisual3DControl.UIScene.SceneContainer;
            SimpleUIAxis uiAxis = new SimpleUIAxis(
                AnchorStyles.Left | AnchorStyles.Bottom,
                new Padding(10, 0, 0, 20), new Size(40, 40))
            {
                Name = "UI: Axis",
            };

            uiAxis.RectDirection = ERectDirection.XZ;
            parent.AddChild(uiAxis);
            scientificVisual3DControl.uiAxis = uiAxis;

            SimpleUIColorIndicator uiColorIndicator = new SimpleUIColorIndicator(
                AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right,
                new Padding(80, 0, 80, 40), new Size(100, 15))
            {
                Name = "UI: Color Indicator",
            };
            ColorIndicatorData rainbow = ColorIndicatorDataFactory.CreateRainbow();

            uiColorIndicator.Data = rainbow;
            parent.AddChild(uiColorIndicator);
            scientificVisual3DControl.uiColorIndicator = uiColorIndicator;
        }
Example #2
0
        private void InitLight(SceneElement parent)
        {
            Light light1 = new Light()
            {
                Name     = "Light 1",
                On       = true,
                Position = new Vertex(-9, -9, 11),
                GLCode   = OpenGL.GL_LIGHT0
            };
            Light light2 = new Light()
            {
                Name     = "Light 2",
                On       = true,
                Position = new Vertex(9, -9, 11),
                GLCode   = OpenGL.GL_LIGHT1
            };
            Light light3 = new Light()
            {
                Name     = "Light 3",
                On       = true,
                Position = new Vertex(0, 15, 15),
                GLCode   = OpenGL.GL_LIGHT2
            };
            var folder = new SharpGL.SceneGraph.Primitives.Folder()
            {
                Name = "光照"
            };

            parent.AddChild(folder);
            folder.AddChild(light1);
            folder.AddChild(light2);
            folder.AddChild(light3);
        }
Example #3
0
        public void InitAxis(SceneElement parent)
        {
            var folder = new SharpGL.SceneGraph.Primitives.Folder()
            {
                Name = "Axis"
            };

            parent.AddChild(folder);
            folder.AddChild(new Figures.Axies());
        }
Example #4
0
        private void InitFrameElement(int width, int length, int height, SceneElement parent)
        {
            var folder = new SharpGL.SceneGraph.Primitives.Folder()
            {
                Name = "Frame"
            };

            parent.AddChild(folder);

            var frame = new FrameElement(width, length, height);

            folder.AddChild(frame);
        }
Example #5
0
        private void InitGridElement(float x, float y, float z, float width, float length, SceneElement parent)
        {
            var folder = new SharpGL.SceneGraph.Primitives.Folder()
            {
                Name = "Grid"
            };

            parent.AddChild(folder);

            var grid = new GridElement(x, y, z, width, length);

            folder.AddChild(grid);
        }
        private void InitAxis(SceneElement parent)
        {
            Light light1 = new Light()
            {
                Name     = "Cylinder Axis Root: Light",
                On       = true,
                Position = new Vertex(-9, -9, 11),
                GLCode   = OpenGL.GL_LIGHT0
            };

            parent.AddChild(light1);

            DoInitAxis(light1);
        }
Example #7
0
        private static void DoInitAxis(SceneElement parent)
        {
            // X轴
            Material red = new Material();

            red.Emission = Color.Red;
            red.Diffuse  = Color.Red;

            Cylinder x1 = new Cylinder()
            {
                Name = "X1"
            };

            x1.BaseRadius             = 0.1 * factor;
            x1.TopRadius              = 0.1 * factor;
            x1.Height                 = 1.5 * factor;
            x1.Transformation.RotateY = 90f;
            x1.Material               = red;
            parent.AddChild(x1);

            Cylinder x2 = new Cylinder()
            {
                Name = "X2"
            };

            x2.BaseRadius = 0.2 * factor;
            x2.TopRadius  = 0 * factor;
            x2.Height     = 0.4 * factor;
            x2.Transformation.TranslateX = 1.5f * factor;
            x2.Transformation.RotateY    = 90f;
            x2.Material = red;
            parent.AddChild(x2);

            // Y轴
            Material green = new Material();

            green.Emission = Color.Green;
            green.Diffuse  = Color.Green;

            Cylinder y1 = new Cylinder()
            {
                Name = "Y1"
            };

            y1.BaseRadius             = 0.1 * factor;
            y1.TopRadius              = 0.1 * factor;
            y1.Height                 = 1.5 * factor;
            y1.Transformation.RotateX = -90f;
            y1.Material               = green;
            parent.AddChild(y1);

            Cylinder y2 = new Cylinder()
            {
                Name = "Y2"
            };

            y2.BaseRadius = 0.2 * factor;
            y2.TopRadius  = 0 * factor;
            y2.Height     = 0.4 * factor;
            y2.Transformation.TranslateY = 1.5f * factor;
            y2.Transformation.RotateX    = -90f;
            y2.Material = green;
            parent.AddChild(y2);

            // Z轴
            Material blue = new Material();

            blue.Emission = Color.Blue;
            blue.Diffuse  = Color.Blue;

            Cylinder z1 = new Cylinder()
            {
                Name = "Z1"
            };

            z1.BaseRadius = 0.1 * factor;
            z1.TopRadius  = 0.1 * factor;
            z1.Height     = 1.5 * factor;
            z1.Material   = blue;
            parent.AddChild(z1);

            Cylinder z2 = new Cylinder()
            {
                Name = "Z2"
            };

            z2.BaseRadius = 0.2 * factor;
            z2.TopRadius  = 0 * factor;
            z2.Height     = 0.4 * factor;
            z2.Transformation.TranslateZ = 1.5f * factor;
            z2.Material = blue;
            parent.AddChild(z2);
        }
Example #8
0
        private void InitAxis(SceneElement parent)
        {
            var folder = new SharpGL.SceneGraph.Primitives.Folder()
            {
                Name = "Axis"
            };

            parent.AddChild(folder);

            // X轴
            Material red = new Material();

            red.Emission = Color.Red;
            red.Diffuse  = Color.Red;

            Cylinder x1 = new Cylinder()
            {
                Name = "X1"
            };

            x1.BaseRadius             = 0.05;
            x1.TopRadius              = 0.05;
            x1.Height                 = 1.5;
            x1.Transformation.RotateY = 90f;
            x1.Material               = red;
            folder.AddChild(x1);

            Cylinder x2 = new Cylinder()
            {
                Name = "X2"
            };

            x2.BaseRadius = 0.1;
            x2.TopRadius  = 0;
            x2.Height     = 0.2;
            x2.Transformation.TranslateX = 1.5f;
            x2.Transformation.RotateY    = 90f;
            x2.Material = red;
            folder.AddChild(x2);

            // Y轴
            Material green = new Material();

            green.Emission = Color.Green;
            green.Diffuse  = Color.Green;

            Cylinder y1 = new Cylinder()
            {
                Name = "Y1"
            };

            y1.BaseRadius             = 0.05;
            y1.TopRadius              = 0.05;
            y1.Height                 = 1.5;
            y1.Transformation.RotateX = -90f;
            y1.Material               = green;
            folder.AddChild(y1);

            Cylinder y2 = new Cylinder()
            {
                Name = "Y2"
            };

            y2.BaseRadius = 0.1;
            y2.TopRadius  = 0;
            y2.Height     = 0.2;
            y2.Transformation.TranslateY = 1.5f;
            y2.Transformation.RotateX    = -90f;
            y2.Material = green;
            folder.AddChild(y2);

            // Z轴
            Material blue = new Material();

            blue.Emission = Color.Blue;
            blue.Diffuse  = Color.Blue;

            Cylinder z1 = new Cylinder()
            {
                Name = "Z1"
            };

            z1.BaseRadius = 0.05;
            z1.TopRadius  = 0.05;
            z1.Height     = 1.5;
            z1.Material   = blue;
            folder.AddChild(z1);

            Cylinder z2 = new Cylinder()
            {
                Name = "Z2"
            };

            z2.BaseRadius = 0.1;
            z2.TopRadius  = 0;
            z2.Height     = 0.2;
            z2.Transformation.TranslateZ = 1.5f;
            z2.Material = blue;
            folder.AddChild(z2);
        }