Ejemplo n.º 1
0
        private void AddSkeleton(Viewport3D viewport, Node root, List <Point3D> uniquePoints)
        {
            int childCount = root.Children.Count;

            uniquePoints.Add(root.StartPointWorld);
            if (childCount == 0)   // if leaf node
            {
                return;
            }

            for (int i = 0; i < childCount; i++)
            {
                Node child = root.Children[i];
                child.StartPointWorld.X = root.StartPointWorld.X + child.Offset.X;
                child.StartPointWorld.Y = root.StartPointWorld.Y + child.Offset.Y;
                child.StartPointWorld.Z = root.StartPointWorld.Z + child.Offset.Z;
                SolidColorBrush brush;
                if (child.Children.Count == 0)   // if end node
                {
                    brush = new SolidColorBrush(Colors.Green);
                }
                else

                /*        if (root.Name == "RightKnee") {
                 *          brush = new SolidColorBrush(Colors.Blue);
                 *      }
                 *      else*/
                {
                    brush = new SolidColorBrush(Colors.Red);
                }

                viewport.AddChild(new LineVisual3D(root.StartPointWorld, child.StartPointWorld, brush));
                AddSkeleton(viewport, child, uniquePoints);
            }
        }