Example #1
0
        public Bone(SkeletonViewModel skeleton, string name, IMemory <CmTransform> transformMem, SkeletonService.Bone definition)
        {
            this.poseService = Services.Get <PoseService>();

            this.Skeleton     = skeleton;
            this.Definition   = definition;
            this.BoneName     = name;
            this.transformMem = transformMem;
            this.transformMem.ValueChanged += this.OnTransformMemValueChanged;

            this.rotation = new RotateTransform3D();
            this.scale    = new ScaleTransform3D();
            this.position = new TranslateTransform3D();

            Transform3DGroup transformGroup = new Transform3DGroup();

            transformGroup.Children.Add(this.scale);
            transformGroup.Children.Add(this.rotation);
            transformGroup.Children.Add(this.position);

            this.Transform = transformGroup;

            PaletteHelper ph = new PaletteHelper();

            Sphere sphere = new Sphere();

            sphere.Radius = 0.015;
            System.Windows.Media.Color c1 = ph.GetTheme().Paper;
            c1.A            = 255;
            sphere.Material = new DiffuseMaterial(new SolidColorBrush(c1));
            this.Children.Add(sphere);
        }
Example #2
0
        public Bone(SkeletonViewModel skeleton, string name, IMemory <CmTransform> transformMem, SkeletonService.Bone definition)
        {
            this.Skeleton     = skeleton;
            this.Definition   = definition;
            this.BoneName     = name;
            this.transformMem = transformMem;

            this.Definition   = definition;
            this.BoneName     = name;
            this.transformMem = transformMem;

            this.rotation = new RotateTransform3D();
            this.scale    = new ScaleTransform3D();
            this.position = new TranslateTransform3D();

            Transform3DGroup transformGroup = new Transform3DGroup();

            transformGroup.Children.Add(this.rotation);
            transformGroup.Children.Add(this.scale);
            transformGroup.Children.Add(this.position);
            this.Transform = transformGroup;

            this.sphere          = new Sphere();
            this.sphere.Radius   = 0.01;
            this.sphere.Material = new DiffuseMaterial(new SolidColorBrush(Colors.Gray));
            this.Children.Add(this.sphere);
        }