2D Computer Graphics
This section provides a basic overview of two-dimensional computer graphics.
What Is 2D Computer Graphics (2DCG)?
Computer graphics, or CG, refers to the technology for generating images and visual content through computational processing on a computer.
There are two main types of computer graphics: 2D computer graphics (2DCG), which handle flat, two-dimensional representations, and 3D computer graphics (3DCG), which deal with three-dimensional visuals.
In the past, 2DCG was the dominant form of rendering on PCs and similar devices. However, thanks to the rapid advancements in computing power and 3D technology, 3DCG has now become commonplace as well.
VCSSL supports both 2DCG and 3DCG through its standard libraries, but this guide will focus primarily on 2DCG. Working with 2DCG is essential for tasks such as image manipulation, diagram rendering, 2D animations, and 2D game development.
Using 2DCG in VCSSL Programs
To work with 2DCG in a VCSSL program, you'll need to import the Graphics and Graphics2D libraries from the VCSSL standard library.
In most cases, rendered images are displayed in a window, so it's also recommended to import the GUI library -- unless you're only saving images to files and don't need any window display.
You can import these libraries by writing the following lines at the top of your program:
import Graphics;
import Graphics2D;
import GUI;
import.vcssl
(Note: Running this program won't produce any visible output yet -- it only imports the libraries.)
Once imported, you'll have access to various functions that allow you to work with 2D graphics in your program.