[Bf-python] 3DVec * 4x4Matrix issue

Ken Hughes khughes at pacific.edu
Mon Jul 24 15:58:43 CEST 2006


Campbell Barton wrote:
> Just tried and assign vec.w=1  to a 3d matrix dosent work.
> Aside from that, converting to a 4d vec isnt ideal because it wont work 
> for wrapped vecs.
> 
> Would changing the functionality to be like this be acceptable ( in C 
> though )
> 
> mtx= ob.matrixWorld
> vec= vec*mtx
> vec= vec+mtx.translationPart()

The current code always makes a copy of the vector and is checking for a 
3d vect * 4x4 matrix, but then sets vecCopy[3]=0.0.  I just changed this 
to VecCopy[3]=1.0 and everything's fine.  This is in 
row_vector_multiplication() and column_vector_multiplication().

Ken



More information about the Bf-python mailing list