O'Reilly logo

Mastering openFrameworks: Creative Coding Demystified by Denis Perevalov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Image warping and video mapping

Until now, we drew images as rigid rectangles of arbitrary shapes. But there is a possibility to draw an image as if it were made from rubber. To achieve this effect, the image is decomposed into a mesh consisting of a number of triangles or quadrangles (quads). Each triangle or quad is rendered with an arbitrary position on its vertices while preserving adjacency relation in the mesh. This gives a rubbery effect to the image.

Tip

Another way to geometrically achieve image distortion is direct pixel modification of the image, which was discussed earlier. But for big images, such methods often work too slowly.

A faster way to draw images with arbitrary modification is using shaders (see the Creating video effects with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required