Graphics
Surface 3D  Lab Report
Display a "Fishnet" Surface

Purpose
"Surface3D" produces several perspective plots of a "fishnet" surface described mathematically as
z = f(x,y) = x * y * (x2 - y2) / (x2 + y2).
( Hidden lines are not removed.)

Materials and Equipment

Software Requirements
Windows 95, Delphi 3 (to recompile)
Surface3D.EXE

Hardware Requirements
Best when run on an 800 x 600 pixel (or higher) display.

Procedure

  1. Double click on the Surface3D.EXE icon to start the program.
  2. Select the Draw button to see the four views of the surface drawn dynamically.
  3. To repeat, select Clear and Draw buttons.
  4. Select the Write BMP button to create a 1024-by-1024 pixel bitmap, Surface.BMP.
  5. Select the Print button to print the surface views in a landscape orientation.

Discussion
The DrawSurface procedure draws the surface views on the Image.Canvas, the Printer.Canvas or a Bitmap.Canvas using four different viewports.

The RepaintNeeded parameter to DrawSurface is a bit of a kludge. When this parameter has the value TRUE, the Image is updated after each column or row is plotted. This is only needed for the Draw method. This parameter is set FALSE for creating the file or printed output.

As a simple way to blank an image, the ButtonClearClick method assigns NIL to Image.Picture.

See the
3D Lab to interactively change the camera viewpoint.

Conclusions
This example shows how to draw perspective views of a "fishnet" surface.


Keywords
D/3D vector graphics, translation, rotation, scaling, view transform, homogeneous coordinates, clipping, projections, vectors, matrices, TPantograph, Delphi 3

Download
Delphi 3 Source and EXE (136 KB): Surface3D.ZIP


Updated
26 Feb 2005


since 1 Nov 1998