diff --git a/kivy/graphics/transformation.pyx b/kivy/graphics/transformation.pyx index 25ce664c8..f882b3a80 100644 --- a/kivy/graphics/transformation.pyx +++ b/kivy/graphics/transformation.pyx @@ -4,10 +4,10 @@ Transformation ============== -This module contains a Matrix class used for our Graphics calculation. We +This module contains a Matrix class used for our Graphics calculations. We currently support: -- rotation, translation and scaling matrix +- rotation, translation and scaling matrices - multiplication matrix - clip matrix (with or without perspective) - transformation matrix for 3d touch @@ -57,7 +57,19 @@ cdef class Matrix: self.identity() cpdef Matrix rotate(Matrix self, double angle, double x, double y, double z): - '''Rotate the matrix with the angle around the axis (x, y, z). + '''Rotate the matrix through the angle around the axis (x, y, z) + (inplace). + + :Parameters: + `angle`: float + The angle through which to rotate the matrix + `x`: float + X position of the point + `y`: float + Y position of the point + `z`: float + Z position of the point + ''' cdef double d, c, s, co, ox, oy, oz, f1, f2, f3, f4, f5, f6, f7, f8, f9 with nogil: @@ -107,7 +119,15 @@ cdef class Matrix: cpdef Matrix scale(Matrix self, double x, double y, double z): '''Scale the current matrix by the specified factors over each dimension (inplace). - ''' + + :Parameters: + `x`: float + The scale factor along the X axis + `y`: float + The scale factor along the Y axis + `z`: float + The scale factor along the Z axis + ''' with nogil: self.mat[ 0] *= x; self.mat[ 5] *= y; @@ -116,7 +136,15 @@ cdef class Matrix: cpdef Matrix translate(Matrix self, double x, double y, double z): '''Translate the matrix. - ''' + + :Parameters: + `x`: float + The translation factor along the X axis + `y`: float + The translation factor along the Y axis + `z`: float + The translation factor along the Z axis + ''' with nogil: self.mat[12] += x self.mat[13] += y @@ -127,6 +155,16 @@ cdef class Matrix: double zNear, double zFar): '''Creates a perspective matrix (inplace). + :Parameters: + `fovy`: float + ??? + `aspect`: float + ??? + `zNear`: float + ??? + `zFar`: float + ??? + .. versionadded:: 1.6.0 ''' cdef double f = 1 / tan(fovy / 2. / 360. * 2 * 3.141592653589793)