Create a window and draw at least three functions in this window, each in a different colour (e.g. sine, cosine, tangent).
Also draw X- and Y-axes in white with tick marks and values at the tick marks.
Create an output window that is divided in at least two areas, one drawing area
and one or more areas to display user buttons and user messages.
Use viewports to define and separate the different areas.
A set of user buttons is used for selection of simple objects (e.g. straight line, rectangle, text) to be drawn in the drawing area.
Create a square OpenGL output window that is divided into four square quadrants. Apply different 2D transforms on a 2D object (e.g. square, circle, tea pot) in each quadrant and show the changes of the object dynamically:
Create a function to generate a circle using the "Midpoint Circle Algorithm" of Bresenham. Arguments of the function are coordinates of the center and size of the radius of the circle.
Create a function to generate a 3D sphere using the circle function. Generate a sphere by drawing circles at different latitudes (with different radius) on the sphere and by drawing circles through north and south pole of the sphere.
Create a program showing one of the following visualizations:
Create a viewing program (viewer) to view 3-dimensional objects.
Minimal functionality of the viewer is rotation around X-, Y- and X-axes and zooming.
Choice 1: event viewer.
Introduction
Description
The data collected from the subdetectors are:
The collision point equals the origin of the (x, y, z) coordinate system and also equals the center point of all subdetectors.
Functionality
Choice 2: molecule viewer.
Functionality
Description
Display a curve that has been created using a "non-uniform rational B-spline" (NURBS) in an output window. Also show the control points that shape the curve. Where each control point can be moved by the mouse and while moving a control point, the shape of the curve follows the the movement.
Extra: Show the values of knots and enable the changing of values displaying the effect on the shape of the curve.
Extra-extra: Enable changing the order (changing the number of knots with fixed number of control points), with realtime display of the effect on the shape of the curve.
Create a corridor or a system of connecting corridors with various paintings on the walls of the corridors. Create a simple navigation to "walk" through a corridor and look around to view the paintings.
Create a program for the reconstruction a 2D image via simple backprojection: 1D projections of the 2D object image are made for different angles and from these 1D projections a 2D reconstruction of the original image is made. A sequence of reconstructions of improving quality of the original object image is made by doubling the number of angles for the successive reconstructions. A number of object images and a number of reconstruction methods are available to choose from.
Available object images are:
Available reconstruction methods are:
Use menu's to choose object image and reconstruction method.
Output of the program:
Hints
0000000000
This original 2D image is scanned at different angles, each scan resulting in a 1D projection.
The 1D projection for a specific angle phi is created as follows.
After creation of the 1D projection PRO, transform PRO to an array in the 2D frequency domain under angle phi (step 3 of the algorithm in
http://www.hef.ru.nl/~pfk/teaching/icg-hand/icg-12-2-3.html).
This array is added to an initially empty matrix FTPRO, that eventually contains the sum of all 1D projections.
If all projections of a slice are processed, a filtering step may be executed (step 4 of the algorithm mentioned), e.g. by convolution or fourier method. If the filtering step is skipped, you have unfiltered backprojection.
Now the 2D frequency domain image is transformed back to space domain by backprojection (step 5 of the algorithm, the 2D projection in frequency domain matrix FTPRO delivers a 2D reconstruction in place domain matrix REC).
For slice 1, there are two projections for angles 0 and pi/2, that are added to FTPRO.
Create a viewer to view the data in an NxM data array. Each element of the 2D data array contains a Z-value, the position of the element holds X and Y ordinate values. Data should be viewed in different ways:
Data files that can be used for input:
A short description of the format of the input files:
Create a program that applies the following 3x3 filter techniques to an image in a data file:
Data file that can be used: bnoise.pgm. See the previous assignment for a short description of the format of the file.
[interaction, viewport, user and window coordinates,
sample program mouse interaction,
sample program viewport]
A set of user buttons is used for selection of colors for following objects to be drawn in the drawing area. The colors may be simple red, green, blue, but more colors or a mixture of basic colors may also be implemented.
Two special user buttons are used to clear the drawing area and to terminate the program.
The mouse is used to select buttons and to indicate positions for the objects te be drawn in the drawing area.
[transforms, viewport,
sample program rotation]
[scan conversion algorithm, transforms,
sample program push and pop,
circle generation text (PDF)]
NB: The circle is drawn by simply connecting the computed raster points by lines.
[projections, synthetic camera,
sample program multiple output windows and display lists]
Accelerators are used in particle physics (or high energy physics) for research after the constituents of matter and the forces that work on those constituents. Small particles (e.g. electrons, positrons, protons) are accelerated to create collisions at extremely high energies. Resulting particles of the collisions are identified by particle detectors located around the collision point for further study.
Accelerated particles can be shot on a fixed target, or two beams containing accelerated particles can be used to create collisions or events. Generally, the last type of collision is constructed in a more or less circular circuit with two counterrotating beams that collide at specific so-called interaction points on the circle. Huge detectors are constructed around the interaction points to collect event data (e.g. energy, point of traverse and time of traverse of the created particles).
Such a collider was the L3 detector in the LEP accelerator ring of the CERN laboratory near Geneva in Switserland. Currently a new, more powerful collider, the Large Hadron Collider (LHC), is running at CERN. The L3 detector has, simplified, the following subdetectors:
where:
Data of a number of events can be read from a database file.
The functionality of this event viewer should include:
The functionality of this molecule viewer should include:
Description of atoms and description of molecules can be read from data files.
Sample file with description of atoms.
The first two lines of the file are comment (description). Each following line contains a description of an atom: atom reference number, diameter of the atom (assuming the atom is displayed as a sphere) and the RGB color components of the sphere.
Sample files with molecule descriptions are
C2H2,
ethane,
SO2,
NH4
(thanks to Michiel Alsters).
The first line of each file is comment (description), the second line contains the number N of atoms that constitute the molecule, followed by a sequence of N lines with atom descriptions (atom reference number, X, Y, Z of atom center, one description per line), followed by a line with the number B of bindings between the atoms, followed by B lines of binding descriptions between two molecules (number of first molecule in description sequence, number of second molecule in description sequence, one description per line).
[NURBS,
interaction,
sample program NURBS curve]
[sample program texture mapping using image file mickey.ppm,
sample program mipmaps]
[image processing, fast Fourier transform,
backprojection,
source of FFT function,
short description of FFT function,
[see Fourier Transformatie (Dutch),
Computer assisted tomography (Dutch)]
Show these images in different OpenGL output windows or together in one OpenGL output window.
To keep computing time within limits, execute 8 steps (k=8, so 8 slices).
Step 1: phi=0,pi/2 to generate slice 1
Step 2: phi=pi/4,3*pi/4 to generate slice 2
Step 3: phi=pi/8,3*pi/8,5*pi/8,7*pi/8 to generate slice 3
. . . . . . . . .
Step k:
phi=pi/(2k),3*pi/(2k),5*pi/(2k), . . .
to generate slice k
0111111110
0100000010
0100000010
0100000010
0100000010
0100000010
0100000010
0111111110
0000000000
If phi is the scanning angle, each pixel (x,y) of ORI that is greater than zero, is added to the 1D projection array PRO. This is an array of at least N*sqrt(2.0) elements (so it can contain the maximum number of pixels at a 45 degree projection). The index in PRO is e.g. computed by:
index = center of projection array + x*cos(phi) + y*sin(phi)
and the pixel is added to the projection by:
PRO[index] = PRO[index] + ORI[x][y]
First leave out the filtering, to get the program working. Later you may add filtering functions.
For slice 2, you may add the two projections for angles pi/4 and 3*pi/4 to the existing FTPRO (to save computing time!).
Etcetera...
Mind the execution of the normalisation (step 6 van het algoritme) for each slice.
http://www.hef.ru.nl/~pfk/teaching/icg-hand/icg-12-2-4.html
The algorithm for the fourier filtering method at the end of this page has three steps. Step 1 is the transform with function "fourn.c", step 2 is the filtering, step 3 is the inverse transform with "fourn.c".
(see
http://www.hef.ru.nl/~pfk/teaching/icg-hand/icg-AF.html).
[visualisation]
grafiet1.pgm,
ltgraf18.pgm,
ltgraf22.pgm.
MM ASCII, "Magic Number", indicator of the file type:
MM = P5 PGM file, 1 byte per pixel (gray scale)
MM = P6 PPM file, 3 bytes per pixel (RGB)
# comment line ASCII, comment lines start with "#"
128 128 ASCII, number of pixels in X- en Y-direction,
two integer values
255 ASCII, maximum value of the pixel intensity,
integer with standard value 255
<byte1><byte2>....... binary, bytes with pixel information
[visualisation]