We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpProcessing Implementations › processing on the iphone
Page Index Toggle Pages: 1
processing on the iphone (Read 15390 times)
processing on the iphone
May 31st, 2008, 1:14pm
 

I was as impressed with the Processing.js implementation by John Resig as everyone else. And I naturally looked into the code to figure out how he had managed to do it. As he explains on his site, its all built around the browser canvas-object, and specifically the CanvasRenderingContext2D -object.

http://www.whatwg.org/specs/web-apps/current-work/multipage/section-the-canvas.html#canvasrenderingcontext2d

I had a look at the specification for the context object and the methods that Processing.js are using and realized that there were only about 8-10 methods needed.

So, I downloaded the JavaScript engine SpiderMonkey from Mozilla. With some inspiration from the Jiggy-project I configured and compiled it for the iphone. Then hooked it up with Processing.js, and wrote my own version of the context-object using OpenGL ES.

During this process I had to rewrite parts of Processing.js in ObjC for performance reasons.

Results? A hack of processing running on the iPhone with reasonable speed. I have uploaded a short video on youtube here: http://www.youtube.com/watch?v=0UN2iYrZmEY

Examples shown are StoringInput, BouncyBubbles (changed to use iphone accelerometer) and Substrate.

I will not be able to publish the code at the moment since it is built using apple code that is under NDA. Furthermore, it is really a hack, and would not be ready to meet the real world. Many things are not complete and the visual output is similar but not the same as in "real" Processing.

mattias ljungström
Re: processing on the iphone
Reply #1 - Jun 1st, 2008, 6:47am
 
Impressive. Would've been even nicer if it was the actual Java-based Processing and not the Javascript version. I made a MIDP applet for Nokia Trend Labs last year. I considered using Mobile Processing, but it was easier to use pure Java with Nokia's mobile device emulator.

The iPhone would be an attractive delivery platform indeed, I'm looking forward to what kind of art-related hacks will come out of the public SDK. Apparently, Sun has vowed to put Java on the iPhone, let's keep our fingers crossed.
Re: processing on the iphone
Reply #2 - Oct 11th, 2008, 3:32am
 
Just curious if the specific code you were using is still under NDA?  Or if it's possible to share now?

Definitely fun stuff!

Ian
Re: processing on the iphone
Reply #3 - Oct 24th, 2008, 10:36am
 
any informations about mobile.processing on iPhone ?
Re: processing on the iphone
Reply #4 - May 7th, 2009, 5:08am
 
Would it not be a reasonable idea to recreate the API in objective C using the methods as they exist now? On a jailbroken iPhone, you can indeed install Java and all the libs needed. But i doubt one could take advantage of the GPS, the Tilting and all the other fun thigns you'd want to do using the hacked Java API
Re: processing on the iphone
Reply #5 - May 7th, 2009, 5:10am
 
It seems that theres plenty of nice things on the default API such as OpenGLES and CoreGraphics. Would it be possible to re-create processing using these libraries and making a move from Java completely?
Re: processing on the iphone
Reply #6 - Jun 28th, 2009, 3:05am
 
It seems that with the XMLVM project it should be possible to cross compile Processing into Objective C for the IPhone.

I'm not sure how the reflection in PApplet will be handled but compiling a Swing app using PGrapics should be doable.
Re: processing on the iphone
Reply #7 - Jul 20th, 2009, 1:43pm
 
nice job!
Re: processing on the iphone
Reply #8 - Aug 3rd, 2009, 9:31am
 
It will be great to have processing on iPhone

An Objective C port sounds good to me.
Re: processing on the iphone
Reply #9 - Oct 18th, 2009, 3:59pm
 
Noob-question - What would be the process for porting processing.org libraries to Objective-C?
Re: processing on the iphone
Reply #10 - Oct 19th, 2009, 2:38am
 
You would need to do a complete rewrite...
Either using the source code as it is available (can be useful for some algorithms like filter() ones), or just doing like many Processing implementations, taking the API and rewriting it.
Re: processing on the iphone
Reply #11 - Dec 29th, 2009, 9:47am
 
Can the code be posted now, so others can play with it?

(The NDA was lifted ages ago...)
Page Index Toggle Pages: 1