In the same way, This chapter provides examples to draw a 3D cube and apply colours to it and attach image to it.īelow given is the program to draw a 3d cube and apply colours to it.
Now in this chapter you can learn how to a 3d cube, how to rotate it, how to attach an image on it. It provides the option to fill the interior of any shape with any color or pattern specified in paint attributes using strokes. It supports the rendering of primitive geometric shapes and figures.
In the previous chapters we have seen how to draw 3d triangle and rotate it. The Java 2D API consists of 2D which extends the Graphics class to provide support for enhanced graphics and rendering features.