# Real pivot rotation of all vertices in a mesh?

I need to rotate a mesh by actually moving all the vertices, NOT by changing the transform.rotation of the gameobject. In other words, the mesh should rotate by the vertices, but the tranform.rotation of the mesh remains unchanged at 0,0,0.

So, say I have a vertex located at x,y,z of 50,0,50… how would I rotate that vertex by 60 degrees clockwise around the y axis? Assuming the pivot point of the mesh is centered at 0,0,0?

I do it like this:

`````` Vector3 center = new Vector3(x, y, z);//any V3 you want as the pivot point.
Quaternion newRotation = new Quaternion();
newRotation.eulerAngles = new Vector3(0,0,0);//the degrees the vertices are to be rotated, for example (0,90,0)

for(int i = 0; i < vertices.Count; i++) {//vertices being the array of vertices of your mesh
vertices _= newRotation * (vertices *- center) + center;*_
``````

}

if anyone is looking, this tool can move, rotate, and scale a mesh’s vertices without changing the object’s transform.

https://assetstore.unity.com/packages/slug/166155

it also has a bunch of other modeling tools if you want to further edit your mesh.