簡體   English   中英

有沒有辦法在 VPython 中獲取對象的當前旋轉?

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

我有一個想要獲取當前旋轉的對象,但我似乎找不到有關如何執行此操作的任何信息。 我能想到的唯一方法是在對象上添加一個變量,並准確更改我旋轉對象的程度。

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

有沒有更好的方法來獲取 VPython 中對象的當前旋轉?

從glowscript.org上的向量文檔(點擊“幫助”):

diff_angle(A,B) = A.diff_angle(B),兩個向量之間的角度,以弧度為單位

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM