Tried to invert singular LMatrix3

hi, i get this warning when im setting the scale value for a button. i could life with that warning but im wondering why that warning pops up?

warning:

:linmath(warning): Tried to invert singular LMatrix3.

and thats the button:

perspB = DirectButton(text = ("PERSPview"),pos = (-1.17,0,-.2),command = self.persp, scale = (.05, 0, .05),rolloverSound = "", relief = None)   
perspB.setColorScale(0,0,0,.4)
perspB.setTransparency(1)

or the same when im doing this

perspB = DirectButton(text = ("PERSPview"),command = self.persp, rolloverSound = "", relief = None)   
perspB.setColorScale(0,0,0,.4)
perspB.setTransparency(1)
perspB.setPos(-1.17,0,-.2)
persp.setScale(.05, 0, .05)

thanks for help

greetz
dirk

":linmath(warning): Tried to invert singular LMatrix3. "
are bad errors which say that you have some thing very very small like .001 size and some computations. (rant: we want 64 bit float computations in panda:end). Make sure you don’t scale any thing down too much. Chases are its not the code you showed. But maybe you parent it to some thing small besides aspec2d?

it is that code! its def. one of that buttons! i uncomment that buttons and it works without displaying this warning!

thats the buttons of that modul:

button1 = DirectButton(text = ("LOAD"),pos = (-1.17,0,.2), command = self.load,rolloverSound = "", relief = None)   
        button1.setColorScale(0,0,0,.4)
        button1.setTransparency(1)
        button1.setScale(.05, 0, .05)
        
        perspB = DirectButton(text = ("PERSP"),pos = (-1.17,0,-.2),command = self.persp,rolloverSound = "", relief = None)   
        perspB.setColorScale(0,0,0,.4)
        perspB.setTransparency(1)
        perspB.setScale(.05, 0, .05)
        
        topB = DirectButton(text = ("TOP"),pos = (-1.17,0,-.4) ,command = self.top,rolloverSound = "", relief = None)   
        topB.setColorScale(0,0,0,.4)
        topB.setTransparency(1)
        topB.setScale(.05, 0, .05)
        
        sideB = DirectButton(text = ("SIDE"),pos = (-1.17,0,-.6),command = self.side,rolloverSound = "", relief = None)   
        sideB.setColorScale(0,0,0,.4)
        sideB.setTransparency(1)
        sideB.setScale(.05, 0, .05)

thanks for your comment

A scale like 0.001 is usually fine–the problem comes about when you scale to 0. This creates a singular matrix which cannot be inverted (this is like dividing by zero).

Sometimes Panda needs to invert the matrix in the scene graph, so it’s usually best never to scale anything down to 0.

Note that you are scaling your buttons:

button1.setScale(.05, 0, .05)

to 0 in the Y axis. Of course, you don’t care about the Y axis, so you could put any value at all there. Do this instead:

button1.setScale(.05, 1, .05)

Or even this, to make a nice uniform scale:

button1.setScale(.05, .05, .05)

David

thanks, it works :slight_smile: