本文整理汇总了Python中collada.E.directional方法的典型用法代码示例。如果您正苦于以下问题:Python E.directional方法的具体用法?Python E.directional怎么用?Python E.directional使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类collada.E
的用法示例。
在下文中一共展示了E.directional方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from collada import E [as 别名]
# 或者: from collada.E import directional [as 别名]
def __init__(self, id, color, xmlnode=None):
"""Create a new sun light.
:Parameters:
id
Id for the object
color
Light color
xmlnode
If load form xml, the xml node
"""
self.id = id
"""Id in the light library."""
# TODO: check if this is actually the initial direction
self.direction = numpy.array([0, 0, 1], dtype=numpy.float32)
"""Incoming direction of the light."""
self.color = color
"""Light color."""
if xmlnode != None:
self.xmlnode = xmlnode
else:
self.xmlnode = E.light(
E.technique_common(E.directional(E.color(" ".join([str(v) for v in self.color])))),
id=self.id,
name=self.id,
)
示例2: __init__
# 需要导入模块: from collada import E [as 别名]
# 或者: from collada.E import directional [as 别名]
def __init__(self, id, color, xmlnode = None):
"""Create a new directional 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 xmlnode:
If loaded from xml, the xml node
"""
self.id = id
"""The unique string identifier for the light"""
self.direction = numpy.array( [0, 0, -1], dtype=numpy.float32 )
#Not documenting this because it doesn't make sense to set the direction
# of an unbound light. The direction 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"""
if xmlnode != None:
self.xmlnode = xmlnode
"""ElementTree representation of the light."""
else:
self.xmlnode = E.light(
E.technique_common(
E.directional(
E.color(' '.join(map(str, self.color)))
)
)
, id=self.id, name=self.id)