Started adding parameter info

This commit is contained in:
Zen-CODE 2014-05-29 22:41:58 +02:00
parent 33d3a412e2
commit a9587cac6a
1 changed files with 43 additions and 5 deletions

View File

@ -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,6 +119,14 @@ 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;
@ -116,6 +136,14 @@ 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
@ -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)