rototranslate#
- smplfitter.np.BodyModel.rototranslate(R, t=None, pose_rotvecs=None, shape_betas=None, trans=None, kid_factor=0, post_translate=True)[source]#
Rotates and translates the body in parametric form.
If post_translate is True, the translation is added after rotation by R, as:
M(new_pose_rotvec, shape, new_trans) = R @ M(pose_rotvecs, shape, trans) + t, where M is the body model forward function.
If post_translate is False, the translation is subtracted before rotation by R, as:
M(new_pose_rotvec, shape, new_trans) = R @ (M(pose_rotvecs, shape, trans) - t)
- Parameters:
R – Rotation matrix, shaped as (3, 3).
t – Translation vector, shaped as (3,). Defaults to zero (pure rotation).
pose_rotvecs – Initial rotation vectors per joint, shaped as (num_joints * 3,).
shape_betas – Shape coefficients (betas) for body shape, shaped as (num_betas,).
trans – Initial translation vector, shaped as (3,).
kid_factor – Optional in case of kid shapes like in AGORA. Shaped as (1,).
post_translate – Flag indicating whether to apply the translation after rotation. If True, t is added after rotation by R; if False, t is subtracted before rotation by R.
- Returns:
- A tuple containing
new_pose_rotvec – Updated pose rotation vectors, shaped as (num_joints * 3,).
new_trans – Updated translation vector, shaped as (3,).
- Return type:
Notes
Rotating a parametric representation is nontrivial because the global orientation (first three rotation parameters) performs the rotation around the pelvis joint instead of the origin of the canonical coordinate system. This method takes into account the offset between the pelvis joint in the shaped T-pose and the origin of the canonical coordinate system.