コード例 #1
0
        public override void Run(RenderControl render)
        {
            RedMaterial = MeshPhongMaterial.Create("phong.color");
            RedMaterial.SetColor(Vector3.Red);

            GrayMaterial = MeshPhongMaterial.Create("phong.color");
            GrayMaterial.SetColor(Vector3.LightGray);
            GrayMaterial.SetTransparent(true);
            GrayMaterial.SetOpacity(0.5f);

            var tube = ShapeBuilder.MakeTube(new GPnt(0, 0, 5), GP.DZ(), 10, 2, 50);

            TubeNode = BrepSceneNode.Create(tube, RedMaterial, null);

            var cylinder = ShapeBuilder.MakeCylinder(GP.XOY(), 10, 60, 0);

            CylinderNode = BrepSceneNode.Create(cylinder, GrayMaterial, null);

            render.ShowSceneNode(TubeNode);
            render.ShowSceneNode(CylinderNode);


            var cone = ShapeBuilder.MakeCone(GP.YOZ(), 5, 0, 10, 0);
            var bs   = new BufferShape(cone, RedMaterial, null, 0.1);

            bs.Build();
            ConeNode1 = new BrepSceneNode(bs);
            ConeNode2 = new BrepSceneNode(bs);

            render.ShowSceneNode(ConeNode1);
            render.ShowSceneNode(ConeNode2);
        }