Exemplo n.º 1
0
 public void SetZNormal()
 {
     VX = myEndXAxis - myOrigin;
     if (IsSameDbl(VX.Length, 0))
     {
         return;
     }
     VX.Normalise();
     VY = myEndYAxis - myOrigin;
     if (IsSameDbl(VY.Length, 0))
     {
         return;
     }
     VY.Normalise();
     VZ = VX.Cross(VY);
     if (IsSameDbl(VZ.Length, 0))
     {
         return;
     }
     VZ.Normalise();
     VY = VZ.Cross(VX);
     if (IsSameDbl(VY.Length, 0))
     {
         return;
     }
     VY.Normalise();
 }
Exemplo n.º 2
0
        public void SetEndPointBasedOnZVectors()
        {
            int n = 0;

            if (myPts1.Count == 0)
            {
                return;
            }

            //Let's try without this for a while:
            //CompactMarkers()

            myOrigin = ProcessPointListPair(myPts1, mySeenFromCameraPoints, ref n);
            if (myOrigin == null || myOrigin.Length < myTol || n == 0)
            {
                goto quitOut;
            }

            VX = AverageAxis(myPts1, myPts2);
            if (VX == null || VX.Length < myTol)
            {
                goto quitOut;
            }
            VX.Normalise();
            myEndXAxis = myOrigin + VX;

            VY = AverageAxis(myPts1, myPts3);
            if (VY == null || VY.Length < myTol)
            {
                goto quitOut;
            }
            VY.Normalise();
            myEndYAxis = myOrigin + VY;

            SetZNormal();
            myEndXAxis = myOrigin + VX;
            myEndYAxis = myOrigin + VY;

            SetEndPoint();

            return;

quitOut:
            myOrigin   = new clsPoint3d();
            myEndXAxis = new clsPoint3d();
            myEndYAxis = new clsPoint3d();
            myPoint    = new clsPoint3d();
        }