Monoscopic 360 Video

This Generator creates frames suitable display in a Monoscopic 360 video or picture viewer. It constructs an equirectangular projection of every possible angle emanating from the camera's location. The intended purpose is for you to save each frame and make a movie out of it to play in an online 360 video player.

Here is an example:

If you play the video and look around with your mouse or keyboard cursor keys, you will see the camera is in the center of a column of multi-colored rotating cubes. This video is a pre-recorded Processing sketch that has been uploaded to Vimeo. The frames of that video all look like this:

rectangle with columns of colored cubes covering the entire image.

This is distorted, much like the equirectangular world maps we've all seen in school. Visual information for every possible angle is encoded in the image. A 360 video player is programmed to extract that visual information to construct a new image for all viewing angles in real time. Sometimes 360 video is called VR; this is somewhat misleading as VR usually provides richer user interaction beyond simply changing viewing angles. Nevertheless, 360 video has a lot to offer, and happily the Camera3D library can produce content that works in 360 video players.

To use this effectively you must first understand how it works. Imagine you are in the center of a cube where each face of the cube has a unique color. If every viewing angle from that center location was mapped to an equirectangular projection, it might look like this:

rectangle with six colors. Four of them are squares lined up across the center, and the top and bottom are 2 other colors.

This image illustrates how this Generator works. Camera3D will point Processing's camera in one of six different orientations, each corresponding to one face of the cube. The camera's field of view or perspective will be exactly 90 degrees horizontally and vertically, lining up exactly with one cube face. This ensures that all camera angles are covered with no duplication.

When the camera is pointed up, it will render an image like this:

rows of colored cubes extending from the edge of the picture towards the center.

That will be added to the equirectangular projection like this:

rows of colored cubes extending from the top of the image down one third of the height of the image. The rest is black.

Similarly, when the camera is pointed forward it will render an image like this:

three columns of colored cubes.

That will be added to the equirectangular projection like this:

three columns of colored cubes in the center of a large black image.

And so on. This will be repeated for all six camera orientations, creating the finished image.

The necessary code to create these equirectangular projections is simple and is similar to the other Camera3D Generators. Create a Camera3D instance, set the background color, and then select the Monoscopic 360 Generator.

In the below example we are also moving the camera to the origin. That isn't necessary but for these kinds of sketches it does make them easier to code.

void setup() {
  size(500, 500, P3D);
  camera3D = new Camera3D(this);

  // move camera to origin, 0, 0, 0, 0, -1, 0, 1, 0);

Also consider that this Generator will make a minimum of six calls to your draw() method, making performance even more important.

That's the basic idea, but most likely you will want to also save the frames and upload them to a website that supports 360 video like Facebook, Youtube or Vimeo. Refer to Monoscopic 360 Video Best Practices for more information on how to do that and best practices for achieving good results.

The Rotating Cubes example is a simple example demonstrating what can be done with this library. For real inspiration, check out this 360 video made with Camera3D by Raven Kwok: