コード例 #1
0
        private static Model3DGroup CreateAxisAndArrowHead(RotateTransform3D rotateTransform, TranslateTransform3D translateTransform, Material material)
        {
            Model3DGroup      model3Dgroup      = new Model3DGroup();
            Model3DCollection model3Dcollection = new Model3DCollection();

            model3Dgroup.Children = model3Dcollection;
            Model3DGroup cylinder = Cylinder.CreateCylinder(0.02, 0.5, 12, material, material, (Material)null);

            if (rotateTransform != null)
            {
                cylinder.Transform = (Transform3D)rotateTransform;
            }
            model3Dgroup.Children.Add((Model3D)cylinder);
            Model3DGroup cone = Cone.CreateCone(0.04, 0.1, 12, material, material);

            if (rotateTransform != null)
            {
                cone.Transform = (Transform3D) new Transform3DGroup()
                {
                    Children =
                    {
                        (Transform3D)rotateTransform,
                        (Transform3D)translateTransform
                    }
                }
            }
            ;
            else
            {
                cone.Transform = (Transform3D)translateTransform;
            }
            model3Dgroup.Children.Add((Model3D)cone);
            model3Dgroup.Freeze();
            return(model3Dgroup);
        }