hello,
processing produces a java-file afaik.
Just use export application from the file menu.
Result see below.
that might help you:
http://www.processing.org/learning/eclipse/
you can conclude from there the steps to do a java program in an editor and compile it
using javac on the command-line and then java to run it.
see
http://docs.oracle.com/javase/tutorial/getStarted/cupojava/win32.html
Greetings, Chrisir
P.S.
this is JAVA, not processing code
- import processing.core.*;
- import processing.data.*;
- import processing.event.*;
- import processing.opengl.*;
- import java.util.HashMap;
- import java.util.ArrayList;
- import java.io.BufferedReader;
- import java.io.PrintWriter;
- import java.io.InputStream;
- import java.io.OutputStream;
- import java.io.IOException;
- public class Empty3Da extends PApplet {
- float CameraX;
- float CameraY;
- public void setup()
- {
- size( 800, 800, P3D );
- CameraX = width / 2.0f;
- CameraY = 50;
- noCursor();
- } // setup
- public void draw()
- {
- background(0);
- stroke(111, 110, 110);
- fill(111, 110, 110);
- // ==================================================
- // draw floor
- float floorY=600;
- line ( 20, floorY, -200,
- width-20, floorY, -200);
- line ( 20, floorY, -20,
- width-20, floorY, -20);
- line ( 20, floorY, -200,
- 20, floorY, -20);
- line ( width-20, floorY, -200,
- width-20, floorY, -20);
- // ==================================================
- //float floorY=600;
- line ( 20, floorY, -300,
- width-20, floorY, -300);
- line ( 20, floorY, -20,
- width-20, floorY, -20);
- line ( 20, floorY, -300,
- 20, floorY, -20);
- line ( width-20, floorY, -300,
- width-20, floorY, -20);
- // ==================================================
- // camera
- camera(
- CameraX, CameraY, 700,
- width/2.0f, height/2.0f, 0,
- 0, 1, 0);
- // ==================================================
- // paint boxes
- //MyBox ( 310, 20, 22, 530, 210, 3, 14, color (255, 0, 0));
- //MyBox ( 110, 440, 44, 52, 10, 222, 14, color (2, 0, 255));
- MyBox ( mouseX, 590, map (mouseY, 0, height, -610, 110),
- mouseX, 596, map (mouseY, 0, height, -610, 110),
- 14, color (2, 0, 255));
- } // draw
- public void keyPressed() {
- if (key == CODED) {
- if (keyCode == UP) {
- CameraY-=10;
- }
- else if (keyCode == DOWN) {
- CameraY+=10;
- }
- else if (keyCode == RIGHT) {
- CameraX+=10;
- }
- else if (keyCode == LEFT) {
- CameraX-=10;
- }
- else {
- // nothing
- }
- }
- else {
- // not key == CODED
- //
- }
- }
- public void MyBox(float x1, float y1, float z1, float x2, float y2, float z2, float weight, int strokeColour)
- // was called drawLine; programmed by James Carruthers
- // see http://processing.org/discourse/yabb2/YaBB.pl?num=1262458611/0#9
- {
- PVector p1 = new PVector(x1, y1, z1);
- PVector p2 = new PVector(x2, y2, z2);
- PVector v1 = new PVector(x2-x1, y2-y1, z2-z1);
- float rho = sqrt(pow(v1.x, 2)+pow(v1.y, 2)+pow(v1.z, 2));
- float phi = acos(v1.z/rho);
- float the = atan2(v1.y, v1.x);
- v1.mult(0.5f);
- pushMatrix();
- translate(x1, y1, z1);
- translate(v1.x, v1.y, v1.z);
- rotateZ(the);
- rotateY(phi);
- noStroke();
- fill(strokeColour);
- box(weight, weight, p1.dist(p2)*1.2f);
- popMatrix();
- }
- static public void main(String[] passedArgs) {
- String[] appletArgs = new String[] { "Empty3Da" };
- if (passedArgs != null) {
- PApplet.main(concat(appletArgs, passedArgs));
- } else {
- PApplet.main(appletArgs);
- }
- }
- }