当前位置: 首页>>代码示例>>Python>>正文


Python E.falloff_exponent方法代码示例

本文整理汇总了Python中collada.E.falloff_exponent方法的典型用法代码示例。如果您正苦于以下问题:Python E.falloff_exponent方法的具体用法?Python E.falloff_exponent怎么用?Python E.falloff_exponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在collada.E的用法示例。


在下文中一共展示了E.falloff_exponent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from collada import E [as 别名]
# 或者: from collada.E import falloff_exponent [as 别名]
    def __init__(self, id, color, constant_att=None, linear_att=None, quad_att=None,
                    falloff_ang=None, falloff_exp=None, xmlnode = None):
        """Create a new spot light.

        :param str id:
          A unique string identifier for the light
        :param tuple color:
          Either a tuple of size 3 containing the RGB color value
          of the light or a tuple of size 4 containing the RGBA
          color value of the light
        :param float constant_att:
          Constant attenuation factor
        :param float linear_att:
          Linear attenuation factor
        :param float quad_att:
          Quadratic attenuation factor
        :param float falloff_ang:
          Falloff angle
        :param float falloff_exp:
          Falloff exponent
        :param xmlnode:
          If loaded from xml, the xml node

        """
        self.id = id
        """The unique string identifier for the light"""
        self.position = numpy.array( [0, 0, 0], dtype=numpy.float32 )
        #Not documenting this because it doesn't make sense to set the position
        # of an unbound light. The position isn't set until binding in a scene.
        self.color = color
        """Either a tuple of size 3 containing the RGB color value
          of the light or a tuple of size 4 containing the RGBA
          color value of the light"""
        self.constant_att = constant_att
        """Constant attenuation factor."""
        self.linear_att = linear_att
        """Linear attenuation factor."""
        self.quad_att = quad_att
        """Quadratic attenuation factor."""
        self.falloff_ang = falloff_ang
        """Falloff angle"""
        self.falloff_exp = falloff_exp
        """Falloff exponent"""
        
        if xmlnode != None:
            self.xmlnode = xmlnode
            """ElementTree representation of the light."""
        else:
            pnode = E.spot(
                E.color(' '.join(map(str, self.color ) )),
            )
            if self.constant_att is not None:
                pnode.append(E.constant_attenuation(str(self.constant_att)))
            if self.linear_att is not None:
                pnode.append(E.linear_attenuation(str(self.linear_att)))
            if self.quad_att is not None:
                pnode.append(E.quadratic_attenuation(str(self.quad_att)))
            if self.falloff_ang is not None:
                pnode.append(E.falloff_angle(str(self.falloff_ang)))
            if self.falloff_exp is not None:
                pnode.append(E.falloff_exponent(str(self.falloff_exp)))
            
            self.xmlnode = E.light(
                E.technique_common(pnode)
            , id=self.id, name=self.id)
开发者ID:rehno-lindeque,项目名称:pycollada,代码行数:67,代码来源:light.py

示例2: __init__

# 需要导入模块: from collada import E [as 别名]
# 或者: from collada.E import falloff_exponent [as 别名]
    def __init__(
        self,
        id,
        color,
        constant_att=None,
        linear_att=None,
        quad_att=None,
        falloff_ang=None,
        falloff_exp=None,
        xmlnode=None,
    ):
        """Create a new spot light.

        :param str id:
          A unique string identifier for the light
        :param tuple color:
          Either a tuple of size 3 containing the RGB color value
          of the light or a tuple of size 4 containing the RGBA
          color value of the light
        :param float constant_att:
          Constant attenuation factor
        :param float linear_att:
          Linear attenuation factor
        :param float quad_att:
          Quadratic attenuation factor
        :param float falloff_ang:
          Falloff angle
        :param float falloff_exp:
          Falloff exponent
        :param xmlnode:
          If loaded from xml, the xml node

        """
        self.id = id
        """The unique string identifier for the light"""
        self.color = color
        """Either a tuple of size 3 containing the RGB color value
          of the light or a tuple of size 4 containing the RGBA
          color value of the light"""
        self.constant_att = constant_att
        """Constant attenuation factor."""
        self.linear_att = linear_att
        """Linear attenuation factor."""
        self.quad_att = quad_att
        """Quadratic attenuation factor."""
        self.falloff_ang = falloff_ang
        """Falloff angle"""
        self.falloff_exp = falloff_exp
        """Falloff exponent"""

        if xmlnode != None:
            self.xmlnode = xmlnode
            """ElementTree representation of the light."""
        else:
            pnode = E.spot(E.color(" ".join(map(str, self.color))))
            if self.constant_att is not None:
                pnode.append(E.constant_attenuation(str(self.constant_att)))
            if self.linear_att is not None:
                pnode.append(E.linear_attenuation(str(self.linear_att)))
            if self.quad_att is not None:
                pnode.append(E.quadratic_attenuation(str(self.quad_att)))
            if self.falloff_ang is not None:
                pnode.append(E.falloff_angle(str(self.falloff_ang)))
            if self.falloff_exp is not None:
                pnode.append(E.falloff_exponent(str(self.falloff_exp)))

            self.xmlnode = E.light(E.technique_common(pnode), id=self.id, name=self.id)
开发者ID:timknip,项目名称:pycollada,代码行数:69,代码来源:light.py


注:本文中的collada.E.falloff_exponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。