Matrix Vector Multipilication (newbie question)

Hi there,

I am new to Panda3D and I was wondering how to perform a matrix-vector multiplication in a pythonic and “pandaic” way.

>>> myvec = Vec3F(0,0,1)
>>> mymat = Mat3F(1,0,0,0,1,0,0,0,1) # identity matrix
>>> mymat * myvec
 TypeError: unsupported operand type(s) for *: 'panda3d.core.LMatrix3f' and 'panda3d.core.LVector3f'

Thanks for answers and suggestions!

I for one never needed to do something like that in python, but looking at the docs ( panda3d.org/reference/devel … .LMatrix3f ) I think you would want the xform method of LMatrix3f

>>> myvec = Vec3F(0,0,1)
>>> mymat = Mat3F(1,0,0,0,1,0,0,0,1)
>>> mymat.xform(myvec)
LVecBase3f(0, 0, 1)

That is exactly what I need, thank you, wezu!
I just did not expect the name xform for a multiplication :wink: