Use of NonlinearImager()

Just tried NonlinearImager, so far so good except that I can’t get the projector surface being a 3D one.
In any case the ‘screen’ remains flat ie the projection doesn’t seem to accept the underlying geometry attached to its node (here a torus)

exerpt from code:

# define the projection 'screen'
psNode = ProjectionScreen('ps_screen')
psNode.setVignetteOn(1)
ps = darkroom.attachNewNode(psNode)
smi = loader.loadModel('torus') # should be the screen surface!??
smi.setScale(1)
smi.setColor(1,0,1)
smi.reparentTo(ps)

# Generate the mesh to project the image onto.
psNode.regenerateScreen(proj, "screen", 500, 500, 10, 0.6)
psNode.setProjector(proj)

# And create the NonlinearImager
nli = NonlinearImager()
index_screen = nli.addScreen(ps,"ps")           # add screen
nli.setTextureSize(index_screen, 2048, 2048)    # set texture size
nli.setSourceCamera(index_screen, camx)         # add source camera
nli.addViewer(dr1)                              # add viewer (and its associated camera)        
nli.setScreenActive(index_screen, 1)            # activate screen

Going through the thin doc, I guess that the regenerateScreen could be the issue. Actually I’m not so sure I get it right.

Any ideas?

Don’t call regenerateScreen() at all. That’s only necessary if you’re not providing your own screen geometry.

David

Well, if I remove the line:

psNode.regenerateScreen(proj, "screen", 500, 500, 10, 0.6)

The program simply crashes!