Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: 3D Graphics Programming With QuickDraw 3D /


Color Plates

Color plates are immediately preceding the title page.

Color Plate 1 Wireframe and rendered images

Color Plate 2 RGB color space

Color Plate 3 A texture applied to a geometry

Color Plate 4 Illumination shades

Chapter 1 Introduction to QuickDraw 3D 1-1

Figure 1-1 A simple three-dimensional picture 1-4

Figure 1-2 A model rendered by the wireframe renderer 1-6

Figure 1-3 A model rendered by the interactive renderer 1-7

Figure 1-4 The parts of QuickDraw 3D 1-8

Figure 1-5 A right-handed Cartesian coordinate system 1-19

Listing 1-1 Determining whether QuickDraw 3D is available 1-16

Listing 1-2 Initializing a connection with QuickDraw 3D 1-17

Listing 1-3 Terminating QuickDraw 3D 1-18

Listing 1-4 Creating a model 1-20

Listing 1-5 Creating a new window and attaching a window information structure 1-22

Listing 1-6 Creating a group of lights 1-25

Listing 1-7 Creating a Macintosh draw context 1-27

Listing 1-8 Creating a camera 1-28

Listing 1-9 Creating a view 1-30

Listing 1-10 A basic rendering loop 1-32

Listing 1-11 Rendering a model 1-33

Chapter 2 3D Viewer 2-1

Figure 2-1 An instance of the 3D Viewer displaying three-dimensional data 2-4

Figure 2-2 The controller strip of the 3D Viewer 2-5

Figure 2-3 A 3D model with a badge 2-6

Listing 2-1 Determining whether the 3D Viewer is available 2-7

Listing 2-2 Creating a viewer object 2-9

Chapter 3 QuickDraw 3D Objects 3-1

Figure 3-1 The top levels of the QuickDraw 3D class hierarchy 3-4

Figure 3-2 Incrementing and decrementing reference counts 3-12

Listing 3-1 Reporting custom object methods 3-17

Chapter 4 Geometric Objects 4-1

Figure 4-1 A mesh 4-6

Figure 4-2 A mesh face with a hole 4-7

Figure 4-3 A NURB curve 4-10

Figure 4-4 The standard uv parameterization for a pixmap 4-14

Figure 4-5 The standard surface parameterization of a box 4-15

Figure 4-6 A texture mapped onto a box 4-16

Listing 4-1 Creating a retained box 4-17

Listing 4-2 Creating an immediate box 4-18

Listing 4-3 Creating a simple mesh 4-19

Listing 4-4 Iterating through all faces in a mesh 4-21

Listing 4-5 Attaching corners to all vertices in all faces of a mesh 4-22

Chapter 5 Attribute Objects 5-1

Table 5-1 Natural sets of attributes for objects in a hierarchy 5-5

Listing 5-1 Creating and configuring a vertex attribute set 5-7

Listing 5-2 Counting the attributes in an attribute set 5-9

Listing 5-3 Reporting custom attribute methods 5-10

Listing 5-4 Disposing of a custom attribute's data 5-11

Listing 5-5 Copying a custom attribute's data 5-12

Listing 5-6 Initializing QuickDraw 3D and registering a custom
attribute type 5-13

Chapter 6 Style Objects 6-1

Figure 6-1 The front side of a polygon 6-8

Chapter 7 Transform Objects 7-1

Figure 7-1 A simple model illustrating the order in which transforms
are applied 7-4

Figure 7-2 A right-handed Cartesian coordinate system 7-5

Figure 7-3 A camera coordinate system 7-8

Figure 7-4 A window coordinate system 7-9

Figure 7-5 View state transformations 7-10

Figure 7-6 A translate transform 7-12

Figure 7-7 A scale transform 7-13

Figure 7-8 A rotate transform 7-14

Figure 7-9 A rotate-about-point transform 7-15

Figure 7-10 A rotate-about-axis transform 7-16

Chapter 8 Light Objects 8-1

Figure 8-1 A spot light 8-6

Figure 8-2 Fall-off algorithms 8-7

Listing 8-1 Creating a new point light 8-8

Chapter 9 Camera Objects 9-1

Figure 9-1 A camera's placement 9-5

Figure 9-2 The hither and yon planes 9-6

Figure 9-3 A parallel projection of an object 9-8

Figure 9-4 A perspective projection of an object 9-9

Figure 9-5 The default camera view port 9-10

Figure 9-6 Isometric and elevation projections 9-12

Figure 9-7 An orthographic camera 9-13

Figure 9-8 A view plane camera 9-14

Figure 9-9 An aspect ratio camera 9-15

Figure 9-10 The relation between aspect ratio cameras and view plane cameras 9-16

Chapter 10 Group Objects 10-1

Listing 10-1 Creating a group 10-8

Listing 10-2 Accessing all the lights in a light group 10-8

Listing 10-3 Accessing all the lights in an ordered display group 10-9

Listing 10-4 Accessing all the lights in an ordered display group using Q3Group_GetNextPosition 10-10

Chapter 11 Renderer Objects 11-1

Figure 11-1 An image drawn by the wireframe renderer 11-4

Figure 11-2 An image drawn by the interactive renderer 11-5

Figure 11-3 A constructed CSG object 11-6

Table 11-1 Calculating CSG equations 11-8

Chapter 12 Draw Context Objects 12-1

Figure 12-1 Using a two-dimensional graphics library in a Macintosh
draw context 12-6

Chapter 13 View Objects 13-1

Listing 13-1 Rendering a model 13-5

Listing 13-2 Creating and rendering a retained object 13-5

Listing 13-3 Creating and rendering an immediate object 13-6

Chapter 14 Shader Objects 14-1

Figure 14-1 Effects of the Lambert illumination shader 14-5

Figure 14-2 Effects of the Phong illumination shader 14-6

Figure 14-3 Phong illumination with various specular exponents and coefficients 14-8

Figure 14-4 Effects of the null illumination shader 14-9

Listing 14-1 Applying an illumination shader 14-11

Listing 14-2 Applying a texture shader in a submitting loop 14-11

Listing 14-3 Applying a texture shader in a group 14-12

Listing 14-4 Applying a texture shader as an attribute 14-12

Chapter 15 Pick Objects 15-1

Figure 15-1 Determining a vertex sorting distance 15-7

Figure 15-2 Determining an edge sorting distance 15-8

Figure 15-3 Determining a face sorting distance 15-8

Table 15-1 Hit-tests for window-space pick objects 15-5

Table 15-2 Pick geometries and information types supported by
view objects 15-10

Listing 15-1 Picking objects 15-11

Listing 15-2 Picking mesh parts 15-14

Listing 15-3 Picking in immediate mode 15-15

Chapter 16 Storage Objects 16-1

Listing 16-1 Creating a Macintosh storage object 16-6

Listing 16-2 Creating a UNIX storage object 16-6

Listing 16-3 Creating a memory storage object 16-6

Chapter 17 File Objects 17-1

Figure 17-1 Types of file objects 17-6

Listing 17-1 Creating a new file object 17-8

Listing 17-2 Reading metafile objects 17-9

Listing 17-3 Writing 3D data to a file object 17-12

Chapter 18 QuickDraw 3D Pointing Device Manager 18-1

Figure 18-1 A sample configuration of input devices, controllers,
and trackers 18-5

Listing 18-1 Searching for a particular 3D pointing device 18-9

Listing 18-2 Activating and deactivating a pointing device 18-10

Listing 18-3 Receiving notification of changes in a pointing device 18-10

Listing 18-4 Polling for data from a pointing device 18-11

Chapter 21 QuickDraw 3D Color Utilities 21-1

Figure 21-1 RGB color space 21-3

Listing 21-1 Specifying the color white 21-4

Listing 21-2 Adding two colors 21-4


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help