background preloader

Processing.js

Facebook Twitter

A Primer on Bézier Curves. Preface In order to draw things in 2D, we usually rely on lines, which typically get classified into two categories: straight lines, and curves.

A Primer on Bézier Curves

The first of these are as easy to draw as they are easy to make a computer draw. Give a computer the first and last point in the line, and BAM! Straight line. No questions asked. Curves, however, are a much bigger problem. They're named after Pierre Bézier, who is principally responsible for getting them known to the world as a curve well-suited for design work (working for Renault and publishing his investigations in 1962), although he was not the first, or only one, to "invent" these type of curves. So, what if you need to program them yourself? —Pomax (or in the tweetworld, @TheRealPomax) Note: virtually all Bézier graphics are interactive. This page uses interactive examples, relying heavily on Bezier.js, as well as "real" maths (in LaTeX form) which is typeset using the most excellent MathJax library.

Processing JS WordPress Plugin. Include Processing JS sketches into your WordPress blog posts. Download — Latest Version Version 1.0 (zip file)View code at the WP Plugin Repository Installation The easiest way to install the plugin is to install with plugin installer (enter your WordPress address). If you want to do it manually: Upload the processingjs directory to the /wp-content/plugins/ directoryActivate the plugin through the ‘Plugins’ menu in WordPress Once activated, you’ll notice a ‘processing’ button when you’re writing or editing a post in HTML mode.

Screenshot Changelog 1.0 (2011-02-03)Updated to use Processing.js 1.0 – thanks to digitalawakening0.5 (2009-09-02)Initial release Questions? Leave a comment or email: keyvan (at) keyvan.net Donate If you find this piece of code useful, please consider donating. Getting Processing.js Working On Wordpress (Or Any Other Site): A Tutorial.

I’m a big fan of the visual programming language Processing, which began as a collaboration between visual artists and computer scientists.

Getting Processing.js Working On Wordpress (Or Any Other Site): A Tutorial

While I use it for data visualization, a lot of people use it for art. Here are some examples. There’s only one problem — Processing’s dependency on Java, and Java’s broken relationship with the Web. Here’s a screenshot of a project page on OpenProcessing, the great online repository of Processing sketches: I don’t know about you, but the Web is where I want to see my work, so working in a language that won’t work with modern browsers just isn’t acceptable to me. Processing.js to the rescue! Enter Processing.js, a library that translates Processing code into Javascript, which works in browsers old and new the world over (with a few exceptions, of course). Go to processingjs.org and download Processing.js. (Remember to click these images to see them fullsize so that you can read the notes!)

Here’s what it will look like: Troubleshooting and Debugging. Processing.js. Basic Syntax A brief look at the structure of a Processing sketch reveals how easy it is to program interactive visualizations.

Processing.js

As with any language, you begin by defining your global variables. Then you create a setup() function, where you control the visualization's properties, like the canvas size, frame rate and perhaps variables such as the stoke-weight or background-color. The next step is to create your draw() function, which controls the behavior of each frame in your animation. The draw function loops continuously unless you tell it otherwise by using the exit() command. To the right is a basic example of Processing.js in action. Adding interactivity to your visualization is incredibly simple. Processing.js also tracks a range of pre-defined variables like key, which stores the value of the last key pressed; or mouseX and mouseY, which store the last recorded position of the mouse pointer. Processing.js. Processing-js-Easy. Processing-js-Easy.

Processing JS WordPress Plugin.