Tutorials:Ofelia Tutorial/Examples



These are the folders that live in ofelia/examples, you can see them in puredata by going to Help -> Browser (or doing Ctrl + B), then, inside the browser window, externals -> ofelia -> examples.

3d/

 * /3dPrimitives/
 * This example shows how 3d primitives can be drawn on the screen with the lights and material.
 * /coloredCube/
 * This example draws a cube with color gradients using ofMesh. An ofMesh represents a set of vertices in 3D spaces, and normal at those points, colors at those points, and texture coordinates at those points. Each of these different properties is stored in a vector.

drawing/

 * /continuousLines/
 * This example shows how to draw curves using the mouse. Left click and drag draw the curves, and right click clear the stored curves.
 * /pattern/
 * This example draws circles which size depends on the speed of the mouse. It is based on this processing example: https://processing.org/examples/pattern.html

fbo/

 * /trails/
 * This example shows how to create a simple trailing effect using the fbo. This example is based on the openFrameworks example gl/fboTrailsExample.

image/

 * /imageLoaderExample/
 * This example shows a single lua script implementation of loading and drawing images. "imageLoaderExample.lua" is based on ofxLua's example script. https://github.com/danomatika/ofxLua
 * /loadDisplayImage/
 * Simple Example showing how to load and display one image. This example was originally written in Processing. https://processing.org/examples/loaddisplayimage.html
 * /pointilism/
 * This example creates a simple pointillist effect using circles colored according to pixels in an image. Mouse horizontal location controls size of dots. This example was originally written in Processing. https://processing.org/examples/pointillism.html
 * /transparency/
 * This program overlays one image over another by modifying the alpha value of the image. Moving the mouse left and right across the image changes its position.

input/

 * /keyboard/
 * Simple example showing how to get keys pressed when the ofelia window is focused. Keys from a-z and A-Z draws rectangle in a certain position with a random gray color. Any key other than a-z and A-Z erases everything. This example was originally written in Processing. https://processing.org/examples/keyboard.html
 * /mouse2d/
 * Simple example showing how to get mouse coordinates. Moving the mouse changes the position and size of 2 boxes. This example was originally written in Processing. https://processing.org/examples/mouse2d.html

math/

 * /distance2d/
 * This example draws a grid of circles which size depends on the distance from the mouse using ofDist. This also shows how to use two nested for loops to draw this grid of circles. This example was originally written in Processing. https://processing.org/examples/distance2d.html
 * /map/
 * Shows how to use ofMap to convert numbers from one range to another, and also shows how to use ofClamp to clip the values to a min/max limit. This example was originally written in Processing. https://processing.org/examples/map.html
 * /noiseWave/
 * Shows how to use ofNoise to create a Perlin Noise wave-like pattern. Also shows how to create a custom polygon using ofBeginShape, ofVertex and ofEndShape. This example was originally written in Processing. https://processing.org/examples/noisewave.html

motion/

 * /bounce/
 * This example shows how to make an animation where a circle bounce at the edges of the window. The circle has a fixed speed and when it reaches an edge it reverses its direction. This example was originally written in Processing. https://processing.org/examples/bounce.html
 * /brownian/
 * This example records a random movement into a series of connected lines, creating a brownian motion effect. It generates a new point using ofRandom summed to the last position created and stores it in the tables. The tables contains the last 2000 points generated, and then the program draw lines to connect all these points. This example was originally written in Processing. https://processing.org/examples/brownian.html
 * /cubes/
 * This example creates an animation with 8 cubes drawn with ofNoFill, where all of these cubes shares the same overall rotation. The boxes grow and shrink to different sizes using math.sin and math.cos from lua math library. This is an interesting example of how to use ofPushMatrix and ofPopMatrix to make sure that the rotation doesn't add up inside the for loop while drawing each box.

pd/

 * /metro/
 * Shows how to emulate [metro] with ofelia. It uses ofClock to schedule the execution of a function.
 * /misc/
 * This example contains different object emulations and techniques:
 * How to emulate [value] using ofValue class and set and get methods
 * How to emulate [tabread] and [tabwrite] using ofArray class and getAt and setAt methods
 * How to emulate [array get] and [array set] using ofArray class and get and set methods
 * How to emulate [array size] using ofArray class and getSize and setSize methods
 * How to emulate [send] using ofSend class and various methods for each message type (sendBang, sendFloat, sendSymbol, sendPointer, sendList and sendAnything )
 * It also shows that a named [ofelia f] (for example [ofelia f $0-foo]) can be called from a send with the same name (in this case [s $0-foo] ), so this can be used to emulate a receive object too.
 * And for last it also shows how to use ofOutlet class to have more control over the outlets of the ofelia object (using the methods outletFloat, outletSymbol, outletList, outletAnything )
 * /sysgui/
 * This shows how to send tcl/tk commands directly to Pd using ofSysGui, it also shows how to get the window name using ofCanvas class and its getName method. The example used is based on the Tcl/Tk tutorial. http://zetcode.com/gui/tcltktutorial/drawing/

shader/

 * /displacementMap/
 * /geometryShader/
 * /glslSandbox/
 * /simpleColorQuad/

shape/

 * /bezier/
 * /graphicsExample/
 * /polygon/
 * /polygonExample/
 * /shapePrimitives/
 * /star/

simulate/

 * /simpleParticleSystem/

text/

 * /drawFontString/
 * /fontsExample/
 * /letters/
 * /unicode/

video/

 * /asciiVideoExample/
 * /loadDisplayVideo/
 * /videoGrabberExample/
 * /videoPlayerExample/