【问题标题】:Is there a way to get the current rotation of a object in VPython?有没有办法在 VPython 中获取对象的当前旋转?
【发布时间】:2020-08-30 02:15:07
【问题描述】:

我有一个想要获取当前旋转的对象,但我似乎找不到任何有关如何执行此操作的信息。我能想到的唯一方法是在对象上添加一个变量,并准确地更改我旋转对象的程度。

test.rotate(test.rotational_velocity * dt, vec(0, 0, 1))
test.angle += test.rotational_velocity * dt

有没有更好的方法来获取 VPython 中对象的当前旋转?

【问题讨论】:

  • 我认为使用自己的text.angle 可能是唯一的解决方案。

标签: python object vector rotation vpython


【解决方案1】:

来自glowscript.org 上的向量文档(点击“帮助”):

diff_angle(A,B) = A.diff_angle(B),两个向量之间的角度,单位为弧度

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多