|
 |
 |
To access the contents, click the chapter and section titles.
Cutting Edge Direct 3D Programming
(Publisher: The Coriolis Group)
Author(s): Stan Trujillo
ISBN: 1576100502
Publication Date: 11/01/96
Index
A
- Absolute values
- specifying, 140
- Ambient light, 190202
- adding to a scene, 75
- defined, 42
- demo, 191202
- AmbientLightWin class, 194195
- AmbientLightWin::CreateScene function, 196200
- render functions, 201202
- AmbientLightWin class, 194195
- class definition, 194195
- CreateScene function, 195200
- creating and loading a mesh, 197
- creating the frame, 197198
- creating the light source, 198199
- creating the viewport, 199200
- render functions, 200202
- Animation, 77, 279289
- 3D, 49
- assigning motion attributes, 49
- key-framing, 4950
- animating textures, 4142
- constructing animation sequences based on keys, 78
- removing keys, 78
- controlling animation sets, 80
- controlling in a scene, 58
- key-framing, 266
- Rocket demo, 267278
- morphing, 318340
- MorphPlay demo, 319340
- options, 78
- setting, 79
- setting time in, 78
- Target demo, 279289
- vertex, 294307
- Cube demo, 294307
- Applications
- full-screen, 397
- defined, 399
- FullScreen demo, 429
- windowed
- defined, 399400
- AppWizard
- creating an MFC application, 1012
- creating projects with, 9
- defined, 9, 89
- Direct3D custom AppWizard, 1519
- overall structure of AppWizard programs, 89126
- writing custom AppWizards, 15
- ASSERT macro
- defined, 98
- Axis
- defined, 23
- scaling objects on a local axis, 3436
C
- C++
- MFC
- creating an application with AppWizard, 1012
- defined, 5
- message map, 7, 8
- modifying an application with ClassWizard, 1214
- strong type checking, 19, 20
- using C++ classes to manage Direct3D interfaces, 9394
- Callback functions
- adjusting an objects rotation, 248
- animating a scene, 234235
- animating a texture, 176178
- calculating rotation attributes during a drap operation, 375376
- controlling a viewports field-of-view, 352353
- defined, 64, 121
- installing a texture, 185186
- orienting one frame according to the movement of another frame, 288289
- performing color animation, 316317
- performing vertex animation and mesh rotation, 303306, 314316
- relocating meshes during a drag operation, 364365
- updating a morph sequence, 336337
- updating a scene, 121123, 169170, 276
- updating an animation sequence, 288
- Classes
- AmbientLightWin
- CreateScene function, 195200
- render functions, 200202
- class hierarchy explained, 93
- Cube2Win
- class definition, 309
- CreateScene function, 310313
- render functions, 317318
- UpdateColors callback function, 316317
- UpdateCube callback function, 314316
- CubeWin
- class definition, 295
- CreateScene function, 296303
- render functions, 306307
- UpdateCube callback function, 303306
- DecalWin
- class definition, 157158
- CreateScene function, 158161
- designing, 9394
- FacePickWin
- class definition, 366367
- color functions, 376377
- CreateScene function, 368371
- file functions, 377380
- mouse functions, 371373
- PickFace function, 373374
- UpdateDrag callback function, 375376
- FireflyWin
- class definition, 204
- CreateScene function, 204209
- FullScreenWin
- class definition, 430431
- CreateFPSSurface function, 440441
- CreateMenuSurface function, 437
- CreateScene function, 434437
- FullScreenWin function, 433434
- KeyDown function, 445447
- Render function, 442445
- UpdateFPSSurface function, 441442
- UpdateMenuSurface function, 438440
- JadeWin
- class definition, 133134
- CreateScene function, 134143
- MoveFrame function, 143144
- render functions, 144145
- MeshPickWin
- class definition, 356
- CreateScene function, 357361
- creating multiple meshes with frames, 359360
- creating the light source, 360361
- installing a callback function, 360
- loading the mesh, 359
- mouse functions, 361364
- UpdateDrag callback function, 364365
- MoleculeWin class
- children functions, 265
- class definition, 257
- CreateChildren function, 262264
- CreateHierarchy function, 262
- CreateScene function, 258261
- depth functions, 264265
- MorphPlayWin
- class definition, 331333
- CreateScene function, 333334
- InitMorphSequence function, 335336
- mouse functions, 337340
- OnFileOpen function, 334335
- UpdateMorph callback function, 336337
- MorphWin class
- AddMorphKey function, 330
- class definition, 322323
- CreateAnimations function, 328329
- GetMorphMesh function, 331
- GetNumMorphTargets function, 329
- LoadMeshes function, 325327
- LoadMorphSequence function, 324325
- PrepareMorphVertices function, 329
- SetMorphTime function, 330331
- MultiViewWin class
- class definition, 381
- CreateScene function, 382
- OrbStarWin
- callback functions, 169170
- CreateScene function, 163169
- RMWin
- background, 9394
- constructing scenes, 108115
- helper functions 124125
- maintaining scenes, 115123
- object creation functions, 98108
- shutting down, 123124
- RMWin(modified for full-screen apps)
- adding display mode support, 406
- class definition, 404405
- member functions, 407
- palette support, 407
- removing obsolete functions, 405406
- surface support, 407
- RMWin (modified for multiple views), 384386
- ConfigViewport function, 390391
- CreateDevice function, 386389
- CreateViewport function, 391
- class definition, 384385
- OnSize function, 393394
- Render function, 391393
- viewport functions, 394395
- RocketWin
- animation functions, 276,278
- class definition, 268
- CreateScene function, 269270
- creating a frame for the rocket mesh, 275
- creating the animation sequence, 272274, 275
- creating the rocket mesh, 271272
- source code, 269270
- speed functions, 278
- UpdateScene callback function, 276
- ShadowWin
- AdjustSpin callback function, 248
- class definition, 239240
- CreateScene function, 240248
- creating a frame for the floor mesh, 245
- creating a frame for the fork mesh, 245246
- creating a point light source, 246247
- creating an ambient light source, 246
- creating and applying the floor mesh texture wrap, 244245
- creating the floor mesh texture, 244
- creating the fork mesh, 245
- creating the mesh to represent the floor, 243244
- creating the shadow object, 247
- creating the viewport, 247248
- render functions, 248249
- ShowRoom
- CreateScene function, 180185
- SpaceDonutWin
- class definition, 218
- CreateScene function, 219225
- applying the texture to the mesh, 223
- creating and attaching the frame, 223224
- creating and loading the frosting texture, 222
- creating the donut mesh, 221222
- creating the light source and its frame, 224225
- creating the viewport, 225
- SpaceStationWin, 211
- class definition, 211
- CreateScene function, 211217
- SpotlightWin
- beam functions, 237238
- class definition, 228229
- CreateScene function, 229234
- creating a frame for the light source, 233234
- creating a viewport, 234
- creating and positioning a frame for the meshes, 232,233
- creating the light source, 233
- intializing the pointers, 232
- loading the spherical mesh, 231232
- source code, 229231
- MoveLight callback function, 234235
- render functions, 235237
- TargetWin
- class definition, 280
- callback functions, 288
- CreateScene function, 281288
- creating multiple frames for the missile mesh, 287288
- creating the animation sequence, 284285
- creating the frame for the target mesh, 286
- creating the missile mesh, 287
- loading the target mesh, 284
- MoveTarget callback function, 288
- OrientFrame callback function, 288289
- TextureDriftWin
- class definition, 173
- callback functions, 177, 178
- CreateScene function, 173176
- WrapsWin
- class definition, 147148
- CreateScene function, 148149
- ZoomWin
- AdjustField callback function, 352353
- animation functions, 353354
- class definition, 345346
- CreateScene function, 347352
- ClassWizard
- adding event handlers, 1214
- defined, 89
- illustrated, 8
- modifying an MFC application, 1214
- modifying event handlers, 89
- sample code, 9
- Color
- adjusting specular light color on faces and meshes, 74
- applying color to a mesh, 376377
- assigning color to faces and meshes with normals, 3031
- assigning to the faces in a mesh, 66
- color models, 59
- emitting light, 75
- how they affect light sources, 190
- controlling the colors used to render scenes, 59
- controlling the number of colors used to represent a texture, 72
- conversion functions, 125126
- defining light source colors, 42
- enabling and disabling dithering, 5960
- inspecting and changing the color of a face, 70
- COM
- analyzing interface dependencies, 9192
- defined, 5455
- Iunknown object, 55
- member functions, 55
- object/interface relationship, 5455
- rules for using, 55
- CONV3DS utility, 84
- options, 85
- Coordinate system (3D)
- axes, 23
- left-handed, 2324
- origin, 25
- planes, 2728
- right-handed, 2324
- vectors, 2526
- Cube demo, 294307
- CreateScene function
- applying a texture to the cube mesh, 301302
- creating a cube mesh, 297
- creating a frame for the cube mesh, 302
- initializing the cube mesh, 298301
- installing a callback function, 302303
- CubeWin class, 295296
- class definition, 295
- CreateScene function, 296303
- render functions, 306307
- UpdateCube callback function, 303306
- illustrated, 294
- overview, 294295
- techniques demonstrated, 295
- Cube2 demo, 308318
- CreateScene function
- creating a frame for the mesh, 313
- creating a mesh composed of two groups, 312
- creating and applying a texture for the mesh, 313
- initializing the callback functions, 313314
- illustrated, 308
- overview, 308309
- techniques demonstrated, 309
- Cube2Win class, 309
- CreateScene function, 310313
- creating a frame for the mesh, 313
- creating a mesh composed of two groups, 312
- creating and applying a texture for the mesh, 313
- initializing the callback functions, 313314
- source code, 310311
- class definition, 309
- render functions, 317318
- UpdateColors callback function, 316317
- UpdateCube callback function, 314316
- CubeWin class, 295296
- class definition, 295
- CreateScene function, 296303
- applying a texture to the cube mesh, 301302
- creating a frame for the cube mesh, 302
- creating the cube mesh, 298
- initializing the cube mesh, 298301
- installing a callback function, 302303
- source code, 296297
- render functions, 306307
- UpdateCube callback function, 303306
D
- Data types, 8084
- D3DCOLOR, 8182
- D3DRMBOX, 82
- D3DRMQUATERNION, 8384
- D3DRMVERTEX, 8283
- D3DVALUE, 8081
- D3DVECTOR, 81
- HRESULT, 84
- Decal demo, 156161
- CreateScene function
- creating textures for decals, 160
- creating the frames, 160161
- DecalWin class
- class definition, 157158
- CreateScene function, 158161
- dummy frame, 157
- illustrated, 157
- overview, 156157
- techniques demonstrated, 156
- Decals
- Decal demo, 156161
- defined, 72, 156
- manipulating, 73
- functions for, 73
- DecalWin class, 157158
- class definition, 157158
- CreateScene function, 158
- creating textures for decals, 160
- creating the frames, 160161
- Demos
- AmbientLight, 191202
- Cube, 294307
- Cube2, 30818
- Decal, 156161
- FacePick, 365380
- Firefly, 202209
- FullScreen, 429446
- Jade, 131145
- MeshPick, 355365
- Molecule, 255265
- MorphPlay, 319340
- MultiView, 380395
- OrbStar, 162170
- Rocket, 267278
- Shadow, 238249
- ShowRoom, 178186
- SpaceDonut, 217225
- SpaceStation, 210217
- Spotlight, 227238
- Target, 279289
- TextureDrift, 171179
- Wraps, 146156
- Zoom, 344354
- Dependency trees
- application-specific interfaces, 92
- creating, 92
- defined, 91
- standard interfaces, 92
- Developer Studio
- AppWizard, 9
- ClassWizard, 89
- creating an MFC application with AppWizard, 1012
- defined, 4
- illustrated, 4
- modifying an MFC application with ClassWizard, 1214
- writing custom AppWizards, 15
- Devices
- color models
- Ramp, 59
- RGB, 59
- creating with the Direct3DRMDevice interface, 58 60
- functions, 5860
- creating with the Direct3DWinDevice interface, 6061
- modifying rendering options, 59
- controlling the colors used to render scenes, 59
- enabling and disabling dithering, 5960
- specifying the rendering mode, 59
- Direct3D
- 3D graphics, 2150
- ambient light, 43
- AppWizard, 89
- creating a sample application, 90
- COM interface dependencies, 9092
- illustrated, 91
- creating devices, 5859
- defined, 53
- Direct3DRM interface, 56
- controlling program pace, 58
- creating, 56
- creating Direct3D objects, 5657
- device creation member functions, 5859
- modifying Direct3Ds search path, 5758
- object creation member functions, 5657
- rendering member functions, 59
- search path member functions, 57
- Direct3DRMAnimation interface, 7779
- animation member functions, 78
- constructing animation sequences, 78
- controlling animation sets, 80
- key creation member functions, 78
- setting animation options, 79
- time set member functions, 78
- Direct3DRMAnimationSet interface
- creation member function, 80
- set loading member functions, 80
- time set member function, 80
- Direct3DRMDevice interface, 5860
- controlling the colors used to render scenes, 59
- creating a device, 5859
- enabling and disabling dithering, 59
- specifying the rendering mode, 59
- Direct3DRMFace interface, 6971
- color member functions, 70
- face access member function, 69
- face texture member functions, 70
- material member functions, 70
- setting face attributes, 6971
- vertex access member functions, 70
- Direct3DRMFrame interface, 62 64
- creating a frame, 6263
- frame hierarchies member functions, 62
- frame movement member functions, 64
- frame positioning member functions, 6364
- move callback member functions, 64
- moving a frame, 64
- positioning a frame, 6364
- using move callbacks, 64
- Direct3DRMLight interface, 7576
- adding light to scenes, 7576
- attaching light member function, 75
- creation member functions, 75
- setting location and orientation of lights, 7576
- Direct3DRMMaterial interface, 74
- creation member function, 74
- determining the behavior of light on faces and meshes, 74
- emissive light color member functions, 74
- specular light color member functions, 74
- specular light power member functions, 74
- Direct3DRMMesh interface, 6869
- creation member function, 68
- manipulating mesh groups, 6869
- manipulating vertex positions, 69
- mesh group member functions, 68
- scale and translate member functions, 69
- vertex access member functions, 69
- Direct3DRMMeshBuilder interface, 6467
- creation member function, 65
- face access member functions, 67
- loading and saving member functions, 65
- manipulating meshes, 6467
- rendering member functions, 6566
- translate and scale member functions, 67
- vertex access member functions, 67
- Direct3DRMShadow interface, 77
- adding shadows to scenes, 77
- creation member function, 77
- Direct3DRMTexture interface, 7173
- applying textures to faces and meshes, 7173
- controlling wrap style, 73
- creating textures, 71
- decal manipulation member functions, 73
- texture color member functions, 72
- texture creation member functions, 71
- Direct3DRMTextureWrap interface, 73
- creation member function, 73
- Direct3DRMViewport interface, 6162
- clipping member functions, 62
- controlling clipping, 62
- CreateDevice member function, 61
- creating a viewport, 61
- SetField member function, 61
- the field-of-view, 61
- Direct3DWinDevice interface, 6061
- functions supported, 61
- member functions, 6061
- directional light, 43
- faces, 29
- defined, 2930
- illustrated, 30
- initializing, 95108
- functions involved, 96108
- introduction to, 5185
- key-framing
- linear-based, 50
- spline, 50
- parallel light, 43
- point light, 43
- Retained Mode, 56
- spotlight, 43
- working with theDirect3D custom AppWizard, 1519
- completed project illustrated, 19
- Z-buffering, 45
- pros and cons, 45
- DirectDraw, 400402
- cooperative levels, 400401
- defined, 400
- display modes, 401
- interface, 400
- page flipping, 401
- palettes, 402
- surfaces, 401
- using existing DirectDraw surfaces as textures, 71
- Z-buffering, 402
- Directional light, 209217
- adding to a scene, 76
- defined, 43
- SpaceStation demo, 210217
- DOOM, 37
- DOS programming
- compared to Windows programming, 5
E
- Event handler
- adding to a project with ClassWizard, 1214
- defined, 67
- modifying with ClassWizard, 89
- sample code, 6
- switch statement, 67
- Event-driven programming
- defined, 5
- event, 5
- event handler, 67
- message, 5
F
- FacePick demo, 36580
- CreateScene function, 368371
- creating a frame for the mesh, 370
- creating a mesh, 369370
- creating the light sources, 370371
- illustrated, 366
- overview, 365366
- techniques demonstrated, 365366
- FacePickWin class, 366368
- class definition, 366367
- color functions, 376377
- CreateScene function, 368371
- creating a frame for the mesh, 370
- creating a mesh, 369370
- creating the light sources, 370371
- source code, 368369
- file functions, 377,380
- mouse functions, 371373
- PickFace function, 373374
- UpdateDrag callback function, 375376
- Faces
- adjusting emissive light, 74
- adjusting specular light color, 74
- adjusting specular light power, 74
- applying color to, 376377
- applying materials, 70
- applying texture, 70
- functions for, 70
- calculating color with normals, 3032
- defined, 2930
- illustrated, 30
- inspecting and changing color, 70
- manipulating vertices, 70
- functions for, 70
- modifying with meshbuilders, 6667
- picking, 365380
- FacePick demo, 365380
- texture mapping, 3738
- Field-of-view, 343354
- using the AdjustField callback function to control a viewports field-of-view, 352353
- Zoom demo, 344354
- Field-of-view (FOV), 61
- Firefly demo, 202209
- CreateScene function
- creating the point light, 207
- creating and loading the chalice mesh, 206207
- creating the frame, 207
- creating the frames to animate the spherical mesh and the light source, 208209
- creating the mesh to represent the firefly, 208
- FireflyWin class, 203204
- class definition, 204
- CreateScene function, 204209
- creating and loading the chalice mesh, 206207
- creating the frame, 207
- creating the frames to animate the spherical mesh and the light source, 208209
- creating the mesh to represent the firefly, 208
- creating the point light, 207
- Flat rendering
- illustrated, 47
- Flat shading
- defined, 4647
- Frame
- creating, 6263
- defined, 62
- dummy frame, 157
- hierarchies, 6263, 254265
- frame-of-reference characteristic, 6263
- illustrated, 254255
- Molecule demo, 255265
- positioning, 63
- functions for, 63
- Frame hierarchies, 254265
- creating, 261265
- defined, 62
- illustrated, 254255
- Molecule demo, 255265
- Full-screen applications, 397
- defined, 399400
- FullScreen demo, 429
- FullScreen demo, 429
- illustrated, 429
- overview, 429430
- techniques demonstrated, 430
- FullScreenWin class, 430433
- CreateFPSSurface function, 440441
- CreateMenuSurface function, 437
- CreateScene function, 434437
- initializing the display mode and FPS read-out surfaces, 436437
- class definition, 430431
- FullScreenWin function, 433434
- KeyDown function, 445447
- Render function, 442445
- UpdateFPSSurface function, 441442
- UpdateMenuSurface function, 438440
- Functions
- callbacks
- adjusting an objects rotation, 248
- animating a scene, 234235
- animating a texture, 176178
- calculating rotation attributes during a drap operation, 375376
- controlling a viewports field-of-view, 352353
- defined, 64, 121
- installing a texture, 185186
- orienting one frame according to the movement of another frame, 288289
- performing color animation, 316317
- performing vertex animation and mesh rotation, 303306, 314316
- relocating meshes during a drag operation, 364365
- updating a morph sequence, 336337
- updating a scene, 121123, 169170, 276
- updating an animation sequence, 288
- color conversion functions, 125126
- event handler, 67
G
- Gouraud shading
- defined, 4748
- illustrated, 48
- Graphics (3D), 2150
- animating, 49
- assigning motion attributes, 49
- key-framing, 4950
- calculating color with normals, 3032
- coordinate systems, 2324
- axes, 23
- origin, 25
- planes, 2728
- vectors, 2526
- defined, 23
- faces, 29
- illustrated, 30
- hidden surface removal techniques, 45
- Z-buffering, 45
- lighting, 42
- ambient light, 42
- defining light source color, 42
- directional light, 43
- light sources, 42
- parallel light, 43
- point light, 43
- spot light, 43
- meshes, 30
- illustrated, 30
- moving an object, 3334
- perspective transformation, 43, 44
- producing a 2D version of a 3D scene, 44
- rendering (shading) methods, 46
- flat, 4647
- Gouraud, 4748
- Phong, 48
- ray-tracing, 48
- unlit, 46
- wireframe, 46
- texture, 38
- defined, 38
- texture animation, 4142
- texture mapping, 3738
- defined, 3738
- texture scaling, 39
- texture wrapping, 4041
- translations, 32
- rotate, 3237
- scale, 3236
- translate, 32
- translate (move), 3334
- vertices, 2829
- working with a viewing frustum, 44
H
- Helper functions, 124125
- GetMouse, 125
- ScaleMesh, 124125
- HRESULT data type, 84
- Hungarian notation
- in windows programming, 19
I
- Initializing Direct3D, 95108
- functions involved, 96108
- Interfaces
- application-specific, 92
- COM interface dependencies, 9092
- illustrated, 91
- Direct3DRM, 5658
- controlling program pace, 58
- creating, 56
- creating Direct3D objects, 5657
- device creation member functions, 5859
- modifying Direct3Ds search path, 57
- object creation member functions, 5657
- rendering member functions, 59
- search path member functions, 57
- Direct3DRMAnimation, 7779
- animation member functions, 78
- constructing animation sequences, 78
- controlling animation sets, 80
- key creation member functions, 78
- setting animation options, 79
- time set member functions, 78
- Direct3DRMAnimationSet, 7980
- creating, 80
- creation member function, 80
- set loading member functions, 80
- time set member function, 80
- Direct3DRMDevice, 5860
- Direct3DRMFace, 6971
- color member functions, 70
- face access member function, 69
- face texture member functions, 70
- material member functions, 70
- setting face attributes, 6971
- vertex access member functions, 70
- Direct3DRMFrame, 6264
- creating a frame, 62, 63
- frame hierarchies member functions, 62
- frame movement member functions, 64
- frame positioning member functions, 6364
- move callback member functions, 64
- moving a frame, 64
- positioning a frame, 6364
- using move callbacks, 64
- Direct3DRMLight, 7576
- adding light to scenes, 75,76
- attaching light member function, 75
- creation member functions, 75
- setting location and orientation of lights, 7576
- Direct3DRMMaterial, 74
- creation member function, 74
- determining the behavior of light on faces and meshes, 74
- emissive light color member functions, 74
- specular light color member functions, 74
- specular light power member functions, 74
- Direct3DRMMesh, 6869
- creation member function, 68
- manipulating mesh groups, 6869
- manipulating vertex positions, 69
- mesh group member functions, 68
- scale and translate member functions, 69
- vertex access member functions, 69
- Direct3DRMMeshBuilder, 6467
- creation member function, 65
- face access member functions, 67
- loading and saving member functions, 65
- rendering member functions, 6566
- translate and scale member functions, 67
- vertex access member functions, 67
- Direct3DRMShadow, 77
- adding shadows to scenes, 77
- creating, 77
- creation member function, 77
- Direct3DRMTexture, 7173
- applying textures to faces and meshes, 7173
- creating textures, 71
- decal manipulation member functions, 73
- texture color member functions, 72
- texture creation member functions, 71
- Direct3DRMTextureWrap, 73
- controlling wrap style, 73
- creation member function, 73
- Direct3DRMViewport, 6162
- clipping member functions, 62
- controlling clipping, 62
- CreateDevice member function, 61
- creating a viewport, 61
- field-of-view, 61
- field-of-view member function, 61
- Direct3DWinDevice, 6061
- functions supported, 61
- member functions, 6061
- DirectDraw, 400
- standard, 92
- Iunknown object
- member functions, 55
J
- Jade demo, 131145
- CreateScene function, 136143
- changing the scenes background, 136137
- creating a frame for the mesh, 142
- creating a viewport, 143
- creating an ambient light source, 142143
- creating and applying the texture wrap, 140142
- loading the D3D mesh, 137
- loading the texture, 138
- illustrated, 132
- MoveFrame function, 143144
- overview, 131132
- render functions, 144145
- techniques demonstrated, 133
- texture settings settings, 141
- wrap settings, 141
- JadeWin class, 133134
- class definition, 133
- CreateScene function, 134143
- changing the scenes background, 136137
- creating a frame for the mesh, 142
- creating a viewport, 143
- creating an ambient light source, 142143
- creating and applying the texture wrap, 140141, 142
- loading the D3D mesh, 137
- loading the texture, 138
- MoveFrame function, 143144
- render functions, 144145
K
- Key-framing
- defined, 49, 50
- linear-based, 50
- Rocket demo, 26778
- spline-based, 50
- steps involved, 50
L
- Lighting
- adding ambient light to a scene, 75
- adding directional light to a scene, 76
- adding light to scenes, 7576
- adding parallel light to a scene, 76
- adding point lights to a scene, 76
- adding spotlights to a scene, 76
- adjusting emissive light on faces and meshes, 74
- adjusting specular light color on faces and meshes, 74
- adjusting specular light power on faces and meshes, 74
- ambient light, 42, 190202
- demo, 191202
- creating a spotlight, 112114
- defining light source color, 42
- directional light, 43, 209217
- SpaceStation demo, 210217
- how rendering methods and color models affect light sources, 190
- light sources, 187250
- ambient, 42
- directional, 43
- parallel, 43
- point, 43
- spot, 43
- parallel light, 43, 217225
- SpaceDonut demo, 217225
- point light, 43, 202209
- Firefly demo, 202209
- setting location and orientation, 7576
- shadows, 238249
- Shadow demo, 238249
- spot light, 43
- spotlight, 226238
- adjusting with a callback function, 122123
- penumbra angle, 226227
- Spotlight demo, 227238
- umbra angle, 226227
- using multiple light sources, 238
- Listings
- AmbientLight::WinCreateScene function, 196
- SampleWin::CreateDevice function, 99101
- Cube2Win::CreateScene function, 310311
- CubeWin::CreateScene function, 296, 297
- DecalWin::CreateScene function, 158, 159, 160
- FacePickWin::CreateScene function, 368, 369
- FireflyWin::CreateScene function, 204, 205, 206
- FullScreenWin class definition, 430, 431
- FullScreen::CreateScene function, 434436
- FullScreenWin function, 433434
- FullScreenWin::CreateFPSSurface function, 440
- FullScreenWin::KeyDown function, 446447
- FullScreenWin::Render function, 442443
- FullScreenWin::UpdateFPSSurface function, 441442
- FullScreenWin::UpdateMenuSurface function, 438439
- GetGUID function, 104105
- JadeWin::CreateScene function, 134136
- MeshPick::CreateScene function, 357359
- MoleculeWin::CreateScene function, 258260
- MorphWin::LoadMeshes function, 325327
- MoveTexture function, 177178
- MultiView::CreateDevice function, 387389
- MultiViewWin::CreateScene function, 382383
- OrbStarWin::CreateScene function, 164166
- RMWin class (modified for full-screen apps), 404405
- RMWinActivateDisplayMode function (private version), 424425
- RMWin::CompareModes function, 411
- RMWin::InitDisplayMode function, 409
- RMWin::InitMainSurfaces function, 412413
- RMWin::InstallPalette function, 416418
- RMWin::OnCreate function, 407408
- RocketWin::CreateScene function, 269271
- SampleWin::CreateScene function, 109110
- ShadowWin::CreateScene function, 240243
- ShowRoomWin::CreateScene function, 180183
- SpaceDonutWin::CreateScene function, 219221
- SpaceStationWin::CreateScene function, 212213
- SpotlightWin::CreateScene function, 229231
- TargetWin::CreateScene function, 281283
- TextureDriftWin::CreateScene function, 173174
- WrapsWin::LoadMeshes function, 150152
- ZoomWin::CreateScene function, 347349
M
- Macros
- ASSERT, 98
- TRACE, 9799
- main()
- defined, 5
- Materials
- applying to faces, 70
- assigning to faces and meshes, 74
- testing settings with Xpose, 350
- Mesh
- applying a texture to
- applying color to, 376377
- applying texture wraps, 73
- applying vertex animation techniques, 294307
- assiging colors to the faces of, 66
- calculating color with normals, 3032
- CreateMeshBuilder function, 57
- creating, 111112
- creating with meshbuilders, 69
- defined, 30
- groups, 6869
- functions, 68
- working with multiple mesh groups, 308318
- illustrated, 30
- loading from the File menu, 377380
- manipulating with meshbuilders, 64 67
- modifying rendering options with meshbuilders, 6566
- functions for, 6566
- setting the rendering mode of, 66
- Mesh groups, 6869, 308318
- defined, 68
- functions, 68
- working with multiple mesh groups (Cube2 demo), 308318
- Meshbuilders
- accessing vertices used by a mesh, 67
- applying scale factors to a mesh, 67
- assigning textures to, 66
- creating, 65
- creating creating meshes, 69
- defined, 64
- loading, 65
- modifying mesh rendering options, 6566
- performance issues, 67
- saving, 65
- specifying offsets for a meshs location, 67
- MeshPick demo, 355365
- illustrated, 355
- overview, 355
- techniques demonstrated, 355
- MeshPickWin class, 356, 357
- class definition, 356
- CreateScene function, 357361
- creating multiple meshes with frames, 359360
- creating the light source, 360361
- installing a callback function, 360
- loading the mesh, 359
- mouse functions, 361364
- UpdateDrag callback function, 364365
- Message map
- defined, 78
- sample code, 78
- Message pump
- defined, 56
- sample code, 5
- Messages
- defined, 5
- DispatchMessage function, 6
- GetMessage function, 6
- intercepting with event handlers, 67
- message map, 78
- message pump, 5
- TranslateMessage function, 6
- MFC
- creating an application with AppWizard, 1012
- defined, 5
- message map, 78
- modifying an application with ClassWizard, 1214
- Microsoft
- component object model (COM)
- defined, 5455
- Web address, 55
- Molecule demo, 255265
- CreateScene function
- creating the frame hierarchy, 261
- creating the meshes, 260261
- creating the viewport, 261
- initializing a random number generator, 260
- illustrated, 256
- overview, 255
- techniques demonstrated, 256
- MoleculeWin class, 256265
- children functions, 265
- class definition, 256257
- CreateChildren function, 262264
- CreateHierarchy function, 262
- CreateScene function, 258261
- creating the frame hierarchy, 261
- creating the meshes, 260261
- creating the viewport, 261
- initializing a random number generator, 260
- source code, 258259
- depth functions, 264265
- Morphing, 318340
- defined, 318
- MorphPlay demo, 319340
- class design, 320
- illustrated, 321
- overview, 319320
- techniques demonstrated, 320
- MorphPlayWin class, 331333
- CreateScene function, 333334
- source code, 333334
- class definition, 331333
- InitMorphSequence function, 335336
- source code, 335336
- mouse functions, 337340
- OnFileOpen function, 334335
- source code, 335
- UpdateMorph callback function, 336337
- source code, 336337
- MorphWin class, 322324
- AddMorphKey function, 330
- CreateAnimations function, 328329
- source code, 328
- class definition, 322323
- functions, 322
- GetMorphMesh function, 331
- source code, 331
- GetNumMorphTargets function, 329
- LoadMeshes function, 325327
- source code, 325327
- LoadMorphSequence function, 324325
- PrepareMorphVertices function, 329
- source code, 329
- SetMorphTime function, 330331
- source code, 330331
- Motion attributes
- defined, 49
- MultiView demo, 380395
- ConfigViewport function
- source code, 390
- CreateDevice function
- source code, 387389
- CreateScene function
- source code, 382383
- CreateViewport function
- source code, 391
- illustrated, 380
- MultiViewWin class, 381382
- CreateScene function, 382
- class definition, 381
- overview, 380381
- RMWin class (modified version), 384386
- ConfigViewport function, 390391
- CreateDevice function, 386389
- CreateViewport function, 391
- class definition, 384385
- OnSize function, 393394
- Render function, 391393
- viewport functions, 394395
- techniques demonstrated, 381
- MultiViewWin class, 381382
- class definition, 381
- CreateScene function, 382
- source code, 382383
N
- Normal
- defined, 30
- face, 30
- face vs. vertex, 32
- vertex, 31
O
- Objects
- creating Direct3D objects, 56
- rules for using COM objects, 55
- OrbStar demo, 162170
- CreateScene function
- creating and loading the sphere, 167168
- creating the frame, 169
- creating the sphere texture, 168
- creating the star frame, 167
- creating the star mesh, 166167
- creating the texture wrap, 168169
- illustrated, 162
- overview, 162
- techniques demonstrated, 162
- OrbStarWin class, 163
- callback functions, 169170
- CreateScene function, 163169
- creating and loading the sphere, 167168
- creating the frame, 169
- creating the sphere texture, 168
- creating the star frame, 167
- creating the star mesh, 166167
- creating the texture wrap, 168169
- source code, 164166
- class definition, 163
- Origin
- defined, 25
P
- Palettes
- DirectDraw, 402
- Parallel light, 217225
- adding to a scene, 76
- defined, 43
- SpaceDonut demo, 217225
- Perspective transformation
- defined, 43
- working with a viewing frustum, 44
- Phong shading
- defined, 48
- Picking, 354365
- defined, 354
- MeshPick demo, 355365
- Plane
- defined, 2728
- Point light, 2029
- adding to a scene, 76
- defined, 43
- Firefly demo, 202209
- Pointers
- avoiding dangling pointers, 139
- Target demo pointer release dilemma, 286
- Program execution phases, 9495
- creating a scene, 108115
- functions involved, 108115
- initializing Direct3D, 95108
- maintaining a scene, 11523
- functions involved, 11523
- shutting down, 123124
- using the OnDestroy function, 123124
- Programming
- Windows vs. DOS, 5
- main() function, 5
- WinMain() function, 5
R
- Ray-tracing
- defined, 48
- illustrated, 4849
- Rendering methods, 46
- flat, 4647
- Gouraud, 4748
- how they affect light sources, 190
- Phong, 48
- ray-tracing, 48
- unlit, 46
- wireframe, 46
- Retained Mode
- defined, 56
- RMWin class
- background, 9394
- constructing scenes, 108115
- helper functions 124125
- maintaining scenes, 115123
- object creation functions, 98108
- shutting down, 123124
- RMWin class (modified for full-screen apps)
- adding display mode support, 406
- class definition, 404, 405
- member functions, 407429
- palette support, 407
- removing obsolete functions, 405406
- surface support, 407
- RMWin class (modified for multiple views), 384386
- class definition, 384385
- ConfigViewport function, 390391
- CreateDevice function, 386389
- CreateViewport function, 391
- OnSize function, 393394
- Render function, 391393
- viewport functions, 394395
- Rocket demo, 267278
- illustrated, 267
- overview, 267
- techniques demonstrated, 268
- updating the scene, 276
- RocketWin class, 268278
- animation functions, 276278
- CreateScene function, 269270
- creating a frame for the rocket mesh, 275
- creating the animation sequence, 272275
- creating the rocket mesh, 27272
- source code, 269270
- class definition, 268
- speed functions, 278
- UpdateScene callback function, 276
- Rotating
- objects, 3637
S
- Scaling
- objects, 3436
- textures, 39
- Scenes
- constructing, 108115
- creating a mesh, 111112
- creating a spotlight, 112114
- creating a viewport, 114, 115
- functions involved, 108115
- maintaining, 11523
- functions involved, 11523
- shutting down, 123124
- using the OnDestroy function, 123124
- SetVertices function, 83
- Shading methods, 46
- flat, 4647
- Gouraud, 4748
- Phong, 48
- ray-tracing, 48
- unlit, 46
- wireframe, 46
- Shadow demo, 238249
- CreateScene function
- creating a frame for the floor mesh, 245
- creating a frame for the fork mesh, 245246
- creating a point light source, 246247
- creating an ambient light source, 246
- creating and applying the floor mesh texture wrap, 244245
- creating the floor mesh texture, 244
- creating the fork mesh, 245
- creating the mesh to represent the floor, 243244
- creating the shadow object, 247
- creating the viewport, 247248
- illustrated, 239
- overview, 238239
- ShadowWin class, 239240
- AdjustSpin callback function, 248
- class definition, 239240
- CreateScene function, 240248
- render functions, 248249
- techniques demonstrated, 239
- Shadows, 238249
- adding to scenes, 77
- limitations, 77
- creating, 77
- Shadow demo, 238249
- ShadowWin class, 239240
- AdjustSpin callback function, 248
- class definition, 239240
- CreateScene function, 240248
- creating a frame for the floor mesh, 245
- creating a frame for the fork mesh, 245246
- creating a point light source, 246247
- creating an ambient light source, 246
- creating and applying the floor mesh texture wrap, 244245
- creating the floor mesh texture, 244
- creating the fork mesh, 245
- creating the mesh to represent the floor, 243244
- creating the shadow object, 247
- creating the viewport, 247248
- source code, 240243
- render functions, 248249
- ShowRoom demo, 178186
- CreateScene function
- creating and applying the texture wrap, 184185
- creating and loading the cube mesh, 184
- creating the frame, 185
- creating the interface, 185
- creating the textures, 184
- illustrated, 179
- overview, 178179
- techniques demonstrated, 179
- using callbacks to install a new texture, 185186
- ShowRoomWin class, 179180
- class definition, 180
- CreateScene function, 180185
- creating and applying the texture wrap, 184185
- creating and loading the cube mesh, 184
- creating the frame, 185
- creating the interface, 185
- creating the textures, 184
- using callbacks to install a new texture, 185186
- SpaceDonut demo, 217225
- CreateScene function
- applying the texture to the mesh, 223
- creating and attaching the frame, 223, 224
- creating and loading the frosting texture, 222
- creating the donut mesh, 221222
- creating the light source and its frame, 224225
- creating the viewport, 225
- illustrated, 218
- overview, 217
- techniques demonstrated, 217
- SpaceDonutWin class, 217219
- class definition, 218
- CreateScene function, 219225
- applying the texture to the mesh, 223
- creating and attaching the frame, 223224
- creating and loading the frosting texture, 222
- creating the donut mesh, 221222
- creating the light source and its frame, 224225
- creating the viewport, 225
- source code, 219221
- SpaceStation demo, 210217
- CreateScene function
- creating a frame for the light source, 215
- creating a frame for the space station mesh, 214
- creating a viewport, 215217
- creating the light source, 214
- creating the space station mesh, 213
- illustrated, 210
- overview, 210
- techniques demonstrated, 210
- SpaceStationWin class, 211
- class definition, 211
- CreateScene function, 211217
- creating a frame for the light source, 215
- creating a frame for the space station mesh, 214
- creating a viewport, 215217
- creating the light source, 214
- creating the space station mesh, 213
- source code, 212213
- Spotlight, 226238
- adding to a scene, 76
- adjusting with a callback function, 122123
- creating, 112114
- defined, 43
- penumbra angle, 43, 226227
- illustrated, 226
- setting, 76
- Spotlight demo, 227238
- umbra angle, 43, 226227
- illustrated, 226
- setting, 76
- Spotlight demo, 227238
- CreateScene function
- creating a frame for the light source, 233234
- creating a viewport, 234
- creating and positioning a frame for the meshes, 232233
- creating the light source, 233
- intializing the pointers, 232
- loading the spherical mesh, 231232
- overview, 227228
- techniques demonstrated, 227
- SpotlightWin class, 228229
- beam functions, 237238
- class definition, 228229
- CreateScene function, 229234
- creating a frame for the light source, 233234
- creating a viewport, 234
- creating and positioning a frame for the meshes, 232233
- creating the light source, 233
- intializing the pointers, 232
- loading the spherical mesh, 231232
- source code, 229231
- MoveLight callback function, 234235
- render functions, 235237
T
- Target demo, 279289
- CreateScene function
- creating multiple frames for the missile mesh, 287288
- creating the animation sequence, 284285
- creating the frame for the target mesh, 286
- creating the missile mesh, 287
- loading the target mesh, 284
- illustrated, 279
- overview, 279280
- pointer release dilemma, 286
- techniques demonstrated, 280
- TargetWin class, 280281
- callback functions, 288
- CreateScene function, 281288
- creating multiple frames for the missile mesh, 287, 288
- creating the animation sequence, 284, 285
- creating the frame for the target mesh, 286
- creating the missile mesh, 287
- loading the target mesh, 284
- source code, 281283
- class definition, 280
- MoveTarget callback function, 288
- OrientFrame back function, 288
- OrientFrame callback function, 289
- Texture
- applying to faces, 70
- controlling the number of colors used in, 72
- creating, 71
- defined, 38
- texture wraps, 73
- using decals, 7273
- using existing DirectDraw surfaces as textures, 71
- Texture animation, 4142, 171186
- defined, 41
- ShowRoom demo, 178186
- single texture vs. multiple texture, 171
- TextureDrift demo, 171178
- Texture mapping, 127186
- adding a decal to a scene, 15661
- Decal demo, 15661
- applying a flat texture to a mesh
- Jade demo, 131145
- applying a non-flat texture to a mesh
- Wraps demo, 146156
- creating a transparent texture, 161
- defined, 3738
- OrbStar demo, 162170
- storage tip, 272
- Texture scaling, 39
- defined, 39
- Texture wrapping, 4041
- cylindrical, 40
- defined, 40
- experimenting with Xpose, 129131
- flat, 40
- spherical, 41
- TextureDrift demo, 171178
- CreateScene function
- creating the frame, 176
- creating the interface, 176
- creating the mesh, 175
- creating the texture, 175176
- illustrated, 172
- overview, 171172
- techniques demonstrated, 171
- TextureDriftWin class, 172173
- CreateScene function, 173176
- creating the frame, 176
- creating the interface, 176
- creating the mesh, 175
- creating the texture, 175176
- source code, 173174
- class definition, 173
- using callbacks to animate the texture, 176178
- TRACE macro
- defined, 97
- Translations
- defined, 32
- rotate, 3237
- scale, 3236
- defined, 34
- translate, 32
- translate (move), 3334
- defined, 33
U
- Unlit rendering
- defined, 46
- illustrated, 4647
- Utilities
- CONV3DS, 8485
V
- Values
- specifying absolute values, 140
- Vector
- defined, 2526
- vs. point, 2527
- Vertex
- defined, 2829
- manipulating the vertices of a face, 70
- functions for, 70
- manipulating vertices used by a mesh, 6769
- Vertex animation, 294307
- Cube demo, 294307
- Viewing frustum
- defined, 44
- enlarging the angle, 61
- field-of-view (FOV) setting, 44
- reducing the angle, 61
- Viewport, 341395
- controlling clipping, 62
- creating, 61, 114115
- defined, 61
- field-of-view, 61, 34354
- Zoom demo, 344354
- MultiView demo, 38095
- picking, 354365
- MeshPick demo, 355365
- picking faces, 36580
- FacePick, 365380
- using multiple viewports, 38095
- Visual C++
- compile warning signs, 193
- defined, 4
- Developer Studio
- AppWizard, 9
- ClassWizard, 89
- creating an MFC application with AppWizard, 1012
- defined, 4
- illustrated, 4
- modifying an MFC application with ClassWizard, 1214
- writing custom AppWizards, 15
- introduction to, 120
- MFC
- creating an application with AppWizard, 1012
- defined, 5
- message map, 7, 8
- modifying an application with ClassWizard, 1214
- Windows SDK
- defined, 4
W
- Windowed applications
- defined, 399
- Windows programming
- compared to DOS programming, 5
- event handler
- defined, 67
- Hungarian notation, 19
- message pump, 5
- using C++ strong type checking, 1920
- Windows SDK
- defined, 4
- message functions, 6
- WinMain()
- defined, 5
- message pump, 5
- Wireframe rendering
- defined, 46
- illustrated, 46
- Wraps demo, 146156
- CreateScene function
- creating and configuring meshes, textures, and texture wraps, 150156
- illustrated, 146147
- overview, 146147
- techniques demonstrated, 147
- WrapsWin class, 147148
- class definition, 147148
- CreateScene function, 148149
- creating and configuring meshes, textures, and texture wraps, 150156
- source code, 149
X
- X files
- creating, 84
- defined, 84
- Xpose
- experimenting with, 129131
- testing materials settings, 350
Z
- Z-buffering
- defined, 45
- in DirectDraw, 402
- pros and cons, 45
- Zoom demo, 344354
- CreateScene function
- applying a material to the mesh, 349350
- creating a frame for the mesh, 350
- creating a viewport, 352
- creating an animation sequence, 351, 352
- creating and loading the mesh, 349
- illustrated, 344
- overview, 344345
- tecniques demonstrated, 345
- ZoomWin class, 345346
- AdjustField callback function, 352353
- animation functions, 353354
- class definition, 345346
- CreateScene function, 347352
- applying a material to the mesh, 349350
- creating a frame for the mesh, 350
- creating a viewport, 352
- creating an animation sequence, 351352
- creating and loading the mesh, 349
- source code, 347349
|