Being relatively housebound this week, I dragged out an old document I wrote 50 years ago (1970) in hopes that I could port some ancient software to the Makerphone.
In 1970, my employer asked my recently graduated engineer self how to project a 3-D solid object represented by a wire frame onto a screen such that the hidden lines would be, well⊠, hidden. Sounded simple enough, but remember in 1970 we didnât have any tiny graphic chips with OpenGL embedded on them; in fact OpenGL itself was more than 20 years in the future. And the projectors we were talking about couldnât do raster graphics, only monochrome line drawing (in the spirit of todayâs laser light shows.)
My research led me to a paper in the Communications of the ACM by R. Galimberti and U. Montanari in Milan entitled An Algorithm for Hidden Line Elimination which you can read here: Galimberti.pdf. I wrote a FORTRAN program that implemented that algorithm, a rather large box of punched IBM cards. It worked out well for the application my employer required, but could not, even on a powerful mainframe, do the projections (with hidden line elimination) in real-time. The box of cards is long gone, but I had managed to recreate the implementation in C years later based on a FORTRAN listing, and wrote a Windows program to show it off; with modern PC hardware, the algorithm could easily generate many frames per second in response to real-time changes in the orientation of the object.
So this brings us to the app, which I call galimber, and which you can get from this zip file: galimber.zip (668.5 KB) . Just unzip the file and copy the directory galimber to the root of your Makerphoneâs SD card (do not rename it⊠it must be named galimber). Replace the SD card in the phone, power it up, and among the app icons, youâll find one that looks like a green abstract object. Run that app. When loaded, it will ask you to select from one of 7 wire-frame objects to be used as input to the algorithm. I suggest you start with SAMPLE and try the others at your leisure.
Once an object has been selected, it will be displayed as a 2-dimensional projection (with hidden line elimination) of the 3-dimensional object rotating about 3 axes. While the object is rotating, you can change the speed of rotation about each of the 3 axes as follows:
Left function button: decrease the increment for angle psi
Power button: increase the increment for angle psi
Home button: decrease the increment for angle theta
Right function button: increase the increment for angle theta
Asterisk button: decrease the increment for angle phi
Hashtag button: increase the increment for angle phi
Each button press increases or decrease the corresponding angle increment slightly, affecting the rotation.
The program can be restarted by pressing the A button.
The program can be terminated by pressing the B button.
Note: the object HELO is incorrectly defined in its object file, but Iâve never had the energy to find the problem and fix it. The algorithm depends on the object being perfectly defined, so this one will not render correctly at every angle.
Once I make the source code presentable (much of it is VERY old), Iâll publish it here. It compiles and links using the Arduino IDE.