6
$\begingroup$

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.

$\endgroup$

2 Answers 2

8
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ 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 $\endgroup$
    – S.A
    Feb 16, 2017 at 17:08
2
$\begingroup$

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!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.