コード例 #1
0
 def rotateCam(self, axis, dtheta):
     rotation_mat = matrix44.create_from_axis_rotation(axis, dtheta)
     self.camLookAt -= self.camPos
     newvec = Vector4.from_vector3(self.camLookAt, 1.0)
     newvec = rotation_mat.dot(newvec)
     self.camLookAt = Vector3.from_vector4(newvec)[0]
     self.camLookAt += self.camPos
コード例 #2
0
ファイル: Affine3d.py プロジェクト: csra/rct-python
 def __apply_transformation_vec3(self, a_point):
     '''
     Applies the transformation to a given Verctor3.
     :param a_point: Vector3
     '''
     return (Matrix33.from_quaternion(self.__rotation_quaternion).T *
             a_point) + Vector3.from_vector4(self.__translation)[0]
コード例 #3
0
ファイル: test_examples.py プロジェクト: RazerM/Pyrr
    def test_conversions(self):
        from pyrr import Quaternion, Matrix33, Matrix44, Vector3, Vector4

        v3 = Vector3([1.,0.,0.])
        v4 = Vector4.from_vector3(v3, w=1.0)
        v3, w = Vector3.from_vector4(v4)

        m44 = Matrix44()
        q = Quaternion(m44)
        m33 = Matrix33(q)

        m33 = Matrix44().matrix33
        m44 = Matrix33().matrix44
        q = Matrix44().quaternion
        q = Matrix33().quaternion

        m33 = Quaternion().matrix33
        m44 = Quaternion().matrix44
コード例 #4
0
ファイル: test_examples.py プロジェクト: spprabhu/Pyrr
    def test_conversions(self):
        from pyrr import Quaternion, Matrix33, Matrix44, Vector3, Vector4

        v3 = Vector3([1., 0., 0.])
        v4 = Vector4.from_vector3(v3, w=1.0)
        v3, w = Vector3.from_vector4(v4)

        m44 = Matrix44()
        q = Quaternion(m44)
        m33 = Matrix33(q)

        m33 = Matrix44().matrix33
        m44 = Matrix33().matrix44
        q = Matrix44().quaternion
        q = Matrix33().quaternion

        m33 = Quaternion().matrix33
        m44 = Quaternion().matrix44