VIEW

The program that drew in 3D what the Apollo astronauts saw out of the window

In 1969, a NASA program computed, point by point, the stars, the Earth, the Moon and the craters below the lunar module, exactly as they would appear from the spacecraft. It was all done with mathematics on a UNIVAC 1108 computer, and the picture came out on microfilm, photographed off the screen of a cathode-ray tube.

Author
G. B. “Bernie” Roush, NASA Houston
Computer
UNIVAC 1108
Language
FORTRAN V
Output
frames on microfilm, then on paper
Four “reels” in the style of the film attributed to the VIEW program, computed now in your browser. They are not original images. The “Homeward” reel uses the distances and speeds printed in the NASA report for Apollo 11.

1.0A geometry problem

A flight to the Moon means four bodies in motion: the spacecraft, the Earth, the Moon and the Sun. At every manoeuvre the spacecraft is pointed in a particular way, and the crew has to know in advance what they will see out of the window.

Which stars will be in the field of view? Where will the horizon be? Will the Sun shine in through the window during the engine burn? A 1969 NASA report openly admits that, because of the complex geometry, it is hard to picture every aspect of a lunar mission. The June 1972 technical report that describes the program goes further: the geometry of the Earth, the Moon, the Sun and the spacecraft changes all the time, and the picture becomes even harder to build in one's mind when the frame of reference is the moving spacecraft itself. Training simulators helped, but they had mechanical limits and the analysts planning the mission had little access to them.

The answer came from the Computation and Analysis Division of the Manned Spacecraft Center in Houston. Programmer G. B. “Bernie” Roush wrote a program that computed mathematically, and drew, what can be seen from the spacecraft at any moment of the mission. The program already existed and was hardly used: it had been written as an aid for the rendezvous and docking studies of Project Gemini. It was taken up again and extended before the flight of Apollo 8. For the lunar missions, its first purpose was a simple manual method by which the crew could head back to Earth in an emergency, finding their attitude by the sky.

Its best-known result is the report for Apollo 11. The revision of 3 July 1969, signed by Alfred N. Lunde, has 303 numbered pages, almost all of them with drawings generated by the program: views out of the window at every major burn, the Earth and the Moon hour by hour on the way out and back, the sky seen through the navigation telescopes. Some of them went straight into the flight plan the crew had on board.

2.03D in 1969: everything is a vector

Today a graphics card draws billions of triangles per second. In 1969 there was nothing of the kind, but the principles were already the ones we use today.

The 1972 report explicitly lists “three-dimensional display problems” among the things that had to be solved before the program could serve the lunar missions. The program worked with vectors: three numbers (x, y, z) for each star, for the centre of the Earth, for each point on the outline of a continent or on the rim of a crater. To these vectors it applied, in order, a few operations that every video game still performs today: rotation into the spacecraft's coordinate system, projection onto a plane, hidden-line removal and lighting. Below you can go through the steps one at a time on a reconstructed frame: the Earth seen 6 hours after launch, with the stars of Scorpius around it.

Build a frame step by step

Figure 2.0-1. The same frame, built in six steps. The background stars and the outlines of the continents are approximate.

Following a single star: Antares
Vector in space
Attitude matrix
In the spacecraft frame
On the drawing
Surface points

The matrix in the table is a simplified version of what NASA called the REFSMMAT: a 3×3 matrix linking the inertial reference frame to the spacecraft's guidance platform. The Apollo 11 report prints such matrices for every phase of the flight. Here, for example, is the one used for passive thermal control, the phase in which the spacecraft turned slowly so that the Sun would heat it evenly:

 .86602540  -.45872739  -.19892002
-.50000000  -.79453916  -.34453958
 .00000000   .39784004  -.91745480

Source: report MSC 69-FM-197, table II(b). The exact attitude for a drawing was given by this matrix plus three inertial platform angles.

How was this possible on a computer with 1.2 MB of memory? Because the program did not shade surfaces: it traced lines and dots, and the bodies that mattered were spheres. For a sphere, deciding whether a point can be seen, or whether it is lit, takes a single vector multiplication.

