Example #1
0
        public void AdjustFaceToHumanoid()
        {
            if (FaceNew != null)
            {
                Humanoid.RearrangePointCloud(FaceCut);
                //FaceNew.RotateDegrees(0, 180, 0);

                FaceNew.CalculateBoundingBox();
                FaceCut.CalculateBoundingBox();

                Vector3 v = FaceCut.BoundingBoxMin - FaceNew.BoundingBoxMin;
                FaceNew.Translate(v.X, v.Y, v.Z);
                FaceNew.CalculateBoundingBox();
            }
        }
Example #2
0
        public PointCloud ToPointCloud()
        {
            PointCloud pc = PointCloud.FromListVector3(this.Vectors);

            RearrangePointCloud(pc);


            pc.Name = "humanoid";
            pc.CalculateBoundingBox();
            //pc.Vectors = Vectors;
            return(pc);
        }
Example #3
0
        protected static PointCloud PointCloud_ToImageCloud(PointCloud pc)
        {
            PointCloud pcNew = PointCloud.CloneAll(pc);
            Vector3    v     = new Vector3(-pcNew.BoundingBoxMin.X, -pcNew.BoundingBoxMin.Y, -pcNew.BoundingBoxMin.Z);

            PointCloud.AddVectorToAll(pcNew, v);
            pcNew.CalculateBoundingBox();


            float scaleFactorX = Convert.ToSingle(XDepthMaxKinect) / pcNew.BoundingBoxMax.X;
            float scaleFactorY = Convert.ToSingle(YDepthMaxKinect) / pcNew.BoundingBoxMax.Y;

            Vector3 vScale = new Vector3(scaleFactorX, scaleFactorY, 1000f);

            PointCloud.ScaleByVector(pcNew, vScale);


            pcNew.CalculateBoundingBox();


            return(pcNew);
        }