# develop-29 9703 March 1997 — source transcripts, page 2

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-develop-29-9703-march-1997-4628c3/2)

## Transcribed source material

Machine transcriptions and image descriptions; uncertain copy may be marked [illegible]. Verify against the linked originals. Historical rights remain with the original owners.

These are transcribed excerpts, not the full publications. Open the originals for remaining pages.

### PDF page 12

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-develop-29-9703-march-1997-4628c3/2#scan-5d709a477f4bc5f19a9d21dffde9d3e40bdb50f82d000ff484d3bad962f6fec8)

Transcribed text:

Q3ViewerSetFile — Loads a model into the viewer object from a previously opened 3DMF file. In our program we call StandardGetFile to obtain the details of the file to open and then open it with the File Manager, passing Q3ViewerSetFile the file reference the File Manager gave us.

Q3ViewerEvent — Gives the viewer object the opportunity to handle events, then returns a Boolean that indicates whether the event was handled.

Q3ViewerDraw — Draws the contents of a viewer object's rectangle in response to an update event.

THE MAIN ROUTINE

The main routine of BareBones3DApp handles initialization of Macintosh managers, grows the heap to its maximum size, and checks to see if the QuickDraw 3D Viewer is installed. There must be at least 24K free in the application heap before a call to Q3ViewerNew can succeed, so it's important to call the Toolbox routine MaxApplZone to grow the application heap to its maximum size at the start of the program. Otherwise, the Viewer may detect (in error) that there's not enough memory to run.

The program then calls the Toolbox routine StandardGetFile to locate a 3DMF file to open and read. The selected file is opened, and a window is created. The routine to create a viewer object looks like this:

TQ3ViewerObject Q3ViewerNew(CGrafPtr port, Rect *rect, unsigned long flags);

Notice that you need to pass in port, rectangle, and flags parameters. It's possible to create an "empty" viewer object by passing in nil for the port parameter; you can then assign a port later with Q3ViewerSetPort. The flags parameter is used to set flags that control various aspects of the behavior of the viewer object you create; these flags, along with the behavior that results when they're set, are listed in Table 1. The flags of an already created viewer object can be changed with the Q3ViewerSetFlags routine.

Table 1. Flags that control aspects of the viewer object

Flag | Result when set | Default
kQ3ViewerActive | The viewer object is active (can be manipulated). | On
kQ3ViewerShowBadge | A badge is displayed in the viewer pane. This flag should be cleared when kQ3ViewerControllerVisible is set. | Off
kQ3ViewerControllerVisible | The controller strip is visible. This flag should be cleared when kQ3ViewerShowBadge is set. | On
kQ3ViewerDrawFrame | A one-pixel frame is drawn within the viewer pane. | Off
kQ3ViewerDraggingOff | Dragging into and out of the viewer content area is disabled. | Off
kQ3ViewerDraggingInOff | Dragging into the viewer content area is disabled. | Off
kQ3ViewerDraggingOutOff | Dragging out of the viewer content area is disabled. | Off
kQ3ViewerButtonCamera | The camera viewpoint button in the controller strip is visible. | On
kQ3ViewerButtonTruck | The distance button in the controller strip is visible. | On
kQ3ViewerButtonOrbit | The rotate button in the controller strip is visible. | On
kQ3ViewerButtonZoom | The zoom button in the controller strip is visible. | Off
kQ3ViewerButtonDolly | The move button in the controller strip is visible. | On
kQ3ViewerButtonReset | The reset button in the controller strip is visible. | On
kQ3ViewerOutputTextMode | Q3ViewerWriteFile and Q3ViewerWriteData write out 3DMF data in text mode. | Off
(continued on next page)

10 develop Issue 29 March 1997

Image description: A magazine page of body text with bulleted API descriptions, a bold section heading, a code line, and a green-shaded table of flags with Flag, Result when set, and Default columns.

Reading notes: Faint background text from the adjacent page is bleeding through and was not transcribed. The partial text at the bottom right margin of the shaded area is faint and was not transcribed. Issue number and date are from the footer; the small running header text near the bottom left is illegible.

Printed dates: March 1997

Languages: English

[Original PDF page 12](https://www.vintageapple.net/files/eb458806feda4bb6fcca98f5ce1ea3d2315b5828644d330d8a1bccad24d60b70/develop-29_9703_March_1997.pdf#page=12)

[Previous transcribed scans](https://www.vintageapple.net/transcripts/media/va-develop-29-9703-march-1997-4628c3/1.md)
