Fisheye Lens (slight return)

Hello All,

I’ve been using Panda3D for a few years now in our dome. With help from the community here I managed to create my own fisheye rig: … ht=fisheye

This homebrew rig was due to never really getting this code to work properly:

Recently we’ve noticed some flaws in our implementation, and since Panda3D seems to be receiving some love, I thought I’d ask about the status of the built-in fisheye implementation. It seems to be mentioned in both the Python and C++ APIs,

and I’m looking at the source files from CVS…when I try to use this though I get

:display(error): glxGraphicsStateGuardian cannot render scene with specified lens.

I’ve been using a lot of other realtime 3D environments lately, and really appreciate the sanity of the API, so if I can get a correct fisheye projection I’d like to base future projects on Panda

The FisheyeLens is not intended to be assigned directly to a rendering camera, because it is not supported by the rendering backend (though it would probably be possible to write a shader to do this).

It is intended to be used with the NonlinearImager, as showing in the posts you reference; and this doesn’t require any particular shader support–it works by rendering offscreen into a buffer, then applying that buffer to a distorted mesh. I just pasted in the code in the thread you linked, and it still works fine for me (after correcting for the deprecated upcastToPandaNode() call), even on Linux. I get a nice little fisheye-view of the world.

Can you tell me more about the way in which your attempts are failing?


I’ve just downloaded it, and it works for me too.

I think my unfamiliarity with Panda, and the interaction with Panda and Linux at the time must have put me off the scent.

Many thanks