INTRODUCTION TO COMPUTER GRAPHICS

Assignments (November 3, 2011)


  1. Functions
    [use of OpenGL and glut, display of simple elements,
    sample program]

    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.

  2. Mouse interaction
    [interaction, viewport, user and window coordinates,
    sample program mouse interaction, sample program viewport]

    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.
    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.

  3. Transforms
    [transforms, viewport,
    sample program rotation]

    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:

  4. Bresenham
    [scan conversion algorithm, transforms,
    sample program push and pop, circle generation text (PDF)]

    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.
    NB: The circle is drawn by simply connecting the computed raster points by lines.

    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:

  5. 3D viewer
    [projections, synthetic camera,
    sample program multiple output windows and display lists]

    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
    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).

    Description
    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:

    1. TEC (Time Expansion Chamber), wire chamber, cylinder with the axes equal to the axis of the beams around the collision point, outer diameter 50 cm, length 50 cm,
    2. EC (Electromagnetic Calorimeter), BGO crystals, outer part of sphere, inner diameter 75 cm, outer diameter 100 cm,
    3. HC (Hadron Calorimeter), wire chambers, outer part of cylinder with axis like the TEC, inner diameter 110 cm, outer diameter 200 cm, length 200 cm,
    4. MU (Muon Chambers), wire chambers, three cylinders (in real the outer shape is not circular, but octagonal) with axes like the TEC, inner diameter 210, 360 and 510 cm respectively, outer diameter 240, 390 and 540 cm respectively, length 200, 350 and 500 cm respectively.

    The data collected from the subdetectors are:

    1. TEC: theta, phi, R
    2. EC: theta, phi, E
    3. HC: theta, phi, E
    4. MU: theta1, phi1, theta2, phi2, theta3, phi3
    where:
    1. theta = angle with Z-axis in a plane through the Z-axis (0o in the positive Z-direction),
    2. phi = angle in a plane perpendicular to the Z-axis,
    3. R = radius of the circle describing the circular path of a particle,
    4. E = energy.

    The collision point equals the origin of the (x, y, z) coordinate system and also equals the center point of all subdetectors.
    Data of a number of events can be read from a database file.

    Functionality
    The functionality of this event viewer should include:

    Choice 2: molecule viewer.

    Functionality
    The functionality of this molecule viewer should include:

    Description
    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).

  6. NURBS
    [
    NURBS, interaction, sample program NURBS curve]

    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.

  7. Texture mapping
    [
    sample program texture mapping using image file mickey.ppm, sample program mipmaps]

    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.

  8. Image reconstruction
    [image processing, fast Fourier transform,
    backprojection, source of FFT function, short description of FFT function, [see Fourier Transformatie (Dutch), Computer assisted tomography (Dutch)]

    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:

    1. square,
    2. circle,
    3. ellipse,
    4. two rectangles,
    5. other interesting object (your choice, use your imagination).

    Available reconstruction methods are:

    1. non-filtered backprojection,
    2. filtered backprojection (convolution),
    3. filtered backprojection (fourier).

    Use menu's to choose object image and reconstruction method.

    Output of the program:

    1. The original object image.
    2. The sequence of 8 reconstructions (see below).
    Show these images in different OpenGL output windows or together in one OpenGL output window.

    Hints

  9. Data viewer
    [
    visualisation]

    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:
        grafiet1.pgm,
        ltgraf18.pgm,
        ltgraf22.pgm.

    A short description of the format of the input files:

    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
    

  10. Filters
    [
    visualisation]

    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.


November 17, 2011, Peter Klok