Positions of vertices

I’m trying to print a list of vertices. This code which I have written prints a list of vertice positions velative to the centre of the Object. How can I print the positions in global space?

   function Start (){
var mesh1 : Mesh = GetComponent(MeshFilter).mesh;
var vertices : Vector3[] = mesh1.vertices;
var normals : Vector3[] = mesh1.normals;
for (var value : Vector3 in mesh1.vertices) {
var position1 = transform.TransformPoint(value); 
print("mesh1 Vertice at " + position1);
}
var mesh2 : Mesh = object.GetComponent(MeshFilter).mesh;
var vertices2 : Vector3[] = mesh2.vertices;
var normals2 : Vector3[] = mesh2.normals;
for (var myValue : Vector3 in mesh2.vertices) {
var myPosition = transform.TransformPoint(myValue); 
print("mesh2 Vertice at " + myPosition);
}
}

}

Using the transform matrix is fastest.

function Start (){
	var thisMatrix = transform.localToWorldMatrix;
	var vertices = GetComponent.<MeshFilter>().mesh.vertices;
	for (vertex in vertices) {
		print("mesh1 vertex at " + thisMatrix.MultiplyPoint3x4(vertex) );
	}
}

Note that you don’t want to do this:

for (var value : Vector3 in mesh1.vertices) {

You already assigned mesh1.vertices to the local “vertices” variable, so you want to use “vertices”, and not go through “mesh1.vertices”, since that’s quite a bit slower.

Check this out: http://unity3d.com/support/documentation/ScriptReference/Transform.TransformPoint.html