Two details show how serious the computation was. The double precision of the UNIVAC 1108 had a 60-bit mantissa, more than the 53 bits of the floating-point numbers in today's computers. And the authors of a modern reconstruction estimate, as a rough guide and without measurements, about one second of computing per frame. For hundreds of frames per mission, that was a heavy workload for the time.

3.0A picture that came later

VIEW showed nothing on an interactive screen. It ran as a batch job: it took in the data, did the computing, and the result came back on film.

  1. The trajectory documentThe input was the spacecraft's position, velocity and attitude, plus the GMT time. These came from the operational trajectory document, printed a few months before each mission.
  2. The integratorThe first part of the program computed the motion of the spacecraft step by step, starting from the initial position and velocity. It used one of two classic methods: Cowell's method, which adds up all the gravitational forces directly at every step, or Encke's method, which follows only the departure from an ideal orbit and is cheaper when the spacecraft moves almost along an ellipse. It could follow up to four vehicles at once, for example the lunar module and the command module after they separated.
  3. The graphics partThe second part built a frame at every nth step of the integration. Coordinates could be expressed in four systems: Earth-fixed, Earth-centred inertial, selenographic (tied to the Moon) and spacecraft axes.
  4. The cathode-ray tube and the cameraThe picture was formed from dots on the screen of a cathode-ray tube; lines and curves were really dots joined together. A camera photographed the screen onto microfilm. The reports do not give the exact model of the equipment.
    The detour through the printerUntil the developed film came back, the user could ask for the numerical data and a rough sketch printed in characters, to check quickly that they had asked for the right thing.
  5. PaperFor most uses, the frames were printed on standard sheets, bound into reports and copied into the flight plan.

You can try the printer sketch right now. The button below “prints” the frame from section 2.0, with the attitude you chose there, on green-bar printer paper like the paper in the computing centres of the time.

press “Print the sketch”

4.0Anatomy of a frame

Every drawing in the report follows the same conventions. Once you know them, you can read any page.

Below is a frame reconstructed from figure 5.1-1(a) of the Apollo 11 report: the start of translunar injection (TLI), the burn that takes the spacecraft out of Earth orbit and sends it towards the Moon. The flight data are those printed in the report. The star positions and the shape of the window are illustrative. Press the numbers to see what each element means.

5.0Technical problems and how they were solved

For the lunar missions, the old program from the Gemini era had to be reworked in earnest.

The 1972 report lists the areas that were worked on: input and output options, coordinate transformations, the addition of lunar and solar ephemerides, three-dimensional display problems and realistic window outlines. The authors note that once the objectives had been clearly set, they were met without major obstacles. Here are the concrete problems and their answers, as they emerge from the reports.

ProblemSolution

There were no interactive graphics screens. The picture came out on microfilm, which had to be developed.

Before the film arrived, the program could print the numerical data and a rough sketch made of characters, for a quick check. The final frames were then printed on ordinary paper, easy to bind into reports and to take on board.

Little memory and expensive computer time: 262,144 words, about 1.2 MB.

The program was split into two parts, the integrator and the graphics part, and a frame was drawn only at every nth step of the integration. The pictures were made of dots on the cathode-ray tube, joined into lines, not of shaded surfaces.

Each phase of the flight used a different frame of reference. The attitude indicators at launch meant nothing physical to the crew.

The program was given transformations between four coordinate systems (Earth-fixed, inertial, selenographic and spacecraft), with a platform fixed in space or tied to the local vertical, plus ephemerides for the positions of the Sun and the Moon. The result was a concrete picture: which star or which horizon should appear in the window.

Hidden lines: without them, the far side of the Earth is drawn over the near side.

For spheres, the test is a dot product: a point is visible if its surface faces the spacecraft. For vehicles, the report mentions hidden-line models of the lunar module and of the S-IVB stage: from a given attitude, only the part that can be seen is drawn.

Sometimes another spacecraft had to be in the picture, not just the sky.

The program could compute up to four trajectories at once, for rendezvous or after the modules separated, and draw the outline of the command module, the lunar module or the S-IVB stage at its true apparent size. This made it possible to check whether the other vehicle would come into the window or into the field of an optical instrument.

