コード例 #1
0
        private static Model3DGroup CreateTorus(RotateTransform3D rotateTransform3D, Material material)
        {
            Model3DGroup      model3Dgroup      = new Model3DGroup();
            Model3DCollection model3Dcollection = new Model3DCollection();

            model3Dgroup.Children = model3Dcollection;
            Model3DGroup quarterTorus = Torus.CreateQuarterTorus(0.35, 0.015, 24, 15, material);

            if (rotateTransform3D != null)
            {
                quarterTorus.Transform = (Transform3D) new Transform3DGroup()
                {
                    Children =
                    {
                        (Transform3D)rotateTransform3D
                    }
                }
            }
            ;
            model3Dgroup.Children.Add((Model3D)quarterTorus);
            model3Dgroup.Freeze();
            return(model3Dgroup);
        }
    }