okay, here's a better example. even the standard opengl libraries are not recognized. i'm getting this error when attempting to run the sketch below:
Exception in thread "Animation Thread" java.lang.RuntimeException: You need to use "Import Library" to add processing.opengl.PGraphicsOpenGL to your sketch.
at processing.core.PApplet.makeGraphics(PApplet.java:1193)
at processing.core.PApplet.size(PApplet.java:999)
at processing.core.PApplet.size(PApplet.java:959)
at ribcoil1.setup(ribcoil1.java:41)
at processing.core.PApplet.handleDraw(PApplet.java:1403)
at processing.core.PApplet.run(PApplet.java:1328)
at java.lang.Thread.run(Thread.java:613) Code:
import processing.opengl.*;
cubGira CS;
float fase;
float rot;
int amp, MAXamp, alf;
float x,y;
float inercia =.125;
float deltaX;
float deltaY;
boolean eixos;
void setup() {
size(640, 480,OPENGL);
background(0);
mouseX+=280;
mouseY+=290;
CS = new cubGira();
frameRate(25);
fase=0.0;
MAXamp=100;
amp=5;
alf=100;
}
void draw(){
background(0);
deltaX=(pmouseX/2-x);
deltaY=(pmouseY/2-y);
deltaX*=inercia;
deltaY*=inercia;
x+=deltaX;
y+=deltaY;
if(eixos){
stroke(255,400,0);
//X
line(0,0,0,8000,0,0);
stroke(0,255,0);
//Y
line(0,0,0,0,8000,0);
stroke(110,20,255);
//Z
line(0,0,0,0,0,8000);
}
stroke(80+y,80+y,30);
rot=x/y+1 ;
camera(6*y, 700.0-y, x+y*2, 2*x+y, -y+240, height-x-200, -10, 0, 0.0);
pushMatrix();
for(int a=0; a<60; a++){
translate(20,5,90);
rotateX(fase);
CS.draw(fase, int(x), a);
}
popMatrix();
fase=fase+0.005%TWO_PI;
}
void mousePressed() {
if(eixos){
eixos=false;
}
else{
eixos= true;
}
}
class cubGira{
public cubGira() {
}
public void draw(float fase, int amp,int tamany){
pushMatrix();
fill(#00FF00);
translate(-y,float(amp),-x);
rotateY(y);
line(30, 20, 285, 175);
popMatrix();
}
}