Real windows are small, and astronauts can move their heads.

The window outlines were computed from the engineering drawings for the astronaut's design eye position. Even so, the drawing shows a wider field than the window, so that the crew could recognise a constellation even if part of it could not be seen through the glass.

A 100° field of view distorts the picture, like a “fish-eye” lens.

For the overall views, the effect was accepted and explained. For the landing studies, where detail mattered, the field of view was deliberately narrowed, to remove the distortion and increase the resolution.

Too many stars make the drawing hard to read.

The program had two catalogues. The one used more often held the 391 stars for navigation sightings: the first 37, the main Apollo stars, were named and the rest appeared as asterisks. The second catalogue had 1,078 stars down to magnitude 4.5, all drawn as unnamed dots.

The Earth's terminator is not a sharp line.

The program traced the terminator as a circle perpendicular to the direction of the Sun and marked the night side with shading lines. The report openly admits the limitation: because light is scattered in the atmosphere, the real terminator of the Earth could not be reproduced exactly.

The lunar surface near the landing site had to look right.

Two-dimensional crater models were built from photographs of the area near landing site 2 and fed into the program. In the real perspective of the descent, circular craters appear as ellipses. The lunar module windows, with the LPD sighting scale and the docking alignment mark, were taken from the engineering drawings.

The flight plan changed. On Apollo 11 a lunar orbit was added before the descent.

The program was run again. The revision of 3 July 1969 replaced the June edition: the data stayed the same up to 99 hours of flight, and after that every time moved by about two hours.

Parts of the spacecraft block the view.

For Apollo 10, the view from the command module with the lunar module docked was studied: the lunar module covered much of both rendezvous windows, but a few lunar landforms could still be seen through them and through the hatch window. The obstructions were drawn, so the crew knew about them in advance.

How do you know a computed drawing is right when you have nothing to compare it with?

Throughout development, the results were checked by hand. Only once confidence in the program had been established could the drawings be used for real decisions.

6.0What it was used for

The first real test came with Apollo 8, in December 1968.

Lunar orbit insertion took place behind the Moon, with no radio contact with Earth, with the spacecraft heads-down and with attitude angles referred to an inertial frame that had no obvious connection with what could be seen outside. On top of that, because the terminator moves across the Moon, the surface was not always lit at the moment of ignition. The program drew the lunar horizon as it would appear in the window at the exact time and attitude of the burn. For the first time it was shown that the crew could decide on their own whether or not to go ahead, simply by checking that the horizon lay next to a mark on the window.

The same principle was applied to translunar injection, where there were several ignition opportunities and the ground could not follow every option: the crew checked their attitude against the Earth's horizon, through the alignment sight. From then on, the list of applications grew from one mission to the next:

6.1 The Earth, hour by hour

On the way to the Moon, the report shows the Earth every hour, so that the crew would know which part of the world was facing them. There are two series. In the one with a constant field of view, the Earth gets smaller from one hour to the next. In the one with a variable field, the program “zoomed in” so that the Earth filled the frame. The distances and speeds below are the ones printed in the report.

Figure 6.1-1. The outlines of the continents are simplified and the rotation of the Earth is approximate.

At 3 hours after launch the variable field of view is 100°; by 62 hours it is down to 3°, because the Earth looks smaller and smaller.

6.2 Entry: the horizon on the 31.7° line

In the last 15 minutes, the command module approaches the atmosphere heat shield first. The angle between the spacecraft axis and the Earth's horizon had to be held at 31.7°, and a line was etched on the window for exactly that angle. Apollo 11 entered the atmosphere on the night side, so the horizon appears as a black edge that hides the stars. The nine frames recreate the series in the report, with the data printed there; for the frame at minus 15 minutes, we computed the altitude ourselves, because it is missing from the scan.

Figure 6.2-1. The stars, the Moon and the shape of the window are approximate.

You can see how the horizon stays at the same angle but flattens out as the spacecraft descends, while the speed climbs towards 11 km/s. This is a secondary attitude check: if the horizon sits on the etched line, the spacecraft is pointed correctly.

