Пример #1
0
        private void generateHelpJoints(int index1, int index2, int count, Color limbColor)
        {
            ModelVisual3D mv3d = null;

            JointIndex ji = new JointIndex();

            ji.joint1 = index1;
            ji.joint2 = index2;
            for (int b = 0; b < count; b++)
            {
                mv3d = GraphicPrimitiveGenerator.CreateSphere(
                    new Point3D(0, 0, 0), SmallBllSize, 4, 4, limbColor);
                _models.Add(mv3d);
                ji.visuals.Add(mv3d);

                balls.Add(new BallBoundingBox(0, 0, 0, SmallBllSize, index1, index2));
            }
            jointIndexAray.Add(ji);
        }
Пример #2
0
        public BallModel(List <ModelVisual3D> allModels, Color jointsColors, Color limbsColors)
        {
            //Main joints
            for (int b = 0; b < 21; b++)
            {
                _models.Add(GraphicPrimitiveGenerator.CreateSphere(
                                new Point3D(0, 0, 0), LargeBallSize, 7, 7, jointsColors));
                balls.Add(new BallBoundingBox(0, 0, 0, LargeBallSize, b, b));
            }
            //hip knee
            generateHelpJoints(16, 17, 9, limbsColors);
            //knee ankle
            generateHelpJoints(17, 18, 9, limbsColors);
            //ankle foot
            generateHelpJoints(18, 19, 3, limbsColors);
            //spine base hip right
            generateHelpJoints(0, 16, 1, limbsColors);

            //hip knee
            generateHelpJoints(13, 12, 9, limbsColors);
            //knee ankle
            generateHelpJoints(13, 14, 9, limbsColors);
            //ankle foot
            generateHelpJoints(14, 15, 3, limbsColors);
            //spine base hip right
            generateHelpJoints(0, 12, 1, limbsColors);


            //base mid
            generateHelpJoints(0, 1, 7, limbsColors);
            //mid shoulder
            generateHelpJoints(1, 20, 5, limbsColors);
            //shoulder neck
            //generateHelpJoints(2, 20, 10);
            //head neck
            generateHelpJoints(2, 3, 3, limbsColors);



            //shoulder shoulder
            generateHelpJoints(20, 8, 5, limbsColors);
            //shoulder elbow
            generateHelpJoints(8, 9, 9, limbsColors);
            //elbow wrist
            generateHelpJoints(9, 10, 9, limbsColors);
            //hand wrist

            /*generateHelpJoints(10, 11, 1);
            *  //thumb
            *  generateHelpJoints(11, 24, 1);
            *  //hand tip
            *  generateHelpJoints(11, 23, 1);*/

            //shoulder shoulder
            generateHelpJoints(20, 4, 5, limbsColors);
            //shoulder elbow
            generateHelpJoints(4, 5, 9, limbsColors);
            //elbow wrist
            generateHelpJoints(5, 6, 9, limbsColors);

            //t3DModels = new Transform3D[_models.Count];
            allModels.AddRange(_models);
        }