private Model3DGroup CreateLeg()
        {
            object extant = FindName("Leg");

            if (extant != null)
            {
                return((Model3DGroup)extant);
            }

            Model3DGroup    thelowerleg = CreateLowerLeg();
            GeometryModel3D thethigh    = GetCanonicalObject("GM3D_Camel_THIGH");

            Model3DGroup theleg = new Model3DGroup();

            theleg.Children.Add(thelowerleg);
            theleg.Children.Add(thethigh);
            theleg.SetValue(NameProperty, "Leg");
            RegisterName("Leg", theleg);

            TRVU_Model3DGroup xyz = new TRVU_Model3DGroup(theleg);

            TRVU_model.Items.Clear();
            TRVU_model.Items.Add(xyz);

            return(theleg);
        }
        private Model3DGroup CreateCamel()
        {
            object extant = FindName("Camel");

            if (extant != null)
            {
                return((Model3DGroup)extant);
            }

            GeometryModel3D thehead  = GetCanonicalObject("GM3D_Camel_HEAD");
            GeometryModel3D thetrunk = GetCanonicalObject("GM3D_Camel_TRUNK");

            Model3DGroup theleg = new Model3DGroup();

            theleg.Children.Add(thehead);
            theleg.Children.Add(thetrunk);
            theleg.SetValue(NameProperty, "Camel");
            RegisterName("Camel", theleg);

            TRVU_Model3DGroup xyz = new TRVU_Model3DGroup(theleg);

            TRVU_model.Items.Clear();
            TRVU_model.Items.Add(xyz);

            return(theleg);
        }
        // This creates a lower leg's components but does not place them relative to each other.
        private Model3DGroup CreateLowerLeg()
        {
            object extant = FindName("LowerLeg");

            if (extant != null)
            {
                return((Model3DGroup)extant);
            }


            GeometryModel3D thefoot = GetCanonicalObject("GM3D_Camel_FOOT");
            GeometryModel3D theshin = GetCanonicalObject("GM3D_Camel_SHIN");
            //						TranslateTransform3D theshin_putinplace = new TranslateTransform3D();
            //						theshin_putinplace.OffsetZ = thefoot.Bounds.SizeZ - 5;
            //						((Transform3DGroup)(theshin.Transform)).Children.Add(theshin_putinplace);
            Model3DGroup thelowerleg = new Model3DGroup();

            thelowerleg.SetValue(NameProperty, "LowerLeg");
            RegisterName("LowerLeg", thelowerleg);
            thelowerleg.Children.Add(thefoot);
            thelowerleg.Children.Add(theshin);


            return(thelowerleg);
        }
예제 #4
0
        private static Model3DGroup Group(string name, Vector3D origin, double xAngle, double yAngle, double zAngle)
        {
            var part = new Model3DGroup();

            part.SetValue(FrameworkElement.NameProperty, name);
            var tg = new Transform3DGroup();

            tg.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 0, 1), zAngle)));
            tg.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), yAngle)));
            tg.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(-1, 0, 0), xAngle)));
            tg.Children.Add(new TranslateTransform3D(origin));
            part.Transform = tg;
            return(part);
        }