Re: [AD] Proposal for new matrix functions

[ Thread Index | Date Index | More Archives ]

> To multiply a 3D vector with a 4x4 matrix, one will need to pad the vector
> with 1.0. Eg the vector (x, y, z) -> (x, y, z, 1.0). There's nothing
> wrong with that, but Allegro makes it impossible to do a 3x3
> multiplication. My suggestion is to add a new matrix multiplication
> function that does a 3D vector X 3x3 matrix multiplication. Eg. w=0.

Then apply_matrix_rotation() is not well-chosen since it will do scaling as 

> This could of course be done with a custom matrix, but it is really
> ugly to have two matrices, with one being a copy of the other with
> the translation part zeroed out. => 0 * N = 0 and N * 0 = 0.

Good point.

> That's why I called them apply_matrix_rotation(..) and
> apply_matrix_translation(..). These names make the complement behaviour
> evident.

Not for the first one.

Ok, I agree to the proposal. Note, however, that you need to simultaneously 
add the floating point version of both functions, which must be coded in asm 
for the x86 platform (see src/i386/imisc.s).

Eric Botcazou

Mail converted by MHonArc 2.6.19+