美文网首页
eular angle

eular angle

作者: asl_1da7 | 来源:发表于2020-09-22 10:35 被阅读0次

pytorch3d.transforms.euler_angles_to_matrix详解

⚠️Attention

  • 绕轴旋转时,大拇指指向轴的负方向。例如angle = \pi/2, 绕X轴旋转,大拇指指向-X方向
  • 一般角度都是用弧度表示
  • conversion表示的是旋转的顺序:
    • XYZ表示依次按照 X, Y, Z的顺序旋转
    • ZYX表示依次按照 Z, Y, X的顺序旋转
  • points的坐标右乘旋转矩阵M(x,y,z) · M
  • 连续旋转时,依次在右边添加要乘的旋转矩阵(x,y,z) · M_1·M_2...
    下面是四个例子:
  1. X轴方向选择90°(图中的-X实际是指大拇指指向-X
  2. Z轴方向选择90°(图中的-Z实际是指大拇指指向-Z
  3. 先绕X轴方向选择90°,再绕Z轴方向选择90°
  4. 先绕Z轴方向选择90°,再绕X轴方向选择90°
import pytorch3d.transforms as pyt
import numpy as np
def rotate_matrix(angles, order):
    return pyt.euler_angles_to_matrix(angles, order)

from pytorch3d.transforms import Rotate  
def rotate(m, points):
    return  Rotate(m).transform_points(points)

points =  torch.Tensor([[1,-2,3],[4,5,6]])
  1. X轴方向选择90°(图中的-X实际是指大拇指指向-X
# rotate 90° around the -X direction
angles = torch.Tensor([np.pi/2,0,0])
m = rotate_matrix(angles, "XYZ")
new_points = roate(m, points)
  1. Z轴方向选择90°(图中的-Z实际是指大拇指指向-Z
# rotate 90° around the -Z direction
angles = torch.Tensor([0,0,np.pi/2])
m = rotate_matrix(angles, "XYZ")
new_points = roate(m, points)
  1. 先绕X轴方向选择90°,再绕Z轴方向选择90°
# rotate 90° around the -X direction then rotate 90° around the -Z direction
angles = torch.Tensor([np.pi/2,0,np.pi/2])
m = rotate_matrix(angles, "XYZ")
new_points = roate(m, points)
  1. 先绕Z轴方向选择90°,再绕X轴方向选择90°
# rotate 90° around the -Z direction then rotate 90° around the -X direction
angles = torch.Tensor([np.pi/2,0,np.pi/2])
m = rotate_matrix(angles, "ZYX")
new_points = roate(m, points)
image.png image.png

相关文章

  • eular angle

    pytorch3d.transforms.euler_angles_to_matrix详解 ⚠️Attention...

  • android:angle设置渐变颜色角度

    angle: 0 从左到右angle 90 从下往上angle 180 从右往左angle 270 从上往下ty...

  • Privacy Policy

    The "Angle right angle calculator" app respects and prote...

  • Angle right angle calculator

    This is a convenient and practical triangle calculator th...

  • iOS的旋转

    iOS中的旋转函数CGAffineTransformMakeRotation(angle); 这里的angle使用...

  • Angle

    math家族又要有新成员了~表示angle「角」的词根 angul, angl词根含义:angle;助记词:ang...

  • Angle

    很久没有记录了· 高三如期而至,猝不及防,果然一个手忙脚乱,每天好像热锅上的蚂蚁,你写了一章就有人已经完成了三章,...

  • angle

    在天使与伪天使之间,你会选择哪个?是天使?还是伪天使?师那个纯洁的天使?还是那个已经折翼了的天使?可是,在你...

  • The angle

    你看到了吗 那片云的后面 有一个小小的人儿 她穿着一件白色的衣裳 她有一对白色的翅膀 她的头顶还有一个光环 她在默...

  • Angle

    太开心,太幸福之后却会有一种难过的感觉,这样的经历我猜不会有很多人懂的。那只因我知道这样子的幸福和快乐,不会持续太...

网友评论

      本文标题:eular angle

      本文链接:https://www.haomeiwen.com/subject/qhaiyktx.html