| Surface 3D | Lab Report |
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.EXEHardware Requirements
Best when run on an 800 x 600 pixel (or higher) display.
Procedure
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
14 Sep 2004
since 1 Nov 1998