Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Introduction to 3D Game Programming with DirectX.9.0 - F. D. Luna

.pdf
Скачиваний:
240
Добавлен:
24.05.2014
Размер:
6.94 Mб
Скачать

384 Index

IDirect3DDevice9::LightEnable, 107

 

inverse, see matrix

IDirect3DDevice9::Present, 55-56

 

 

IUnknown::Release, 37

IDirect3DDevice9::SetFVF, 81

 

 

 

 

IDirect3DDevice9::SetIndices, 81

 

 

L

 

IDirect3DDevice9::SetLight, 106

 

 

left-handed coordinate system, 3

IDirect3DDevice9::SetMaterial, 101

 

length function, 290

IDirect3DDevice9::SetPixelShader, 324

 

lerp function, 290

IDirect3DDevice9::SetRenderState, 80

 

level of detail, 185

IDirect3DDevice9::SetSamplerState, 114

 

Y

light and object interaction, 100

IDirect3DDevice9::SetStreamSource, 81

light components, 98

IDirect3DDevice9::SetTexture, 113

 

L

 

light maps, 319

IDirect3DDevice9::SetTextureStage-

F

 

light sources, 104

State, 125-126

 

 

 

lighting, 69

 

 

M

 

IDirect3DDevice9::SetTransform, 64-66

 

ambient, 98

IDirect3DDevice9::SetVertex-

 

 

diffuse, 98, 224-228

Declaration, 297-298

A

specular, 99

 

 

 

IDirect3DDevice9::SetVertexShader, 301

LightWave 3D, 179

E

 

linear filtering, 114

IDirect3DDevice9::SetViewport, 72

 

T

 

 

linear interpolation, 231

IDirect3DIndexBuffer9, 75

 

 

 

IDirect3DIndexBuffer9::GetDesc, 80

 

local space, 65

IDirect3DIndexBuffer9::Lock, 78

 

 

lock flags, 79

IDirect3DPixelShader9, 323

 

 

 

log function, 290

IDirect3DSurface9, 38

 

 

 

log10 function, 290

IDirect3DSurface9::LockRect, 38

 

 

log2 function, 290

IDirect3DSwapChain9, 42

 

 

 

LOGFONT, 154

IDirect3DTexture9, 111

 

 

 

LPARAM, 372-373

IDirect3DVertexBuffer9, 75

 

 

 

luminance texture, 314

IDirect3DVertexBuffer9::GetDesc, 80

 

 

 

IDirect3DVertexBuffer9::Lock, 78

 

 

M

 

IDirect3DVertexShader9, 300

 

 

 

magnification, 114

if…else statement, 286

 

 

 

materials, 99-101

in keyword, 289

 

 

 

emissive, 100

identity, see matrix

 

 

 

power, 100

index buffer, 75

 

 

 

matrix, 11-12

creating, 76-77

 

 

 

addition, 12-13

dynamic, 77

 

 

 

D3DMATRIX class, see D3DMATRIX

locking, 78-79

 

 

 

D3DXMATRIX class, see

static, 77

 

 

 

 

D3DXMATRIX

indices, triangle, 62-63

 

 

 

equality, 12

INFINITY, 194

 

 

 

functions, see D3DXMatrix*

inout keyword, 290

 

 

 

identity, 14-15

int variable type, 280

 

 

 

inverse, 15

intersections

 

 

 

matrix-matrix multiplication, 16

ray and plane, 31

 

 

 

multiplication, 13-14

ray and sphere, 262-264

 

 

 

multiplication operator, 18

Team-Fly®

Index 385

scalar multiplication, 12 transformation, 18-20 transpose, 15-16 variable type, 282

vector-matrix multiplication, 16 max function, 291 MaxPrimitiveCount, 218 MaxVertexIndex, 218

Maya, 179

memory pools, D3DPOOL, see D3DPOOL

meshes, see ID3DXMesh message loop, 361, 372-373

for games, 375-376 message queue, 360-361 MessageBox function, 375 min function, 291 minification, 114

mipmap filters, 116 mipmaps, see textures mirror, see address modes model, 60

model space, see local space MSG structure, 372

mul function, 291

multiple texture coordinates, 321-322 multisampling, 39-40

multitexturing, 319-321

N

nearest point sampling, 114 normal averaging, 103 normalize function, 291 normalizing

plane, see planes vector, see vectors

O

object, see model

object space, see local space orthogonal, 9

orthogonal matrix, 22 orthonormal, 199 out keyword, 289

P

page flipping, 42

parameters, setting, see effect file particle attributes, 238-239 particle systems, 259

class, 240-248 firework, 252-254 particle gun, 254-255 rendering, 244-248 snow, 250-251

PeekMessage function, 376 perspective projection, 70 picking, 257-258

pick ray, 260-261 pitch, 200, 205-206

pixel formats, see D3DFORMAT pixel shader, 318

creating, 324 destroying, 325 enabling, 324

inputs and outputs, 322-323 samplers, 325-326

version, 318 planes, 25

construction, 27-28 D3DXPLANE class, see

D3DXPLANE functions, see D3DXPlane*

intersection, see intersections nearest point to, 29-30 normal, 25

normalizing, 28-29

point and plane spatial relation, 27 transforming, 29

POINT, 372 point lights, 104

point sprite render states, 236-238 point sprites, 235

points, 3

position vector, camera, 199-200 pow function, 291

presenting, 42-43

primary display adapter, 46 primitives, 60

progressive meshes, see ID3DXPMesh

386 Index

projection, 70-71 plane, 64 transform, 71 window, 64

R

radians function, 291 randomness, 248-249 range, light, 105 rasterization, 73

