For example, it would let you make a 3D field which transforms the position into some 2D plane, then evaluate a 2D field.
More generally, I think the idea should be to define an N Dimensional field which owns an N-M Dimensional field, and an N+1 x N+1 transform matrix (using homogeneous coordinates). To evaluate the field, the position is transformed by the matrix, then its last M components are dropped to project it into the N-M Dimensional field. Finally, the N-M Dimensional field is evaluated.
We should be able to make an analytical derivative for it, by getting the derivative of the N-M Dimensional field and projecting it backwards into the N Dimensional field. I think this requires that the transform matrix is invertible; if it's not, then warn the user (see #11) and fall back to finite differences.
For example, it would let you make a 3D field which transforms the position into some 2D plane, then evaluate a 2D field.
More generally, I think the idea should be to define an N Dimensional field which owns an N-M Dimensional field, and an N+1 x N+1 transform matrix (using homogeneous coordinates). To evaluate the field, the position is transformed by the matrix, then its last M components are dropped to project it into the N-M Dimensional field. Finally, the N-M Dimensional field is evaluated.
We should be able to make an analytical derivative for it, by getting the derivative of the N-M Dimensional field and projecting it backwards into the N Dimensional field. I think this requires that the transform matrix is invertible; if it's not, then warn the user (see #11) and fall back to finite differences.