コード例 #1
0
        public override void Run(RenderControl render)
        {
            if (!ReadData())
            {
                return;
            }

            var matplot = Matplot.Create("MyMatlab 2020");

            var xRange = new PlotRange(mMinX, mMaxX - 1, 1);
            var yRange = new PlotRange(mMinY, mMaxY - 1, 1);

            matplot.AddSurface(xRange, yRange, (idxU, idxV, u, v) =>
            {
                double x = u;
                double y = v;
                double z = mData[idxU + 1][idxV + 1];

                return(new GPnt(x, y, z));
            });

            var node = matplot.Build(ColorMapKeyword.Create(EnumSystemColorMap.Cooltowarm));

            node.SetPickable(false);

            var pw = new PaletteWidget();

            pw.Update(matplot.GetColorTable());

            render.ShowSceneNode(pw);
            render.ShowSceneNode(node);

            var material = MeshPhongMaterial.Create("font-x");

            material.SetColor(Vector3.Red);
            var shape = FontManager.Instance().CreateMesh("Create a better world!");

            shape.SetMaterial(material);
            var text = new TextSceneNode(shape, 24, true);
            //var text = new TextSceneNode("Wow", 24, new Vector3(1, 1, 0), Vector3.Red, false);
            var tag = TagNode2D.Create(text, new Vector3(15), new Vector3(0));

            render.ShowSceneNode(tag);
        }
コード例 #2
0
        public override void Run(RenderControl render)
        {
            var matplot = Matplot.Create("MyMatlab");

            var xRange = new PlotRange(0, 3.14f * 2, 0.1f);
            var yRange = new PlotRange(0, 3.14f * 2, 0.1f);

            matplot.AddSurface(xRange, yRange, (idxU, idxV, u, v) =>
            {
                double x = u;
                double y = v;
                double z = Math.Sin(u) + Math.Cos(v);

                return(new GPnt(x, y, z));
            });

            var node = matplot.Build(ColorMapKeyword.Create(EnumSystemColorMap.Rainbow));

            node.SetPickable(false);
            render.ShowSceneNode(node);
        }