Christopher Johnstone

Rendering seamless 3D panoramas

A tradition in the Galloway lab is to celebrate paper publication by creating a mug. For the recent supercoiling modeling paper, I needed to design something. Mugs are circular and I already had a nice Blender file created for the cover design, could I just wrap chromatin around a (virtual) mug?

Initial mug design in Blender, showing chromatin wrapped around a mug

After some work, the answer is yes! We have a virtual mug surrounded by a continuous loop of chromatin. How do we actual render this into a seamless image?

Blender cameras to the rescue

The default Blender camera is typically either a perspective camera, where parallel lines converge in the distance, or an orthographic camera, where parallel lines remain parallel.

Could we use one of these cameras to render our seamless mug? If we imagined setting a camera on the outside, we could imagine rotating the camera around the centerpoint of the mug, and capture a very thin vertical frame. We could then combine all of these thin vertical slices into a single panorama. This is how we would do it if we were trying to capture such a panorama with our phones.

Several cameras surround the central mug

However, Blender lets us actually directly render panoramic cameras, as long as we are using the raytracing engine, Cycles.

After placing a camera in the center, for the purpose of getting a seamless wrapped image, we can use the equirectangular mode. By using the rendered viewport mode, we can see how the image changes as we tweak settings:

Equirectangular mode

After some compositing, we can easily get a nice, seamless rendering that wraps nicely onto an actual physical mug!