7.0Apollo 13: a tool used in a way nobody had planned

For the lunar missions, the program's first purpose had been precisely an emergency: a return to Earth with the attitude set by hand, by the sky. In April 1970, that is exactly what had to be done.

Before the flight, for contingency planning, views had already been published for abort manoeuvres, for example a command module burn two hours after lunar orbit insertion. The aim was to show that such unusual operations were feasible. The 1972 report notes that, fortunately, the program had been developed and had already won the confidence of the teams, so it could be used exactly when it was needed.

Times are g.e.t., the time elapsed since launch (11 April 1970, 19:13:00 GMT), from NASA's official timeline and the transcript in the Apollo 13 Flight Journal. Some events are recorded in the documents only to the minute.

  1. Oxygen tank no. 2 in the service module explodes. At 055:55:20, Jack Swigert reports: “Okay, Houston, we've had a problem here.” The command module starts losing power and oxygen.

  2. The command module's computer and guidance platform are switched off, to save the remaining power for entry. At 058:40 the command module is shut down completely and the lunar module becomes a lifeboat: it had been designed for two people for two days, not for three people for four or five days.

  3. The lunar module's descent engine burns for 34 seconds and puts the spacecraft back on a free-return trajectory, which swings around the Moon and heads back to Earth.

  4. After the pass behind the Moon, another burn, of 4 minutes and 24 seconds, speeds up the return. At 082:10 the lunar module's systems are powered down as well, to save energy.

  5. For course correction MCC-5, made without the guidance computer, Vance Brand passes on mission control's instructions: in the burn attitude, the Sun should appear right at the top of the alignment telescope. The crew is given a single rule: if the rate about any axis reaches 10° per second, the burn is stopped.

  6. Fred Haise describes the picture Jim Lovell sees through the COAS: the lit part of the Earth in the upper half, with the cusps of the crescent exactly on the Y-Y line of the reticle. At 103:51:07, Brand confirms that this puts the spacecraft's +X axis towards the Sun, perpendicular to the terminator.

  7. Jack Lousma reads up the burn plan: the descent engine at 10% throttle, shut down by hand at 14 seconds, for a velocity change of 7.8 ft/s (2.38 m/s). Ignition was planned for 105:30:00, but mission control had said that the burn was not sensitive to the exact time.

  8. Lovell reports that the attitude is set. At 105:10:50, Haise checks through the alignment telescope: the Sun is at the top, about 2° to the right of the mark.

  9. Ignition. Shutdown comes at 105:18:42, after 14 seconds. The engine gives 7.4 ft/s, and the attitude thrusters bring the total to 7.6 ft/s (2.3 m/s). This is the correction made without the guidance computer, and so most likely the one the 1972 report means when it says that the views of the Earth were the only attitude reference. In the broadcast at the time, the NASA commentator announced ignition at 105:18:32; the official timeline gives 105:18:28.

  10. Lovell tells the ground that, although he thought he would never need it, the technique turned out to be a good one.

  11. The last course correction, with the lunar module's thrusters. This time the guidance platform had been realigned, at 134:40.

  12. The command module enters the atmosphere at 11.04 km/s. The lunar module had been jettisoned at 141:30:00.

  13. Splashdown in the Pacific.

One important moment has no exact time in the documents. Bernie Roush recalled being called in to the centre at 2 a.m. Houston time to redo the calculations and adapt the program, so that the specialists in mission control could give the astronauts the information they needed as they approached entry; the interview does not say on which day. The 1972 report adds that the crew was also given descriptions of the view out of the window for the abort burn. Roush also said that the program was meant mainly for planning and had not been designed for a situation like this, but that it was the only tool available.

Try it: keep the Earth in the sight

A simplified game, not a simulation of the real dynamics. The spacecraft drifts slowly. Line up the Earth with the cusps of the crescent on the Y-Y line, start the burn and hold it there for 14 seconds. The controls turn the spacecraft, so the Earth moves the opposite way, as it would in reality.

Arrows: pitch and yaw. Q and E: roll. Click the sight to use the keyboard.

