OpenGL

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.

3D animation of a MIDI note

To do animation in 3D, you need to learn about the jit.gl.* family of Jitter objects. To animate MIDI notes as 3D objects, you’ll need to decide what aspect of the note data you want to map to what aspect of the 3D objects. Here's about the simplest possible patch one could make for visualizing a MIDI note; the pitch of the most recently played note is used to determine the horizontal location of a sphere.