示例#1
0
        public string ToString(VecFormat format)
        {
            string fmt = "{0} {1} {2} {3}";

            switch (format)
            {
            case VecFormat.CommaSeparated: fmt = "{0}, {1}, {2}, {3}"; break;

            case VecFormat.Braced: fmt = "({0}, {1}, {2}, {3})"; break;
            }

            return(String.Format(fmt, X, Y, Z, W));
        }
示例#2
0
        public string ToString(VecFormat format, int inc)
        {
            string fmt = "{0} {1} {2}";

            switch (format)
            {
            case VecFormat.CommaSeparated: fmt = "{0}, {1}, {2}"; break;

            case VecFormat.Braced: fmt = "({0}, {1}, {2})"; break;
            }

            return(String.Format(fmt, x + inc, y + inc, z + inc));
        }
示例#3
0
        public string ToString(VecFormat format)
        {
            switch (format)
            {
            case VecFormat.CommaSeparated: return($"{X}, {Y}, {Z}");

            case VecFormat.Braced: return($"({X}, {Y}, {Z})");

            case VecFormat.Hex: return($"{X.ToString("X2")}, {Y.ToString("X2")}, {Z.ToString("X2")}");

            default: throw new NotSupportedException("Unknown VecFormat.");
            }
        }
示例#4
0
        /*
         * public string ToObjVertex()
         * {
         *  return "v " + X + " " + Y + " " + Z;
         * }
         */

        public string ToString(VecFormat format)
        {
            string fmt = "{0} {1} {2}";

            switch (format)
            {
            case VecFormat.CommaSeparated: fmt = "{0}, {1}, {2}"; break;

            case VecFormat.Braced: fmt = "({0}, {1}, {2})"; break;
            }

            return(String.Format(fmt, x, y, z));

            //float scale = 1.0f / 2.33f;
            //return String.Format(fmt, x * scale, y * scale, z * scale);
        }
示例#5
0
 public string ToString(VecFormat format)
 {
     return(ToString(format, 0));
 }