Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

PGL getting started

$
0
0
Hello everyone,

I want to get start using OPENGL in P5.
I am not sure how to start it and I can't find any tutorial on the
subject. 
I want to start drawing a gradiant traingle so I found this for
JOGL.  

  1.                  gl.glBegin(GL.GL_POLYGON);
  2. //We want to draw triangle in gradient color
  3. //So setting the color of first vertex as red
  4. gl.glColor4f(1, 0, 0, 1);
  5. gl.glVertex2d(100, 100);
  6. //Setting the color of second vertex as green
  7. gl.glColor4f(0, 1, 0, 1);
  8. gl.glVertex2d(100, 200);
  9. //Setting the color of third vertex as blue
  10. gl.glColor4f(0, 0, 1, 1);
  11. gl.glVertex2d(200, 200);
  12. //Our polygon ends here
  13. gl.glEnd();
  14. gl.glFlush();
from
http://wiki.tankaar.com/index.php?title=Drawing_First_2D_Graphics_in_JOGL

but I don't know how to reproduce those line in P5 as I even can't find
a class (I don't know the purpose and difference between PGL, GL,...)
that has the glBegin function.

Can someone give me a hint how to start.
Thanks in advance.
ra


Viewing all articles
Browse latest Browse all 1768

Trending Articles