简体   繁体   English

有没有办法在 VPython 中获取对象的当前旋转?

[英]Is there a way to get the current rotation of a object in VPython?

I have a object that I want to get the current rotation of, but I cannot seem to find any information on how to do this.我有一个想要获取当前旋转的对象,但我似乎找不到有关如何执行此操作的任何信息。 The only way I could think of was to add a variable onto the object and change it exactly how much I rotate the object.我能想到的唯一方法是在对象上添加一个变量,并准确更改我旋转对象的程度。

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

Is there any better method to get the current rotation of an object in VPython?有没有更好的方法来获取 VPython 中对象的当前旋转?

From the documentation on vectors at glowscript.org (click "Help"):从glowscript.org上的向量文档(点击“帮助”):

diff_angle(A,B) = A.diff_angle(B), the angle between two vectors, in radians diff_angle(A,B) = A.diff_angle(B),两个向量之间的角度,以弧度为单位

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM