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.
Page Index Toggle Pages: 1
OpenGL question... (Read 1311 times)
OpenGL question...
Jun 9th, 2005, 10:52am
 
ahoi.. a few questions :)

1:
beginShape(QUAD);
texture(someTexture);
vertex(x,y,z);
...
endShape();

simply wont put the desired texture on my poly in OPENGL.

2:
To get access to the GL object, you can use the following:
GL gl = ((PGraphicsGL)g).gl;
// see http://processing.org/faq/bugs.html#opengl
even though its not recommended, i'd like to play around with openGL in processing.

when trying the above code, i get the error message:
Type "GL" was not found.

3:
with accessing GL object, can i access all opengl functions?
and can i write jogl code in processing with the declared gl object?

thanks for your replies in advance..
Re: OpenGL question...
Reply #1 - Jun 9th, 2005, 11:40am
 
Hello,

2 : add this line in your program
Code:

import net.java.games.jogl.*;


3 : once you get the reference on the GL instance, you have access to its methods like this :
Code:

gl.glClearColor(0.0f,0.0f,0.0f,1.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
...

Notice that opengl constants are static members of the GL class.
Re: OpenGL question...
Reply #2 - Jun 9th, 2005, 12:20pm
 
About the first question:
The texture doesn't show up because you have to set the coordinates on the texture too, like vertex(x,y,z, u,v);
Take a good look at the reference: http://www.processing.org/reference/vertex_.html

Koenie
Re: OpenGL question...
Reply #3 - Jun 9th, 2005, 12:31pm
 
thanks Cheesy
Page Index Toggle Pages: 1