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


Python E.perspective方法代码示例

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


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

示例1: _recreateXmlNode

# 需要导入模块: from collada import E [as 别名]
# 或者: from collada.E import perspective [as 别名]
 def _recreateXmlNode(self):
     perspective_node = E.perspective()
     if self.xfov is not None:
         perspective_node.append(E.xfov(str(self.xfov)))
     if self.yfov is not None:
         perspective_node.append(E.yfov(str(self.yfov)))
     if self.aspect_ratio is not None:
         perspective_node.append(E.aspect_ratio(str(self.aspect_ratio)))
     perspective_node.append(E.znear(str(self.znear)))
     perspective_node.append(E.zfar(str(self.zfar)))
     self.xmlnode = E.camera(
         E.optics(
             E.technique_common(perspective_node)
         )
     , id=self.id, name=self.id)
开发者ID:feilining,项目名称:pycollada,代码行数:17,代码来源:camera.py

示例2: __init__

# 需要导入模块: from collada import E [as 别名]
# 或者: from collada.E import perspective [as 别名]
    def __init__(self, id, fov, near, far, xmlnode = None):
        """Create a new camera.

        :Parameters:
          id
            Id for the object
          fov
            Y axis field of visiona in degrees
          near
            Near plane distance
          far
            Far plane distance
          xmlnode
            If load form xml, the xml node

        """
        self.id = id
        """Id in the camera library."""
        self.fov = fov
        """Field of vision in degrees."""
        self.near = near
        """Near plane distance."""
        self.far = far
        """Far plane distance."""
        self.position = numpy.array( [0, 0, 0], dtype=numpy.float32 )
        """Position in space of the point of view."""
        self.direction = numpy.array( [0, 0, -1], dtype=numpy.float32 )
        """Look direction of the camera."""
        self.up = numpy.array( [0, 1, 0], dtype=numpy.float32 )
        """Up vector of the camera."""
        if xmlnode != None: self.xmlnode = xmlnode
        else:
            self.xmlnode = E.camera(
                E.optics(
                    E.technique_common(
                        E.perspective(
                            E.yfov(str(self.fov)),
                            E.znear(str(self.near)),
                            E.zfar(str(self.far))
                        )
                    )
                )
            , id=self.id, name=self.id)
开发者ID:phaeta,项目名称:pycollada,代码行数:45,代码来源:camera.py

示例3: __init__

# 需要导入模块: from collada import E [as 别名]
# 或者: from collada.E import perspective [as 别名]
    def __init__(self, id, fov, near, far, xmlnode = None):
        """Create a new camera.

        :param str id:
          Id for the object
        :param float fov:
          Y axis field of vision in degrees
        :param float near:
          Near plane distance
        :param float far:
          Far plane distance
        :param xmlnode:
          If loaded from xml, the xml node

        """
        self.id = id
        """Id in the camera library."""
        self.fov = fov
        """Field of vision in degrees."""
        self.near = near
        """Near plane distance."""
        self.far = far
        """Far plane distance."""
        if xmlnode != None:
            self.xmlnode = xmlnode
            """ElementTree representation of the data."""
        else:
            self.xmlnode = E.camera(
                E.optics(
                    E.technique_common(
                        E.perspective(
                            E.yfov(str(self.fov)),
                            E.znear(str(self.near)),
                            E.zfar(str(self.far))
                        )
                    )
                )
            , id=self.id, name=self.id)
开发者ID:rehno-lindeque,项目名称:pycollada,代码行数:40,代码来源:camera.py


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