I was wondering how to get precise vertex positions in a mesh (with as many decimal places as needed as
function Start (){
var thisMatrix = transform.localToWorldMatrix;
var vertices = GetComponent.<MeshFilter>().mesh.vertices;
for (vertex in vertices) {
print("mesh1 vertex at " + thisMatrix.MultiplyPoint3x4(vertex) );
}
}
seems to return rounded positions (up to 1 decimal place)
Vertex positions are floating point values - they don’t have any number of fixed decimal places. The print method in your example, however, does truncate values shown in the console because the ToString() method only shows a few decimal places of each component of a vector3.
You’ll probably yield more accurate output in the console window by outputting each float value separately: