Javatpoint Logo
Javatpoint Logo

JOGL Primitive Shapes

In the previous examples, we have already learnt that in JOGL any type of shape can be drawn with the help of GL_LINES parameter. But apart from that, JOGL also contains various other parameters through which we can draw the particular shape such as triangle, quadrilateral, polygon etc. directly (i.e. in the simpler way).

JOGL Primitive Triangle Example

In this example, we will see how to create a triangle with the help of primitive triangle parameter (GL_TRIANGLES).

Triangle.java

Output:

JOGL Primitive Shapes Triangle Output

JOGL Primitive Quadrilateral Example

In this example, we will see how to create a quadrilateral with the help of primitive quadrilateral parameter (GL_QUADS).

JQuad.java

Output:

JOGL Primitive Shapes Quadrilateral Output





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA