With the "3D Lab" you can choose a figure to display (Cube | Sphere | Cube & Sphere | f(x,y) Surface | Football field) and then use spinboxes to decide where your eye is.
Materials and Equipment
Delphi 3 (to recompile)
The DrawFigures.PAS unit defines the various objects in 3D space using "world coordinates."
The default viewing azimuth, elevation and distance is set when an object is selected. See the "absolute" trick used in the GraphicsMathLibrary.PAS unit in defining parameters to ViewTransformMatrix to be either (x,y,z) or (azimuth,elevation,distance).
A large ScreenToCameraDistance/ScreenHeight ratio specifies a narrow aperture -- a telephoto view. Conversely, a small ratio specifies a large aperture, which is a wide-angle view.
Hold down on the spinboxes (assuming you have enough spare cycles -- it works fine on a 166 MHz Pentium with 32 MB memory) to see the figure rotate left-or-right or up-or-down, or change the viewing distance. Changing these values directly changes the ViewTransformMatrix used to display the object.
This program is a convenient way to interactively view one of the selected objects.
2D/3D vector graphics, translation, rotation, scaling, view transform, homogeneous coordinates, clipping, projections, vectors, matrices, TPantograph, telephoto view, wide angle view, Delphi 3
Delphi 3 Source and EXE (160 KB): ThreeDLab.ZIP
No changes are needed to compile in Delphi 4. EXE is 274 KB in D3 while it's 361 KB in D4.
26 Feb 2005
since 1 Nov 1998