ADC Home > Reference Library > Technical Q&As > Legacy Documents > Graphics & Imaging >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

NOTE: This Technical Q&A has been retired. Please see the Technical Q&As page for current documentation.

Exporting Light Groups in QuickDraw 3D

Q: I am writing a 3DMF export procedure, and I'm having trouble exporting a single-directional light source. The resulting file ends prematurely in the directional light's parameter list.

A: Apple developed the concept of view hints early on in the development of QuickDraw 3D, when it became apparent the particular settings for determining how a scene should be rendered in one application were not always transportable to another. In particular, settings such as the camera location, lighting, camera type, and so on can be very different in two different apps. For example, a modeling application might set everything up so the object looks good, but when the object is exported to another application and becomes part of a larger scene, it may not make sense to have the camera and light information included along with the geometry being drawn. This is why we developed view hints.

The concept of a view hint is that it sets up a series of hints that tell the reading application how the author of the metafile intended the geometries within the metafile to be rendered. Since these are hints, the reading application can ignore them.

Rather than writing out the lighting information to the metafile as absolute objects, you should create a view in the normal manner, and then add lighting, camera, renderer, and other information, also in the normal manner. Then, extract the view hints from the view with 3ViewHints_New( theView ) by passing in a view object. 3ViewHints_New( theView ) returns a view-hints object that includes the view configuration for the view you pass in.

View hints have many handy access routines for getting and setting renderers, light groups, and the like. See the "File Objects "chapter of Inside Macintosh: QuickDraw 3D (now called 3D Graphics Programming with QuickDraw 3D). An electronic copy of this book was included on the last Reference Library CD in the New System Extensions folder, and as part of the beta seed kit.

Tumbler, which is also part of the beta kit, illustrates how to use view hints read from a metafile to configure a view. For details, see the Tumbler_Document.c file.

[Jul 01 1995]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.