- structVec3 :: [Float] -> [Vec3]
- destructVec3 :: [Vec3] -> [Float]
- det3 :: Vec3 -> Vec3 -> Vec3 -> Float
- translate3X :: Float -> Vec3 -> Vec3
- translate3Y :: Float -> Vec3 -> Vec3
- translate3Z :: Float -> Vec3 -> Vec3
- vec3X :: Vec3
- vec3Y :: Vec3
- vec3Z :: Vec3
- rotMatrixZ :: Float -> Mat3
- rotMatrixY :: Float -> Mat3
- rotMatrixX :: Float -> Mat3
- rotate3' :: Float -> Normal3 -> Vec3 -> Vec3
- rotate3 :: Float -> Vec3 -> Vec3 -> Vec3
- rotMatrix3 :: Vec3 -> Float -> Mat3
- rotMatrixOrtho3 :: Vec3 -> Float -> Ortho3
- rotMatrix3' :: Normal3 -> Float -> Mat3
- rotMatrixOrtho3' :: Normal3 -> Float -> Ortho3
- reflect :: Normal3 -> Vec3 -> Vec3
- reflect' :: Normal3 -> Normal3 -> Normal3
- refract :: Float -> Normal3 -> Vec3 -> Vec3
- refract' :: Float -> Normal3 -> Normal3 -> Normal3
- refractOnly' :: Float -> Normal3 -> Normal3 -> Maybe Normal3
Documentation
structVec3 :: [Float] -> [Vec3]Source
Example: structVec3 [1,2,3,4,5,6] = [ Vec3 1 2 3 , Vec3 4 5 6]
.
destructVec3 :: [Vec3] -> [Float]Source
The opposite of structVec3.
translate3X :: Float -> Vec3 -> Vec3Source
translate3Y :: Float -> Vec3 -> Vec3Source
translate3Z :: Float -> Vec3 -> Vec3Source
rotMatrixZ :: Float -> Mat3Source
rotMatrixY :: Float -> Mat3Source
rotMatrixX :: Float -> Mat3Source
rotMatrix3 :: Vec3 -> Float -> Mat3Source
Rotation around an arbitrary 3D vector. The resulting 3x3 matrix is intended for multiplication on the right.
rotMatrixOrtho3 :: Vec3 -> Float -> Ortho3Source
rotMatrix3' :: Normal3 -> Float -> Mat3Source
Rotation around an arbitrary 3D unit vector. The resulting 3x3 matrix is intended for multiplication on the right.
rotMatrixOrtho3' :: Normal3 -> Float -> 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' :: Float -> 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)