I've done some extensive research and finally find the answer:
- For shapenet v1, v1_norm = (v-center) / norm(diag)
- For shapenet v2, v2_norm = (v-centroid) / norm(diag)
where:
- 'diag' stands for the bounding box diagonal vector, calculated by 'max' - 'min' from the json.
- 'center' stands for the bounding box center, calculated by ('max'+'min')/2. from the json.
- and the 'centroid' stands for the mean point of all mesh's vertices, from the 'centroid' in the json.
so, v1_norm = v2_norm + (centroid - center) / norm(diag)
and v2_norm = v1_norm + (center - centroid) / norm(diag)
After re-scale, the rotation matrix (left-multiply):
from v2 to v1: np.array([[0, 0, 1], [0, 1, 0], [-1, 0, 0]])
from v1 to v2: np.array([[0, 0, -1], [0, 1, 0], [1, 0, 0]])