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


Python common.mtx2rvec方法代码示例

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


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

示例1: render

# 需要导入模块: import common [as 别名]
# 或者: from common import mtx2rvec [as 别名]
def render(self, dst):
        t = self.t
        self.t += 1.0/30.0

        sx, sy = self.grid_size
        center = np.array([0.5*sx, 0.5*sy, 0.0])
        phi = pi/3 + sin(t*3)*pi/8
        c, s = cos(phi), sin(phi)
        ofs = np.array([sin(1.2*t), cos(1.8*t), 0]) * sx * 0.2
        eye_pos = center + np.array([cos(t)*c, sin(t)*c, s]) * 15.0 + ofs
        target_pos = center + ofs

        R, self.tvec = common.lookat(eye_pos, target_pos)
        self.rvec = common.mtx2rvec(R)

        self.draw_quads(dst, self.white_quads, (245, 245, 245))
        self.draw_quads(dst, self.black_quads, (10, 10, 10)) 
开发者ID:makelove,项目名称:OpenCV-Python-Tutorial,代码行数:19,代码来源:video.py

示例2: render

# 需要导入模块: import common [as 别名]
# 或者: from common import mtx2rvec [as 别名]
def render(self, dst):
        t = self.t
        self.t += 1.0 / 30.0

        sx, sy = self.grid_size
        center = np.array([0.5 * sx, 0.5 * sy, 0.0])
        phi = pi / 3 + sin(t * 3) * pi / 8
        c, s = cos(phi), sin(phi)
        ofs = np.array([sin(1.2 * t), cos(1.8 * t), 0]) * sx * 0.2
        eye_pos = center + np.array([cos(t) * c, sin(t) * c, s]) * 15.0 + ofs
        target_pos = center + ofs

        R, self.tvec = common.lookat(eye_pos, target_pos)
        self.rvec = common.mtx2rvec(R)

        self.draw_quads(dst, self.white_quads, (245, 245, 245))
        self.draw_quads(dst, self.black_quads, (10, 10, 10)) 
开发者ID:mengli,项目名称:MachineLearning,代码行数:19,代码来源:video.py


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