Jitter

Apply a texture to a shape in OpenGL

The OpenGL object jit.gl.gridshape allows you to create and render standard 3D geometrical shapes (cube, sphere, cone, etc.). It creates those shapes using a number of polygons attached together on a grid, thus its name. To make those objects look a bit more interesting—either more realistic or more unusual—you can apply a texture to the surface of the object. The visual content of the texture comes from a 2D image matrix (e.g., jit.matrix) which then gets wrapped around the object's surface.

Crossfade to new location in a video

To jump immediately to a new location in a movie, you can send the frame message to jit.movie (or jit.qt.movie). To crossfade to a new location, instead of a jump cut, you need to be playing the video twice, and crossfade from the current video to the second video, after which you can stop playing the first video. To do that again, you can just reverse the process: start the first video at the new location, crossfade back to the first video, and stop playing the second one.

Crossfade video and audio

You can make a crossfade between two videos or betwen two sounds by multiplying the amplitude of one of them by values going progressively from 1 to 0 while you multiply the other by values going progressively from 0 to 1. In this example, we use a slider object that outputs values from 0 to 1 to control the volume of two movie soundtracks, using the vol attribute of jit.qt.movie (or jit.movie).