【问题标题】:What is the difference between a float and a double in maya?maya中的float和double有什么区别?
【发布时间】:2014-02-11 10:33:49
【问题描述】:

在 Maya 中,当使用 setAttr() 命令时,我们可以使用 float 和 double 作为变量类型。有什么不同?文档中的例子是一样的。

-type float3

Array of three floats
Value Syntax    float float float
Value Meaning   value1 value2 value3
Mel Example     setAttr node.float3Attr -type float3 1.1 2.2 3.3;
Python Example  cmds.setAttr('node.float3Attr',1.1,2.2,3.3,type='float3')

-type double3

Array of three doubles
Value Syntax    double double double
Value Meaning   value1 value2 value3
Mel Example     setAttr node.double3Attr -type double3 1.1 2.2 3.3;
Python Example  cmds.setAttr('node.double3Attr',1.1,2.2,3.3,type='double3')

http://download.autodesk.com/global/docs/maya2014/en_us/CommandsPython/index.html

谢谢!

【问题讨论】:

    标签: python double maya difference setattr


    【解决方案1】:

    浮点数是 32 位的。 双浮点数是 64 位的

    双精度数可以容纳更大、更精确的数字。

    【讨论】:

    • 请注意,这不适用于 Python floats,它是 64 位的。
    • 大多数时候,Maya 使用双精度值来表示小错误更重要的角度值。
    猜你喜欢
    • 2016-03-11
    • 1970-01-01
    • 2021-12-04
    • 2011-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多