public static OrthoNormalBasis makeFromW(Vector3D w)
        {
            OrthoNormalBasis onb = new OrthoNormalBasis();

            onb.w.set(w);
            onb.w.normalize();
            //w.normalize(onb.w);

            if ((Math.Abs(onb.w.x()) < Math.Abs(onb.w.y())) && (Math.Abs(onb.w.x()) < Math.Abs(onb.w.z())))
            {
                onb.v.X = 0;
                onb.v.Y = onb.w.z();
                onb.v.Z = -onb.w.y();
            }
            else if (Math.Abs(onb.w.y()) < Math.Abs(onb.w.z()))
            {
                onb.v.X = onb.w.z();
                onb.v.Y = 0;
                onb.v.Z = -onb.w.x();
            }
            else
            {
                onb.v.X = onb.w.y();
                onb.v.Y = -onb.w.x();
                onb.v.Z = 0;
            }

            onb.v.normalize();

            onb.u = onb.v.cross(onb.w);
            //Vector3.cross(onb.v.normalize(), onb.w, onb.u);
            return(onb);
        }
        public static OrthoNormalBasis makeFromWV(Vector3D w, Vector3D v)
        {
            OrthoNormalBasis onb = new OrthoNormalBasis();

            onb.w.set(w);
            onb.w.normalize();
            //w.normalize(onb.w);

            onb.u = v.cross(onb.w);
            onb.u.normalize();
            //Vector3.cross(v, onb.w, onb.u).normalize();

            onb.v = onb.w.cross(onb.v);
            //Vector3.cross(onb.w, onb.u, onb.v);

            return(onb);
        }