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 & HelpIntegration › processing applet as texture in X3D world
Page Index Toggle Pages: 1
processing applet as texture in X3D world (Read 1042 times)
processing applet as texture in X3D world
Aug 19th, 2007, 7:20pm
 
i managed to get processing sketches working as live textures in instant reality (x3d). now it is possible to simply write animated and interactive textures in processing and use them in 3d scenes. this is done by an applet wrapper that renders a processing sketch offline and copies its pixels[] array into an x3d SFImage().

here is an example how to load a processing applet as texture in instant player..

ProcessingTexture.class is a wrapper class that loads a processing applet and puts its framebuffer into an SFImage. it also sends mouse events from instant player to the applet.

in order to load your processing applet you have to follow these steps:

- download instant player and install it (http://instantreality.org/downloads)
- download the zip with the wrapper class and the examples and extract it
- write your processing sketch (size in power of two: 256×256, 512×512, 1024×512, ..), export it and copy the jar into the same folder as the example
- open ProcessingTexture.x3d in a text editor
- add your jar file to the “javaClassPath” in the ContextSetup node at the top of the file (windows: separate with ';')
- change the value of the script node’s “name” field to the name of your applet (without .class or .pde)
- open the x3d file in instant player. you should see your applet on a cube

download:
http://i.document.m05.de/wp-content/uploads/2007/08/instantprocessing.zip

more:
http://i.document.m05.de/?p=370
Re: processing applet as texture in X3D world
Reply #1 - Aug 19th, 2007, 10:18pm
 
Hi Michael,

Thx for your effort on making x3d and processing working together. Smiley

I follow your instructions, changed the path according to my folder's and sketch location, but i get the Instant Player to quit unexpectedly.

The path for the example i use is like that (i'm running OS X 10.4.10) :

Quote:
<ContextSetup javaClassPath='/HD1/Users/Jay/P5/InstantProcessing/ProcessingTest.jar:/HD1/Users
/Jay/P5/InstantProcessing/avalon.jar:/HD1/Users/Jay/P5/InstantProcessing/core.ja
r' />


The example in the archive is starting but there is no texture on faces (just white color).

Any suggestions ?
Re: processing applet as texture in X3D world
Reply #2 - Aug 21st, 2007, 1:59pm
 
hello jay

just leave the /HD1 in your path:

<ContextSetup javaClassPath='/Users/Jay/P5/InstantProcessing/ProcessingTest.jar:/Users/Jay/P5/
InstantProcessing/avalon.jar:/Users/Jay/P5/InstantPr ocessing/core.jar' />

i tested it on a blank os x system without processing and it works. good luck!

michael




Re: processing applet as texture in X3D world
Reply #3 - Aug 21st, 2007, 5:52pm
 
Hi Michael,

I did exactly what you said, it works now for the processing example.

But if i use my own sktech pde/jar, i get the same results. :/
Page Index Toggle Pages: 1