Demo 1

Demo 1 is our main demonstration program for superquadrics. Most of the example pictures in this document were generated with it. It allows the user to produce superquadrics with a wide range of attributes which can be positioned and rotated on the screen.

Demo Features:

Demo 1 allows you to do many different operations on the displayed object. This section describes how to use each interactive capability of the demo.

Rotation:

The object can be rotated with three degrees of freedom, allowing it to be viewed in any orientation. Use the w,a,s,d,x keys to rotate the object. The w/x keys rotate around x axis, a/d rotate around the y axis and s rotates in one direction around the z axis.

Lighting:

Both demo1 and demo2 have 6 lights positioned at different places in space. These lights can be toggled on and off using the number keys 1 through 6. The examples throughout this document demonstrate the different lighting situations that can be achieved with demo 1.

Color:

Use the 3 mouse buttons to change the R, G and B color attributes of the object.

Precision, Wire Frame Mode and Low Precision Mode

A wireframe model is faster to render and may helps to show the 3 dimensional shape of the object in a different way. To view the object in a wireframe model, use the m button. Similarly, use the p button to toggle between low and high precision drawing. Often you will want to move the object around in low precision, and have it drawn in high precision when it is already positioned. The precision is a value between 1 and 16. A object with precision 8 will have 64*64 polygons, which looks good and draws quickly on the Pentium 120 machines on which the program was developed.

Zooming

You can move the object closer or further away by using the up and down arrow keys. This is useful if the object is not fitting well in the window.

Settings

Use the g key to print out information to the console about the current settings. This tells you the rotation parameters of the object, which lights are on or off, etc. This is useful for getting the information needed to reproduce the exact same view of an object at a later time.

All these features can be used by entering commands at the keyboard. Instructions are displayed on the screen.

Use:

All the demos were developed on Linux using the MESA library. By adapting the Makefile they can be compiled to other platforms with XWindows and OpenGl or Mesa. To run the program type demo1 and enter the information as shown in the following example. It is also possible to bypass these questions by using the command line - type demo1 -h for information on the correct usage of the command line parameters.

Example:

In all demos the superquadrics are numbered in the following way:
  1. Superellipse
  2. Superhyperboloid (with 1 sheet)
  3. Superhyperboloid (with 2 sheets)
  4. Supertoroid
The following is an example execution of demo 1:

SuperQuadric Viewer Program - Demo #1 

Enter object type (1 - 4) : 1
Enter e1 (Between 0.0 and 10.0, Recommend: 1.0): 1.3
Enter e2 (Between 0.0 and 10.0, Recommend: 1.0): 0.7
Enter a1 (Between 0.0 and 1000.0, Recommend: 1.0): 1
Enter a2 (Between 0.0 and 1000.0, Recommend: 1.0): 2
Enter a3 (Between 0.0 and 1000.0, Recommend: 1.0): 1
Enter precision (1 - fast, 8 - recommended, 16 - really nice) : 8
The graphical output that appears based on these inputs is: