3D Lab

[Home]   [Puzzles & Projects]    [Delphi Techniques]   [Math topics]   [Library]   [Utilities]

 

 

Search

Search WWW

Search DelphiForFun.org

As of October, 2016, Embarcadero is offering a free release of Delphi (Delphi 10.1 Berlin Starter Edition ).     There are a few restrictions, but it is a welcome step toward making more programmers aware of the joys of Delphi.  They do say "Offer may be withdrawn at any time", so don't delay if you want to check it out.  Please use the feedback link to let me know if the link stops working.

 

Support DFF - Shop

 If you shop at Amazon anyway,  consider using this link. 

     

We receive a few cents from each purchase.  Thanks

 


Support DFF - Donate

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

Mensa® Daily Puzzlers

For over 15 years Mensa Page-A-Day calendars have provided several puzzles a year for my programming pleasure.  Coding "solvers" is most fun, but many programs also allow user solving, convenient for "fill in the blanks" type.  Below are Amazon  links to the two most recent years.

Mensa® 365 Puzzlers  Calendar 2017

Mensa® 365 Puzzlers Calendar 2018

(Hint: If you can wait, current year calendars are usually on sale in January.)

Contact

Feedback:  Send an e-mail with your comments about this program (or anything else).

Search DelphiForFun.org only

 

 

 

       

Earl Glynn has maintained a website of technical Delphi programs for over 20 years.   It was one of my first Delphi finds and one that belongs in my "Favorite Sites" page if I had  gotten around to create it.    This "3D Lab" program is a typical example that I had loaded into my Future Projects folder many years ago and recently rediscovered.

The program uses three support units whose source is included in the download.  These are the tools used to build the the objects demonstrated in this program.  Like my understanding of the automobile, I understand this code well enough to use it without knowing a lot about the inner workings .   I do understand the math behind simulating  points in 3D space and portraying them in 2D; it is nice do have Delphi implementations predefined in hese units.    I have used them in several programs over the years to illustrate and animate 3D objects.    

bullet

GraphicsPrimitivesLibrary defines a number of classes and procedures to simplify convert screen {pixel basedl)coordinate values to and from World Coordinates based numbers as 2 or 3 dimensional vectors.   These are used by the units below and also by other user programs.     

bullet

GraphicsMathLibrary  contains all the types and procedures necessary to define matrices to describe points and lines in regular Cartisean  (x,y,z) coordinates or Spherical (azimuth, elevation, height) coordinates.  Matrix operations allow these point descriptors to be translated  or rotated as desired.   

bullet

  

bullet

Cube

Sphere

Figure

Football Field

 DrawFigures  defines several specific wire-frame object definitions to be manipulated:  a cube, a sphere, a wavy surface and a football field.  

Earl's original 3D Lab  program allows users to select the figure to be drawn and three aspects of the viewing camera's  position relative to the image:  azimuth (the horizontal angle), elevation (the vertical angle), and distance from he object.  There is also a "Screen Control" group box with options for virtual Height and Width of the virtual  for the 2D projection of the images.  The  somewhat confusing "To Camera" value represents the virtual distance from the object  to  the screen that would produce an image of this size.   The ratio of Screen-To-Camera distance to the X or Y screen size can be considered to be the power of the viewing lens.  If we double the screen size and the To-Camera distance, the projected image is unchanged.   

Thanks for Earl for permission to modify and post the original program here on DFF.  The only significant feature I added was a speed control box to animate changing azimuth and/or elevation values.         

  Running/Exploring the Program 

bulletDownload source
bulletDownload  executable


 

 
  [Feedback]   [Newsletters (subscribe/view)] [About me]
Copyright © 2000-2018, Gary Darby    All rights reserved.