roll
left
roll
right
engine

Press “Start”. The spacecraft will begin to drift.

8.0What is left of VIEW

The source code is not known to have survived. What remains are the reports, hundreds of pages of drawings and a short film attributed to the program, with four sequences: an Earthrise, the approach to Earth, the lunar module turning, and the lunar module's window during the descent. The archival source of the film is unknown, but the 1972 report confirms that the program could draw the lunar module, hidden lines included.

8.1 The Apollo 8 Earthrise, drawn the way VIEW would have

The first Earthrise ever seen by people took place on 24 December 1968, on the fourth orbit of Apollo 8, the very mission for which VIEW had been developed at full scale. Nobody had planned it. The Earth had risen on the earlier orbits too, but no window was facing it; only the roll ordered by Frank Borman brought it into view. NASA's 2013 reconstruction, using data from the Lunar Reconnaissance Orbiter, pinned down the moment precisely: a three-minute window starting at 75:46:19 g.e.t., or 16:37:19 UTC.

Below is the same interval, drawn following the VIEW conventions, one frame every 20 seconds, as on a strip of microfilm. The coincidence is real: the Hasselblad camera mounted in Borman's window was also taking a picture automatically every 20 seconds. The positions of the Sun and the Moon are computed from ephemerides for each frame, as the program did. That is why the face of the Earth is the real one: the centre of the disc falls in the Atlantic, near the Gulf of Guinea, the Sun is overhead above South America, and the terminator crosses Africa. The background stars are real too, from the constellation Leo.

Figure 8.1-1. A 10° field of view, close to that of the 250 mm telephoto lens used for the photographs. The orbit is taken as circular, at 111 km, in the plane of the ecliptic. The exact moment the Earth clears the horizon depends on the lunar relief, and the craters are generic, so here it is illustrative.

The flight data in the header (RM, V, HM) are computed for a circular orbit of 60 nautical miles, Apollo 8's orbit after the second lunar orbit insertion burn; they are not quoted from a report.

Recently, two enthusiasts reconstructed the program from the documents. VIEW-1108 rewrites the core in FORTRAN, in 1960s style, and runs it in the browser. Apollo Software Library rebuilds it in TypeScript and compares every drawing with the original scan, degree by degree. One mystery is still unsolved: on some drawings, the 1969 program traced the horizon of the Earth or the Moon as a circle much smaller than the real one, and the rule it followed has not yet been found.

The idea went further. The 1972 report recommended such a capability for any future space programme in which safety depends on how people understand their position relative to their surroundings. Today, NASA's Scientific Visualization Studio recreates moments from the Apollo missions with data from current spacecraft; its reconstruction of the Earthrise photograph settled old debates about how the picture was taken and by whom.

9.0Sources

  1. A. N. Lunde, Revision 1 to Views from the CM and LM during the flight of Apollo 11 (Mission G), MSC Internal Note 69-FM-197, NASA, 3 July 1969.
  2. Charles T. Hyle, Alfred N. Lunde, Apollo Experience Report: The Application of a Computerized Visualization Capability to Lunar Missions, NASA TN D-6853, Manned Spacecraft Center, Houston, June 1972. Full text on NTRS and the scan on HathiTrust.
  3. Interview with Bernie Roush, KPRC Click2Houston, 2019.
  4. VIEW-1108, a reconstruction in FORTRAN, with a version that runs in the browser.
  5. Apollo Software Library, a reconstruction checked against the original scans, with its own site.
  6. Apollo 13 Flight Journal, Day 5, part 3: The Manual Course Correction, a transcript with times to the second.
  7. Transcript of the Apollo 13 communications, Spacelog.
  8. Richard W. Orloff, Apollo by the Numbers: Apollo 13 timeline, NASA SP-4029.
  9. Earthrise in 4K, NASA Scientific Visualization Studio, 2018: the timing and course of the Apollo 8 Earthrise.
  10. Ernie Wright, the reconstruction of the Earthrise photograph, NASA Goddard, 2018.
  11. Noah Bolanowski's thread about VIEW on X, which brought the film back to attention.