direct.showbase.MirrorDemo broken

code:

#!/usr/bin/env python

from direct.showbase.ShowBase import ShowBase
ShowBase()
import direct.showbase.MirrorDemo as MD

MD.setupMirror("mymirror", 20, 15)

run()

output:

Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)
:pgraph(warning): Using deprecated ClipPlaneAttrib interface.
Assertion failed: !mat.is_nan() at line 286 of panda/src/pgraph/transformState.cxx
Assertion failed: has_mat() at line 585 of built/include/transformState.I
Traceback (most recent call last):
  File "/opt/panda3d/direct/src/showbase/ShowBase.py", line 1561, in __igLoop
    self.graphicsEngine.renderFrame()
AssertionError: !mat.is_nan() at line 286 of panda/src/pgraph/transformState.cxx
:task(error): Exception occurred in PythonTask igLoop
Traceback (most recent call last):
  File "mirror.py", line 10, in <module>
    run()
  File "/opt/panda3d/direct/src/showbase/ShowBase.py", line 2420, in run
    self.taskMgr.run()
  File "/opt/panda3d/direct/src/task/TaskNew.py", line 471, in run
    self.step()
  File "/opt/panda3d/direct/src/task/TaskNew.py", line 429, in step
    self.mgr.poll()
  File "/opt/panda3d/direct/src/showbase/ShowBase.py", line 1561, in __igLoop
    self.graphicsEngine.renderFrame()
AssertionError: !mat.is_nan() at line 286 of panda/src/pgraph/transformState.cxx

CVS says, the file hasn’t been updated for about 2 years. somebody willing to update it? (i don’t really have an idea where the bug is)

cheers

how crap where did you dig this up!?

It’s in direct/src/showbase, has been there for years.

You need to take the mirror geometry returned by setupMirror(), and put it in the scene somewhere not in the same place as the camera, like this:

card = MD.setupMirror("mymirror", 20, 15)
card.reparentTo(render)
card.setPos(0, 20, 0)
card.setHpr(180, 0, 0)

David

thanks david :smiley:

from time to time i’m browsing the panda director. there’s much cool stuff nobody knows about. most of it isn’t listed on the reference page and/or commented a way the reference script can’t read.

should i post more often about some secret panda stuff? :slight_smile:

btw, here’s a full script for the case you want to test the mirror stuff yourself:

#!/usr/bin/env python

from direct.showbase.ShowBase import ShowBase
ShowBase()
import direct.showbase.MirrorDemo as MD

m = loader.loadModel("panda")
m.reparentTo(render)

card = MD.setupMirror("mymirror", 20, 30)
card.reparentTo(render)
card.setPos(0, 20, 0)
card.setHpr(180, 0, 0)

run()