Loading and Saving of Images with Java 2D For loading an image in JPEG format, only the method is required. The loaded image can then be drawn on the window on the computer screen or on another BufferedImage by the method drawImage that was already explained for the class BufferedImage. The file ImageLoadingExample.java demonstrates how […]

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

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

Colour Models The human eye can see light starting with a wavelength of about 300-400 nm (violet) up to roughly 700-800 nm (red). From the theoretical point of view, a colour is defined by the distribution of the intensities over the visible spectrum of the light. For colour perception, the human eye has three different […]

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

Colours in Java 2D With the exception of the CNS model, Java 2D supports all colour models mentioned in the previous section. Because most applications are based on the RGB model, within this topic only this model will be used. The class Color allows to define colours based on RGB values using the constructor The […]

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

This topic and all following ones are devoted to methods and problems in connection with the representation of three-dimensional scenes. Before the topics are discussed in more detail, the following section provides a short overview on which tasks and problems occur on the way from the real world or an abstract 3D model to the […]

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

Geometric Transformations in Java 3D Instances of the class Transform3D store three-dimensional transformations as matrices in homogeneous coordinates similarly to the class AffineTransform for two-dimensional affine transformations. The constructor Transform3D tf = new Transform3D(); generates the identity transformation corresponding to the unit matrix. The method tf.rotX(theta); defines tf as a rotation by the angle theta […]

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

Animation and Moving Objects So far, only static three-dimensional scenes were considered. For dynamic scenes, similar techniques as described in Sect. 2.9 for the two-dimensional case are applied. Movements can be implemented as piecewise interpolations or convex combinations between positions or states. The same applies to other transitions, for instance a slow change from one […]

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

Projections So far, transformations were used to position objects in a scene or to move them in animations. For the representation of a three-dimensional scene on a flat computer screen a projection to the two-dimensional plane is required. Such projections can also be described in terms of geometric transformations. For the representation of a three-dimensional […]

## Modelling Three-Dimensional Objects (Introduction to Computer Graphics Using Java 2D and 3D) Part 1

In the previous topic, objects of the virtual world were constructed with elementary geometric shapes like boxes, spheres, cylinders and cones. These simple shapes are not sufficient to model surfaces of more complex objects. This topic introduces a variety of techniques for modelling three-dimensional objects and their surfaces. Three-Dimensional Objects and Their Surfaces Before discussing […]

## Modelling Three-Dimensional Objects (Introduction to Computer Graphics Using Java 2D and 3D) Part 2

Surface Modelling with Polygons in Java 3D The representation of a scene in Java 3D is also based on tesselations of the objects. The elementary geometric objects in Java 3D that were introduced in Sect. 5.4 are approximated by triangles. Figure 6.11 shows the tesselations for the elementary geometric objects in the program StaticSceneExample.java. A […]

## Modelling Three-Dimensional Objects (Introduction to Computer Graphics Using Java 2D and 3D) Part 3

Representation of Functions in Java 3D The representation of landscapes and functions of two variables in Java 3D can be implemented directly based on the class GeometryArray which has been introduced in Sect. 6.4. In the simplest case of a rectangular grid, one only needs to combine the coordinates of the grid points with the […]