PGL getting started
in
Core Library Questions
•
10 months ago
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.
- gl.glBegin(GL.GL_POLYGON);
- //We want to draw triangle in gradient color
- //So setting the color of first vertex as red
- gl.glColor4f(1, 0, 0, 1);
- gl.glVertex2d(100, 100);
- //Setting the color of second vertex as green
- gl.glColor4f(0, 1, 0, 1);
- gl.glVertex2d(100, 200);
- //Setting the color of third vertex as blue
- gl.glColor4f(0, 0, 1, 1);
- gl.glVertex2d(200, 200);
- //Our polygon ends here
- gl.glEnd();
- 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
1