dcknsk
YaBB Newbies
Offline
Posts: 4
Korea
Re: using opengl from eclipse
Reply #11 - Dec 28th , 2005, 2:28pm
marumushi I put aside processing for a while and learned Jogl on Eclipse and came back to processing 98. When I tried following procedure it seems works fine. I am using Windows XP professional. I put < jogl.dll> and <jogl_cg.dll> in the directory Java\jre1.5.0_06\bin and I put <jogl.jar>, <core.jar>, and <opengl.jar> in the directory Java\jre1.5.0_06\lib\ext. Now in eclipse, following code works without any error message. //********** import processing.core.*; public class OpenGLPApplet extends PApplet { private static final long serialVersionUID = 1L; float x, y; public void setup() { int dim = 400; size(dim,dim, OPENGL); // size(dim,dim, P3D); println("Rendering with: "+ g.getClass().toString()); x = y = 0; } public void draw() { background(255); directionalLight(125, 125, 125, 0, 0, -1); ambientLight(50, 50, 50); translate(width / 2, height / 2, 100); x += ((mouseX / 100.00) - x) * .05; y += ((mouseY / 100.00) - y) * .05; rotateY(x); rotateZ(y); noStroke(); box(100, 50, 150); } } //******************** In console window you see Rendering with: class processing.opengl.PGraphicsGL if you use size(dim,dim, P3D); you get Rendering with: class processing.core.PGraphics3 When I remove either <jogl.jar> or <opengl.jar> I can get error message saying jogl missing or opengl missing. This means even if I omit "import" statement, as far as <jogl.jar> and <opengl.jar> are installed in the ..\lib\ext directroy, the processing statement size(dim,dim, OPENGL); obviously creates instance g of processing.opengl.PGraphicsGL!