photonmap.Common.Math
Functions
|
Convert a value from range (0 - 1) to (0 - 255) |
|
Convert the quaternion of object from angle(theta, phi) to Vec3(x,y,z) |
|
Calculate the cross product of two vector |
Calculate the axis orthogonal from the vector normal |
|
|
Generate the geometry of a hemisphere |
|
Calculate the average vector of a list |
Module Contents
- photonmap.Common.Math.denormalize(f: float) int [source]
Convert a value from range (0 - 1) to (0 - 255)
Parameters
- f: float
The value to convert
- photonmap.Common.Math.sphericalToCartesian(theta, phi, x_seg, y_seg)[source]
Convert the quaternion of object from angle(theta, phi) to Vec3(x,y,z)
Parameters
- theta: float
The angle theta
- phi: float
The angle phi
- x_seg: int
The number of x segment
- y_seg: int
The number of y segment
- photonmap.Common.Math.crossVector(a, b)[source]
Calculate the cross product of two vector
Parameters
- a: Vec3
The first vector
- b: Vec3
The second vector
- photonmap.Common.Math.orthonormalBasis(n)[source]
Calculate the axis orthogonal from the vector normal
Parameters
- n: Vec3
The normal vector (first axe)
Returns
- t: Vec3
The second axe
- b: Vec3
The third axe