broad enough for PHICS, GKS, Java-3D & Direct X
Sierpinski gasket (an object that can be defined recursively and randomly)
A vertex – a location in space, rather than a point
A point in space is specified by a single vertex. Two vertices define a line segment. Three vertices can determine either a triangle or a circle. Four a quadrilateral etc.
Vertex function glVertex*
*, two or three characters of the form nt or ntv
n, number of dimensions (2, 3, or 4)
t, denotes data type, integer(i), float(f), double(d)
v, (if present) the variable are specified through a pointer to an array, rather than through
Polygons – a series of connected lines to be displayed correctly: it must be simple, convex and flat.
Convex – all points on any line segment are inside the object
Ex. Device a test for the convexity of a 2D polygon
GL_POLYGON, GL_TRIANGLES, GL-QUADS, GLTRIANGLE_STRIP, GL_QUAD_STRIP, GL_TRIANGLE_FAN
Text (various fonts)
Stroke text – constructed as other graphic primitives use vertices to define line segments or curves that outline each character (transformations may applied – retaining its detail and appearance).
Raster text – simple and fast – Characters are defined as rectangles of bits – bit blocks (bit-block-transfer (bitblt) operation). Replicate or duplicate pixels to increase the size of raster characters (larger characters of blocky appearance).
c is the number of the ASCII character
Can approximate a curved surface by a mesh of convex polygons – a tessellation
e.g. for a circle use a regular polygon of n sides.
for a sphere use a regular polyhedron
or, use the mathematical definitions of curved objects and then build graphics functions to implement those objects (e.g. quadratic surfaces, parametric polynomial curves and surfaces)
GLU (the utility library) – for a collection of approximations to common curved surfaces.
attribute – any property that determines how a geometric primitive is to be rendered.
(e.g. colour, thickness of a line, the pattern used to fill a polygon)
most interesting aspect
Three colour theory
Additive colour model (three primary colours mixed); red, green and blue - RGB
orthographic view – orthographic projection (‘sees’ only those objects in the volume specified by viewing volume). Unlike a real camera, the orthographic projection can include objects behind the camera.
model view and projection matrices
Interaction with the Window System
Window or screen window – a rectangular area of the display, the screen of a CRT
In OpenGL, window coordinates are 3D, whereas screen coordinates are 2D – measured in pixels
Many windows can be displayed on the CRT screen
Origin: OpenGl – bottom left; windowing information e.g. mouse position – top left conversion is required from one coordinate system to the other
Aspect Ratio and Viewports
aspect ratio of a rectangle is the ration of the rectangle’s width to its height
distortion – a consequence of the default mode of operation, in which the entire clipping rectangle is mapped to the display window.
Viewport – a rectangular area of the display window. By default, it is the entire window, but it can be set to any smaller size in pixels – void glVIEWport
The Gasket Program
Polygons and Recursion
The 3D Gasket
Hidden Surface Removal – visible-surface algorithms or hidden-surface-removal algorithms