RAW file format, 214-215 ray, 30-31

intersections, see intersections rectangular array, see matrix REF, 36-37

reference rasterizer, see REF reflect function, 291 reflection, 137-139

refract function, 291 RegisterClass function, 370 Release function, 53 render states, 80 rendering pipeline, 64-65

rendering preparations, see drawing preparations

resources, Windows, 360 right-handed coordinate system, 3 roll, 200, 205-206

rotation around an axis, 205 rotation matrices, 21-22 row vector, 12

rsqrt function, 291

S

sample framework, 54

sampler objects, see pixel shader saturate function, 291

scalar multiplication, see matrix and vectors

scaling matrix, 22-23 scene, 60

screen space, 371 shader description, 267 shadows, planar, 144-147

shared variable prefix, 284-285

ShowWindow function, 371

silhouette edge outlining vertex shader, 315-316

silhouette edges, 313-314 sin function, 291

sincos function, 291

software vertex processing, see vertex processing

specular lighting, 99

sphere and ray intersection, see intersections

spotlights, 104 sqrt function, 291 srand function, 249

standard basis vectors, 4 standard position of vectors, 3

static index buffer, see index buffer static variable prefix, 284

static vertex buffer, see vertex buffer stencil buffer, 131-132

comparison operations, 135 formats, 133

mask, 134 reference, 134 render states, 136 test formula, 133

update operations, 136 using, 132-133

write mask, 137 stream sources, 81

subtraction, see matrix and vectors surface pitch, 38

surfaces, 38 D3DLOCKED_RECT, see

D3DLOCKED_RECT swap chain, 42

T

tan function, 291 terrains, 212

class data, 216-217 generating grid, 217-221 grid properties, 216 lighting, 224-227 texturing, 221-224

Index 387

walking on, 228-231 textures,

address modes, see address modes coordinates, 112

creating, 113 enabling, 113 filters, 114-115 mapping, 111 mipmaps, 115

transformations, combining, 23-25 matrix, 18-20 projection, 71 rays, 261-262

screen to projection window, 259-260 view, 67

viewport, 73 world, 64-66

TranslateMessage function, 373 translation matrix, 20-21 transparency, 124-125 transpose, see matrix transpose function, 291 triangle mesh, 60

triangles, 60

U

uniform variable prefix, 284 UpdateWindow function, 371 uv-coordinates, 112

V vectors, 2

addition, 7-8 components, 3

coordinate system independence, 2 cross product, 10-11 D3DVECTOR class, see

D3DVECTOR D3DXVECTOR3 class, see

D3DXVECTOR3 dot product, 9-10 equality, 5-6

functions, see D3DXVec3* magnitude, 6-7

normalizing, 7

scalar multiplication, 9 subtraction, 8-9 variable type, 281

vector-matrix multiplication, 16 velocity, 2, 239

vertex, 60 vertex buffer, 75

creating, 76-77 dynamic, 77 locking, 78-79 static, 77

vertex data usages, 298-299 vertex declaration, 294-297

creating, 297 enabling, 297-298

vertex formats, see D3DFVF vertex normals, 102-103 vertex processing, 44

hardware, 44 software, 44 vertex remap, 164

vertex shader, 293-294 creating, 300-301 destroying, 301 enabling, 301 version, 294

vertex weights, 187-188 view space, 66-67

view transform, 67

view transformation, 201-205 viewport, 72

viewport matrix, 73 virtual key code, 374

Visual Studio, setting up, xx volatile variable prefix, 285

W

while loop, 286 Win32 API, 359 winding order, 69

window coordinates, see screen space window message, 360

window procedure, 361, 373-374 window styles, 370

388 Index

Windows programming, 359

X

header file, 366

XFiles, 179

model, 362

loading, 180-181

WinMain function, 367-368

materials, 181

WM_DESTROY, 374

 

WM_KEYDOWN, 374

Y

WM_LBUTTONDOWN, 374

yaw, 200, 205-206

WNDCLASS, 368-370

 

world space, 65

Z

world transform, 64-66

z-buffer, 43-44

WPARAM, 372-373

zero vector, 4

wrap, see address modes

z-fighting, 149

Looking for more?

Check out Wordware’s market-leading Game Developer’s Library featuring the following new releases.

Learn FileMaker Pro 6

1-55622-974-7 • $39.95 6 x 9 • 504 pp.

FileMaker Pro 6 Developer’s Guide to XML/XSL

1-55622-043-X • $49.95 6 x 9 • 416 pp.

Advanced FileMaker Pro 6 Web Development

1-55622-860-0 • $59.95 6 x 9 • 464 pp.

Wireless Game Development in C/C++ with BREW

1-55622-905-4 • $49.95 6 x 9 • 416 pp.

Game Design Foundations

1-55622-973-9 • $39.95 6 x 9 • 400 pp.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LightWave 3D 7 Character

 

Advanced 3D Game

Animation

 

Programming with DirectX 9.0

1-55622-901-1 • $49.95

 

1-55622-968-2 • $59.95

7½ x 9¼ • 360 pp.

 

6 x 9 • 552 pp.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Vector Game Math Processors

Game Development and

1-55622-921-6 • $59.95

Production

6 x 9 • 528 pp.

1-55622-951-8 • $49.95

 

 

6 x 9 • 432 pp.

 

 

 

 

 

 

 

 

LightWave 3D 7.5 Lighting

Java 1.4 Game Programming

1-55622-354-4 • $69.95

1-55622-963-1 • $59.95

6 x 9 • 496 pp.

6 x 9 • 672 pp.

Visit us online at www.wordware.com for more information.

Use the following coupon code for online specials: dx9-9135

This page intentionally left blank.