processing.js

Has anyone got processing.js working in IE?

I'm looking for examples of processing.js working in Internet Explorer via ExplorerCanvas or similar. ...

processing.js loading external files

I want to split my processing.js code into several files but I'm not sure how. I tried doing <script type="application/processing" src="main.pjs"> to load my processing.js file "main.pjs" but it didn't work. ...

Combining the power of Processing.js and Web Workers

I've been doing some reading about two (relatively) new concepts in the Javascript language - Web Workers and John Resig's awesome Processing.js (well, not really a new 'Javascript concept', but you get my idea). Some great examples of both wander the internets, but I have yet to find one that employs both techniques effectively. It look...

How to call Processing.js function from HTML?

I'm exploring HTML5 and Processing.js. When the user clicks on an image on my webpage, I'd like to call a function in the Processing.js code. Just calling the function in onclick, as illustrated in this simple example, isn't working: <html> <head> <script language="javascript" src="processing.init.js"></script> <script lan...

Usage/availability of import function in Processing.js

The reference page (use "toggle all") for Processing.js says the import command remains unimplemented. It references a page for the Java Processing language that describes a usage pattern like this: import processing.opengl.*; I see at Github that some work on the import command was committed to the root in May. Does anyone know how thi...

Canvas Element and IE

Well not just IE, any browser that doesn't currently support it I want to start using the processing.js framework. It's used for making images with the canvas element. However I'm reluctant to use it due to the fact that it's not widely supported. So what's the best way for me to give the user an alternative image if they do not suppor...

How to tell when an @font-face rule is applied

Is there any way to tell when an @font-face rule is applied? I'm creating @font-face rules that use data: URIs from a font file requested with an synchronous XMLHttpRequest in JavaScript and then write text to a canvas element using the font right away. The thing is that it doesn't actually use the font when drawing the text for the firs...

How to have multiple processing.js sketches running at the same time

I'm trying to run multiple sketches on the same page. The init script specifies that: /* * This code searches for all the <script type="application/processing" target="canvasid"> * in your page and loads each script in the target canvas with the proper id. * It is useful to smooth the process of adding Processing code in your page and ...

How do I create circles connected with elastic lines in Processing.js?

In Processing.js, I'd like to have circles that represent nodes, with lines connecting linked nodes. I'd like those connected circles to naturally pull toward each other with a kind of elasticity of the lines, and the circles to bounce against each other when they touch. Any ideas on how to do this? ...

Mercator longitude and latitude calculations to x and y on a cropped map (of the UK)

Hi I have this image: http://imgur.com/99tSz.png. A map of the UK (not including Southern Ireland). I have successfully managed to get a latitude and longitude and plot it onto this map by taking the leftmost longitude and rightmost longitude of the UK and using them to work out where to put the point on the map. This is the code (for...

Better event-based redraw() of Processing.js when using noLoop()

I am using Processing.js, with jQuery 1.3.2 at my disposal, and targeting Firefox 3.5, Safari 4 and IE 8 (through ExplorerCanvas). The Processing.js website says "Using Explorer Canvas with Processing.js typically results in unusable frame-rates for moderately complex visualizations." Well, in this case, animation is not required, just s...

draw lines protruding from a circle

So I've been messing around with http://processingjs.org/. I want to draw a circle that has a bunch of lines protruding from it. Each of these lines should perpendicular to the tangent of the circle. I don't necessarily need to know how to do this in processing.js, but I don't really remember my trigonometry, so more of an explanation ...

Knowing two points of a rectangle, how can I figure out the other two?

Hey there guys, I'm learning processing.js, and I've come across a mathematical problem, which I can't seem to solve with my limited geometry and trigonometry knowledge or by help of Wikipedia. I need to draw a rectangle. To draw this rectangle, I need to know the coordinate points of each corner. All I know is x and y for the midpoints...

Javascript client-data compression

I am trying to develop a paint brush application thru processingjs. This API has function loadPixels() that will load the RGB values in to the array. Now i want to store the array in the server db. The problem is the size of the array, when i convert to a string the size is 5 MB. Is the best solution is to do compression at javascript ...

Is it possible to create transparent canvas

I am developing a pain brush application in javascript using processing.js It is using cavas object. I want to keep an image at the background of canvas. Draw something in the foreground. And while saving i need to get only foreground data. For that we need to make canvas object transparent so that background image is visible. I don't ...

Dragging in processing.js

Dear all I am a physics teacher in London and I am trying to learn processing.js To make teaching resources a very important technique is to be able to drag shapes around. Although I know how to do this in PJS, I have found that the code for having several draggable objects quickly gets messy. (especially if the object is "locked", s...

Using processing.js inside a Firefox extension

I am curious to know if anyone has been successful using processing.js inside a Firefox extension. I am aware of the difficulties of using external libraries inside extensions and the fact that it has to be loaded in a way that will not pollute the global namespace, conflict with other extensions or Firefox itself. But with those conce...

Wrapping processing.js in Google Web Toolkit

Hi All, I was wondering whether anyone has managed to wrap John Resig's processing.js library in Google Web Toolkit (maybe in combination with GWT Canvas) or knows of any resources or sample code out on the web. Processing.js is extremely powerful for generating bespoke data visualisations, custom animations etc (I am aware of the Googl...

Making Magic Fairy Dust With JQuery

I have the following task: Add falling fairy dust (kind of like Tinker Bell) to a website logo. The falling fairy dust should be continuously animated/falling and fading out. The website logo is a png. I would like to absolutely position a div over the existing website logo image. That div would contain the animating fairy dust. I k...