|Sphere In Cube||Lab Report|
"Sphere in Cube" shows six perspective views and three orthographic views of a sphere inside a cube.
Materials and Equipment
Delphi 3 (to recompile)
The DrawNineViews routine uses various viewports to draw a 3-by-3 matrix of views. The top row shows orthographic views, X-Y, X-Z and Y-Z, while the middle and bottom rows show various perspective views. When the Draw button is pressed, DrawNineViews is called twice to fill the two TImages, ImageBig and ImageSmall.
FillRect is used by the Clear button method to clear both TImages.
The TPantograph class needs documentation so others can use it effectively.
This example shows how to show various orthographic and perspective views of a sphere in a cube using the TPantograph object that maps real-world coordinates to a viewport area.
2D/3D vector graphics, translation, rotation, scaling, view transform, homogeneous coordinates, clipping, projections, vectors, matrices, pOrthoXY, pOrthoXZ, pOrthoYZ, pPerspective, TPantograph, Delphi 3
Delphi 3 Source and EXE (139 KB): SphereInCube.ZIP
No change to compile in Delphi 4. EXE size is 229 KB in D3 while it's 319 KB in D4.
26 Feb 2005
since 1 Nov 1998