![](/img/trans.png)
[英]Send and Execute maxscript or python from Maya to 3ds Max
[英]Why does maya return a different value than 3ds max?
為什么Maya對於cos(1)返回的值與3ds Max不同? 我試圖做一個圓形,對此主題感到困惑。
Maya返回:
import math
p = math.cos(1.0)
print p
returns: 0.540302305868
3ds Max返回:
p = cos(1.0)
print p
returns: 0.999848
在3ds Max中,這給了我一個完美的圓。 在Maya中,我不確定會發生什么...希望這只是我所忽略的事情,導致其導致意外行為。
import maya.cmds as cmds
import math
cmds.file(new=True, f=True)
radius = 10
sides = 8
ang = 360.0 / sides
pts = []
for i in range(0,sides):
x = radius * math.cos(i * ang )
y = 0
z = radius * math.sin(i * ang)
pt = (x, y, z)
print i
pts.append(pt)
cmds.curve(d=1, p=pts )
3ds max中的cos
可能期望度數。 而math.cos
期望弧度
In [66]: math.cos(1)
Out[66]: 0.5403023058681397
In [67]: math.cos(math.radians(1)) #Converting 1 degree to radians
Out[67]: 0.9998476951563913
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.