vulk.math package¶
Submodules¶
vulk.math.interpolation module¶
-
class
vulk.math.interpolation.
ExpIn
(value, power)[source]¶ Bases:
vulk.math.interpolation.Exp
-
class
vulk.math.interpolation.
ExpOut
(value, power)[source]¶ Bases:
vulk.math.interpolation.Exp
-
class
vulk.math.interpolation.
PowIn
(power)[source]¶ Bases:
vulk.math.interpolation.Pow
-
class
vulk.math.interpolation.
PowOut
(power)[source]¶ Bases:
vulk.math.interpolation.Pow
vulk.math.matrix module¶
Matrix module
This module contains all class relative to Matrices. In graphic computing, matrices is a key to manipulate object in space. I recommand you to read this article to understand what is the main goal of matrices: http://www.codinglabs.net/article_world_view_projection_matrix.aspx
-
class
vulk.math.matrix.
Matrix
(values)[source]¶ Bases:
object
Base class for Matrix
-
set2
(values, offset=0)[source]¶ Set this matrix to values from offset
Parameters:
- values: list of float
- offset: Start of the update
-
values
¶
-
-
class
vulk.math.matrix.
Matrix3
(values=None)[source]¶ Bases:
vulk.math.matrix.Matrix
Matrix3 class
-
class
vulk.math.matrix.
Matrix4
(values=None)[source]¶ Bases:
vulk.math.matrix.Matrix
Matrix4 class
-
class
vulk.math.matrix.
ProjectionMatrix
(values=None)[source]¶ Bases:
vulk.math.matrix.Matrix4
This class represents a projection Matrix.
Projection is the last step to compute Vertex position. It must be applied after the view matrix.
-
to_orthographic
(left, right, bottom, top, near, far)[source]¶ Set this matrix to an orthographic projection matrix
Parameters:
- left: Left clipping plane
- right: Right clipping plane
- bottom: Bottom clipping plane
- top: Top clipping plane
- near: Near clipping plane
- far: Far clipping plane
- **Note: Vulkan coordinate system is not the same as OpenGL,
- thus the matrix is adapted to Vulkan**
-
-
class
vulk.math.matrix.
TransformationMatrix
(values=None)[source]¶ Bases:
vulk.math.matrix.Matrix4
This class represents a transformation Matrix.
It’s a Matrix4 with added capabilities used to transform model space to world space.
-
class
vulk.math.matrix.
ViewMatrix
(values=None)[source]¶ Bases:
vulk.math.matrix.Matrix4
This class represents a view Matrix.
View Matrix convert vertex from World space to View space.
vulk.math.plane module¶
vulk.math.shape module¶
vulk.math.vector module¶
Vector module
This module contains all Vector classes definition. Vector are a key of graphic computing.
-
class
vulk.math.vector.
Vector
(values)[source]¶ Bases:
object
Base class for Vector
Exemple:
` v1 += 10 # Add 10 to all components v1 += [10, 9, 8] # Add a different value to each component dot_product = v1 @ v2 # Dot product use the matmul operator `
- **Note: Vector is just a wrapper around a numpy array. You can
- get directly the numpy array if you need more power**
-
crs
(vector)[source]¶ Return the cross product between the two vectors
Parameters:
- vector: Vector of the same size
-
crs2
(values)[source]¶ Set this vector to the cross product with values
Parameters:
- values: list of 3 float
-
size
¶ Return the size of vector
-
values
¶
-
class
vulk.math.vector.
Vector2
(values=None)[source]¶ Bases:
vulk.math.vector.Vector
,vulk.math.vector.XMixin
,vulk.math.vector.YMixin
Vector2 class represents a Vector in 2D space. It has two components x and y.
-
X
= <vulk.math.vector.Vector2 object>¶
-
Y
= <vulk.math.vector.Vector2 object>¶
-
Zero
= <vulk.math.vector.Vector2 object>¶
-
-
class
vulk.math.vector.
Vector3
(values=None)[source]¶ Bases:
vulk.math.vector.Vector
,vulk.math.vector.XMixin
,vulk.math.vector.YMixin
,vulk.math.vector.ZMixin
Vector3 class represents a Vector in 3D space. It has three components x, y and z.
-
X
= <vulk.math.vector.Vector3 object>¶
-
Y
= <vulk.math.vector.Vector3 object>¶
-
Z
= <vulk.math.vector.Vector3 object>¶
-
Zero
= <vulk.math.vector.Vector3 object>¶
-
-
class
vulk.math.vector.
Vector4
(values=None)[source]¶ Bases:
vulk.math.vector.Vector
,vulk.math.vector.XMixin
,vulk.math.vector.YMixin
,vulk.math.vector.ZMixin
,vulk.math.vector.WMixin
Vector4 class represents a Vector in 3D space. It has four components x, y, z, w.