Thread View: comp.lang.pascal.delphi.misc
1 messages
1 total messages
Started by Earl F. Glynn
Sat, 13 Dec 1997 00:00
"Movies", "3D Lab" examples of using TPantograph object in 2D/3D graphics library
Author: Earl F. Glynn
Date: Sat, 13 Dec 1997 00:00
Date: Sat, 13 Dec 1997 00:00
92 lines
4547 bytes
4547 bytes
I've added two new examples of using my TPantograph non-visual object in my freeware 2D/3D graphics library. This library is intended mostly for use with floating-point calculations. You can work directly with world coordinates instead of pixel coordinates. I don't have a web site, but I'll E-mail anyone interested in these updates. You'll only get Delphi 3 source (~50K zipped) unless you ask specifically for the EXEs (~560K zipped). Here's the Readme file that has more information: Delphi 3 2D/3D Graphics Libraries and Examples for Scientific/Engineering/Mathematical Applications by Earl F. Glynn EarlGlynn@WorldNet.att.net Overland Park, KS 66214 Copyright (C) 1997, Earl F. Glynn. All Rights Reserved. May be used freely for non-commercial use. These libraries and examples were tested in Delphi 3. They worked in Delphi 1 and 2 before re-compiling in Delphi 3. LIBRARIES Graphics Math Library (GraphicsMath.PAS) This unit should be understandable by a person that knows matrix math and 2D/3D geometry. A standard college-level book on computer graphics can supply the background on the various 2D/3D transformations. Graphics Primitives Library (GraphicsPrimitives.PAS) This unit defines a non-visual TPantograph object used for mapping world coordinates (Doubles) to a canvas, which can be any canvas: screen, printer, or in-memory. 2D/3D vectors can be defined and manipulated. These vectors can be scaled, rotated and translated. A ViewTransformMatrix can be used to map 3D coordinates to a 2D plane. A default transformation matrix can be established (often a View TransformMatrix) so you can work in world coordinates. Multiple viewports can be defined on a logical window. Clipping to each viewport is possible. Figure Drawing Library (DrawFigures.PAS) A library shared by the example programs below for drawing spheres, cubes, a mathematical surface z = f(x,y), and a football field (American). EXAMPLE PROGRAMS The first two example programs have not changed much from the past. The third and fourth examples are new and show more interactivity. Example 1 (Football.EXE) This example shows three perspective views and an orthographic view of the KSU football field. You can display these four views on the screen or print them out. Example 2 (Spheres.EXE) This example shows six perspective views and three orthographic views of a sphere inside a cube. You can display these views on the screen or print them out. A "dynamic" checkbox allows one to view the drawing of each line segment. Example 3 (SphereMovie.EXE) Generate a "movie" (50 frames by default) to show a "fly around" of a sphere in a cube. (An alternate interpretation is the camera is fixed and the sphere moves around.) These frames are a TList of in-memory bitmaps that are then displayed as quickly as possible for the animation. If you increase the number of frames generated, you can use this program as a stress test of your real/virtual memory. Replay the sequence or use a scroll bar to view the images. Sometimes playback times are improved by playing several times. (I'd appreciate any help in creating an AVI file from this TList of bitmaps.) Example 4 (ThreeDLab.EXE) The "3D Lab". 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. 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. efg _________________________________________________ Earl F. Glynn EarlGlynn@WorldNet.att.net MedTech Research Corporation Lenexa, KS 66219 USA
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads