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)); }
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)); }
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."); } }
/* * 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); }
public string ToString(VecFormat format) { return(ToString(format, 0)); }