# How to translate object to origin?

I want to rotate a 3D object. On this website http://paulbourke.net/geometry/rotate/

the first step says:

(1) translate space so that the rotation axis passes through the origin

What is meant by "space"? Is it every point on my object? If so, the matrix he provides would just mean that all the points would end up being 0,0,0 when I multiply it by that matrix. That would mean the rotation matrices would have no effect.

No, he's talking about subtracting the position of the cube from the vertex positions, so that your cube is positioned at the origin.

If you positioned the cube at (10, 30, 15), you subtract that value from every vertex.

Next, you rotate the vertices.

Lastly, you add the position to the vertices again so the box goes back to where it was, but the vertices have been rotated around the location of the box.

Doing rotation like this makes an object spin in place.

If you didn't subtract the position before rotating, the object would orbit the origin, instead of spinning in place.

• Thank you, you explained it really well and I was able to visually understand what you just wrote. Also, sorry for replying so late. -Sami – S.A Feb 16 '17 at 17:08

Normally woth rotating objects in 3d you have a pivot. With rotation matrices it is assumed that the pivot is at (0;0;0), the origin. This means that if the pivot is not at (0;0;0), you have to move all the points on that object around so it is. This can easily be done by subtracting the location of the pivot and after the transformation adding it back in. So with translating space they mean that you move all the points so that the pivot point is at the origin. All the points then would not be (0;0;0), just moved. Hope that helped you!