rearrange transform3d for gpu