jit.gl.cornerpin allows for mapping of textures and matrices to an output window by repositioning the window corners - essentially a software keystoning mechanism. This can be useful in basic projection mapping, when projecting from odd angles, or when keystoning is inadequate.

When creating OpenGL scenes that need to be software keystoned before final output, you can render the scene to a jit.gl.node and send the entire thing into jit.gl.cornerpin before passing it on to the final render window. This simple patch by forum user DigitalFX does a good job of demonstrating this technique:

-- Pasted Max Patch, click to expand. --

Copy all of the following text.Then, in Max, select New From Clipboard.

For more complex mapping needs, (curved surfaces for example) you can texture a jit.gl.mesh or jit.gl.nurbs object and customize its geometry. This patch lets you customize the z-plane of a 5x5 matrix and then smooth the output using a jit.gl.nurbs. This is then sent to the jit.gl.cornerpin object for rendering.

-- Pasted Max Patch, click to expand. --

Copy all of the following text.Then, in Max, select New From Clipboard.

One great thing about jit.gl.cornerpin is that can be manipulated using the mouse or by sending explicit coordinates. Often you want to use a combination of both and move between the two methods seamlessly. Further, after painstakingly finding the perfect fit, you will probably want to be able to save the state of the patch so you don't have to go through the whole process every time you set up. This example shows you one easy way to make this happen.

-- Pasted Max Patch, click to expand. --

Copy all of the following text.Then, in Max, select New From Clipboard.