- structVec3 :: [Double] -> [Vec3]
- destructVec3 :: [Vec3] -> [Double]
- det3 :: Vec3 -> Vec3 -> Vec3 -> Double
- translate3X :: Double -> Vec3 -> Vec3
- translate3Y :: Double -> Vec3 -> Vec3
- translate3Z :: Double -> Vec3 -> Vec3
- vec3X :: Vec3
- vec3Y :: Vec3
- vec3Z :: Vec3
- rotMatrixZ :: Double -> Mat3
- rotMatrixY :: Double -> Mat3
- rotMatrixX :: Double -> Mat3
- rotate3' :: Double -> Normal3 -> Vec3 -> Vec3
- rotate3 :: Double -> Vec3 -> Vec3 -> Vec3
- rotMatrix3 :: Vec3 -> Double -> Mat3
- rotMatrixOrtho3 :: Vec3 -> Double -> Ortho3
- rotMatrix3' :: Normal3 -> Double -> Mat3
- rotMatrixOrtho3' :: Normal3 -> Double -> Ortho3
- reflect :: Normal3 -> Vec3 -> Vec3
- reflect' :: Normal3 -> Normal3 -> Normal3
- refract :: Double -> Normal3 -> Vec3 -> Vec3
- refract' :: Double -> Normal3 -> Normal3 -> Normal3
- refractOnly' :: Double -> Normal3 -> Normal3 -> Maybe Normal3
Documentation
structVec3 :: [Double] -> [Vec3]Source
Example: structVec3 [1,2,3,4,5,6] = [ Vec3 1 2 3 , Vec3 4 5 6]
.
destructVec3 :: [Vec3] -> [Double]Source
The opposite of structVec3.
translate3X :: Double -> Vec3 -> Vec3Source
translate3Y :: Double -> Vec3 -> Vec3Source
translate3Z :: Double -> Vec3 -> Vec3Source
rotMatrixZ :: Double -> Mat3Source
rotMatrixY :: Double -> Mat3Source
rotMatrixX :: Double -> Mat3Source
rotMatrix3 :: Vec3 -> Double -> Mat3Source
Rotation around an arbitrary 3D vector. The resulting 3x3 matrix is intended for multiplication on the right.
rotMatrixOrtho3 :: Vec3 -> Double -> Ortho3Source
rotMatrix3' :: Normal3 -> Double -> Mat3Source
Rotation around an arbitrary 3D unit vector. The resulting 3x3 matrix is intended for multiplication on the right.
rotMatrixOrtho3' :: Normal3 -> Double -> Ortho3Source
reflect :: Normal3 -> Vec3 -> Vec3Source
Reflects a vector to an axis: that is, the result of reflect n v
is
2<n,v>n - v
refract' :: Double -> Normal3 -> Normal3 -> Normal3Source
Refraction.
First parameter (eta
) is the relative refraction index
refl_inside eta = -------------- refl_outside
where "inside" is the direction of the second argument
(to vector normal to plane which models the boundary
between the two materials). That is, total internal reflection
can occur when eta>1
.
The convention is that the origin is the point of intersection
of the ray and the surface, and all the vectors "point away"
from here (unlike, say, GLSL's refract
, where the incident
vector "points towards" the material)