Tutorials

Recipe 55: MirrorHouse

General Principles

  • Using 3D cameras and feedback to create complex patterns

  • Working with multiple jit.gl.camera objects and capturing to textures

Commentary

This patch takes 4 different camera views of the same 3D scene and maps it onto 4 different videoplanes. By altering the relationship between the cameras and their output planes, we can get some pretty stunning feedback. The result is exquisite and complex repetitive visual patterns without any inputs, similar to a house of mirrors or kaleidoscope.

Ingredients

  • jit.gl.videoplane

  • jit.gl.camera

  • jit.anim.node

Technique

To begin with, we have 4 jit.gl.videoplane objects arranged in a cross pattern and each rotated inward 45 degrees. For each videoplane, there is a jit.gl.camera feeding textures to it. Each of these cameras has capturing turned on, and is outputting a texture of the scene. By default, these cameras are in the same position and rotation, but move the pictsliders and you'll be able to spread them out and reorient the cameras.

The texture output of the jit.gl.camera objects is passed through a jit.gl.slab object with a color scale-bias effect loaded. The jit.gl.slab provides some basic color manipulation, but is also necessary to add another texture capture stage so that the feedback doesn't glitch out. OpenGL doesn't like it when you try to capture to a texture that you are also rendering in the scene. Passing the texture through jit.gl.slab avoids that situation.

Finally, we have another jit.gl.camera in the scene with no capturing happening, just to render it onscreen.

by Andrew Benson on June 7, 2012

Bluebirdo's icon

This is an awesome patch, and I had a great time basing a class project off of this patch, so thank you for that Andrew. One question though, how can I save this as a functioning application? My problem is that when I export this as an application, the application can't access the "cc.scalebias.jxs" shader file. I tried including it from its proper place (where it was automatically installed when I installed Max). Have you ever tried to export a standalone application from this Mirrorhouse patch? If so, how did you deal with the cc.scalebias.jxs issue? I'd love to be able to show this to friends and family, but without a way to successfully create an application from this, I'm dead in the water.

SlyWalker's icon

I'm trying to blend a sketch like this with a video source back and forth using xfade. I'm having trouble putting the right input into the xfade. Do I need to have the static jit.gl.camera going to a matrix and then to the xfade?
HELP!

mel's icon

How can I turn this into a video with MIDI input?