100
JOGL 2D Objects
In the previous section, we have already learn how to draw a basic line in JOGL. Using the same methods we can also draw various type of shapes such as square, rectangle, triangle etc.
JOGL Square Example
In this example, we will draw four different edges in such a way that they all connect at a point in a shape of square.
Output:
JOGL Triangle Example
In this example, we will draw three different edges in such a way that they all connect at a point in a shape of triangle.
Triangle.java
Output:
Hence, any type of figure can be designed by just connecting the lines in the particular shape.
Next TopicJOGL Primitives Shapes