# Introduction to Computer Graphics Using Java 2D and 3D

## Introduction to Computer Graphics Using Java 2D and 3D

Computer graphics provides methods to generate images using a computer. The word “image” should be understood in a more abstract sense here. An image can represent a realistic scene from the real world, but graphics like histograms or pie charts as well as the graphical user interface of a software tool are also considered as […]

## Basic Principles of Two-Dimensional Graphics (Introduction to Computer Graphics Using Java 2D and 3D) Part 1

This topic introduces basic concepts that are required for the understanding of two-dimensional graphics. Almost all output devices for graphics like computer monitors or printers are pixel-oriented. Therefore, it is crucial to distinguish between the representation of images on these devices and the model of the image itself which is usually not pixel-oriented, but defined […]

## Basic Principles of Two-Dimensional Graphics (Introduction to Computer Graphics Using Java 2D and 3D) Part 2

Basic Geometric Objects The basic geometric objects in computer graphics are usually called primitives or graphics output primitives. They include geometric entities like points, straight and curved lines and areas as well as character strings. The basic primitives are the following ones. Points that are uniquely defined by their x – and y-coordinate. Points are […]

## Basic Principles of Two-Dimensional Graphics (Introduction to Computer Graphics Using Java 2D and 3D) Part 3

Geometric Transformations In addition to geometric objects, geometric transformations play a crucial role in computer graphics. Geometric transformations can be used to position objects, i.e., to shift them to another position or to rotate them, to change the shape of objects, for instance to stretch or shrink them in one direction, or to move objects […]

## Basic Principles of Two-Dimensional Graphics (Introduction to Computer Graphics Using Java 2D and 3D) Part 4

Applications of Transformations This section introduces typical applications and problems that can be solved using geometric transformations. In computer graphics it is common to define objects in an arbitrary coordinate system in floating point arithmetics, the so-called world coordinates. In order to generate an image of specific objects on the computer screen or another output […]

## Basic Principles of Two-Dimensional Graphics (Introduction to Computer Graphics Using Java 2D and 3D) Part 5

Movements via Transformations in Java 2D This section explains how to implement the simple example of the moving clock of the previous section in Java 2D. Within the topic, only the most essential parts of the source code are shown. The full source code for this example can be found in the class NonSynchronizedClock.java. In […]

## Drawing Lines and Curves (Introduction to Computer Graphics Using Java 2D and 3D) Part 1

The previous topic has introduced basic objects and geometric transformations for two-dimensional computer graphics using the principles of vector graphics. As already mentioned in the introduction, drawing geometric objects in a raster graphics framework requires efficient algorithms. This topic illustrates the basic problems and solutions in the context of drawing lines and curves within raster […]

## Drawing Lines and Curves (Introduction to Computer Graphics Using Java 2D and 3D) Part 2

Structural Algorithms The midpoint algorithm requires in addition to the computations for the initialisation n operations to draw a line of n pixels, so that its computational complexity is linear. Structural algorithms try to reduce this complexity further by analysing repeated patterns that occur when a line is drawn on a pixel raster. Figure 3.6 […]

## Drawing Lines and Curves (Introduction to Computer Graphics Using Java 2D and 3D) Part 3

The Midpoint Algorithm for Circles In Sect. 3.2 an efficient line drawing algorithm based solely on integer arithmetic was introduced. This midpoint algorithm can be generalised to drawing circles and also various other curves under certain restrictions. The main constraint for circles is that the centre or midpoint (xm,ym) of the circle must be located […]

## Areas, Text and Colours (Introduction to Computer Graphics Using Java 2D and 3D) Part 1

Filling areas is applied in the context of drawing thick lines where thick lines are considered as long rectangles. But filling areas and polygons is also a general technique of computer graphics that is also needed as a drawing mode. This topic contains in addition to techniques for filling areas also basic models for colours […]