Parametric Polynomial Curve Visualization

by Apostolos Lerios

polly is a simple program that allows the user to visualize and manipulate parametric polynomial curves in space. It was written as a teaching aid for Stanford's 1995 course in modeling in computer graphics (CS 348C).

The provided executable executes only on Silicon Graphics workstations equipped with the execution-only-environment (eoe) of Open Inventor (the development environment is not required). For those interested in porting polly to other platforms, the source code is also available in tar archive format; use tar xf polly.tar to unpack the archive. This source code was developed on a Silicon Graphics workstation equipped with the Open Inventor development environment.

We provide no support for polly.


Basic interaction

A typical screen of polly shows part of a parametric polynomial curve. It is drawn in white by approximating the shape of the ideal curve by many line segments. The number of these segments is determined by the "Segments" slider.

The partly transparent colored spheres mark the control points of the curve. If the curve is an interpolating one, it passes through these points at equally spaced parameter values; otherwise, the spheres mark the Bézier points of the curve. The radio buttons entitled "Curve Type" set the type of the curve.

The color of the spheres indicates the order of the control points: the first control point is blue, and the last is red, while intermediate ones have colors in-between blue and red. The yellow polyline connecting the spheres is the control polygon of the curve; along with the spheres' coloring, it identifies the ordering of the control points.

The spheres can be interactively moved by a click-and-drag interface: but first press the small arrow button on the side of the main window. Also, the viewpoint may be interactively changed: press the small hand button first. These aspects of the user interface are provided by the Open Inventor toolkit, documented on-line: just press the small "?" button.


Animation

Pressing the "Animate" button makes a green sphere appear and travel along the curve. That is, the parametric equation of the curve is perceived as a formula producing the location of a particle (the green sphere), given the simulated time as parameter.

The animation starts with the particle placed on the first control point. It ends when either the "Stop" button is pressed, or the particle passes the last control point. The speed of the particle's movement is controlled by the "Frame Step" slider, setting the amount by which the simulated time is advanced between successive animation frames.


Command-line arguments

polly accepts the following command-line arguments:
-help
Shows a short help screen and stops execution.
-count n
Sets the number of control points to n, which should be an integer greater than or equal to 2. The degree of the curve is automatically set to n-1.
-points P1x P1y P1z P2x P2y P2z ... Pnx Pny Pnz
Sets the positions of the control points. 3n real numbers must follow the switch. The first triple sets the position of the first control point: the x, y, and z components must be listed in this order. The second triple sets the position of the second control point, and so on.

Distribution notice

Copyright (c) 1995 The Board of Trustees of The Leland Stanford Junior University. All rights reserved.

Permission to use, copy, modify and distribute this software for any purpose is hereby granted without fee, provided that the above copyright notice and this permission notice appear in all copies of this software and that you do not sell the software. Commercial licensing is available by contacting the author.

This software is provided "as is" and without warranty of any kind, express, implied or otherwise, including without limitation, any warranty of merchantability or fitness for a particular purpose.

Author: Apostolos Lerios.


polly was named after Polly, the heroine of the well known weird math joke.
Last update: 25 November 1995 by Apostolos "Toli" Lerios
tolis@cs.stanford.edu