9.3
84 3D: Affine transforms
3D reference map · First 3D picture
Constructs a full affine map. It can represent shear, reflection, and singular
linear maps exactly.
Recognizes a full affine map.
procedure
(affine3-linear map) → linear3?
map : affine3?
Returns the linear component.
procedure
(affine3-translation map) → vec3?
map : affine3?
Returns the translation component.
value
The identity affine map.
procedure
(affine3-compose outer inner) → affine3?
outer : affine3? inner : affine3?
Composes maps as outer ∘ inner.
procedure
(affine3-invert map) → affine3?
map : affine3?
Returns the inverse; singular maps raise an exception.
procedure
(affine3-apply-point map point) → vec3?
map : affine3? point : vec3?
Applies both linear component and translation.
procedure
(affine3-apply-vector map value) → vec3?
map : affine3? value : vec3?
Applies only the linear component.
procedure
(affine3-normal-transform map) → linear3?
map : affine3?
Returns the inverse-transpose normal map.
procedure
(affine3-lerp from to progress) → affine3?
from : affine3? to : affine3? progress : (and/c finite-real? (>=/c 0) (<=/c 1))
Interpolates corresponding matrix entries and translation, with exact endpoints.
struct
(struct transform3 (translation rotation scale) #:transparent) translation : vec3? rotation : rotation3? scale : vec3?
An author-oriented transform with nonzero scale components. It applies local
scale, then rotation, then translation. Negative scale is allowed, but an
interpolation that would cross a zero scale is rejected.
procedure
(make-transform3 [ #:translation translation #:rotation rotation #:scale scale]) → transform3? translation : vec3? = origin3 rotation : rotation3? = identity-rotation3 scale : vec3? = (vec3 1 1 1)
Constructs a validated decomposed transform.
value
The decomposed identity transform.
procedure
(transform3->affine3 transform) → affine3?
transform : transform3?
Converts a decomposed transform to an exact affine map.
procedure
(transform3-compose outer inner) → affine3?
outer : transform3? inner : transform3?
Composes transforms as an affine3, retaining shear that arbitrary
nonuniform-scale composition can induce.
procedure
(transform3-apply-point transform point) → vec3?
transform : transform3? point : vec3?
Applies scale, rotation, then translation.
procedure
(transform3-lerp from to progress) → transform3?
from : transform3? to : transform3? progress : (and/c finite-real? (>=/c 0) (<=/c 1))
Interpolates translation, scale, and shortest-arc rotation with exact endpoints.