Hello, I’m a college student attempting to create a special relativity simulator for my physics class. I’m using Panda3d and learning it as I go. So far, my program creates a lattice of objects that move from in front of the camera to behind and then jump back in front and repeat, creating an effectively infinite lattice that the camera appears to be moving through. I’m having trouble finding a way to create the relativistic distortions, though.
The effect I want to simulate is the aberration of light. Basically, things bunch forward, so that if you’re traveling fast enough, something to the right of the viewer (90 degrees from forward) would appear to be in front of the viewer (say, 40 degrees from forward). Something at, say, 150 degrees from forward, or behind the camera, would appear at maybe 70 degrees from forward, in front of the camera. The degree of this effect increases with higher velocity, so the object at 90 degrees appears to be at 90 degrees with 0 velocity and approaches an apparent angle of 0 degrees as velocity approaches the speed of light. (This page explains the effect and has pictures and diagrams from their own simulation starting halfway down, if you’re curious.)
The way I was planning to do this is to use a FilterManager to apply the relativistic distortions in a post-processing fragment shader. The shader will have the current velocity passed to it and use this to properly warp the image and display the right things on-screen. Since things behind the camera need to appear in front of the camera, the shader needs some sort of panoramic, 360-degree view rendered to a texture as its input, and I’m at a loss how to do this. I’ve tried using base.camLens.setFov(), but a field of view of 185 degrees seems to just be a mirror image of a field of view of 175 degrees, so I can’t seem to get a 360-degree image that way.
Can anyone help me find a way to render a 360-degree panorama? Or, since I’m new to Panda, is there a completely different, better way to go about this that I’m not aware of?
Thank you!