D3DXVec3Normalize 示例代码

2022-03-03

以下示例是关于cpp中包含D3DXVec3Normalize用法的示例代码,想了解D3DXVec3Normalize的具体用法?D3DXVec3Normalize怎么用?D3DXVec3Normalize使用的例子?那么可以参考以下10个相关示例代码来学习它的具体使用方法。

示例1:
KWCamera.cpp开发语言: C++项目名称: beadle代码行数: 209
10	m_look = target - pos;
11	D3DXVec3Normalize(&m_look, &m_look);
12
14	D3DXVec3Cross(&m_right, &up, &m_look);
15	D3DXVec3Normalize(&m_right, &m_right);
16
18	D3DXVec3Cross(&m_up, &m_look, &m_right);
19	D3DXVec3Normalize(&m_up, &m_up);
20
32	D3DXMATRIX m;
33	D3DXVec3Normalize(&m_look, &m_look);
34	D3DXVec3Cross(&m_up, &m_look, &m_right);
35	D3DXVec3Normalize(&m_up, &m_up);
36	D3DXVec3Cross(&m_right, &m_up, &m_look);
示例2:
Cube.cpp开发语言: C++项目名称: ChrisC64代码行数: 261
29	m_cubeVerts[3].position = D3DXVECTOR3(1.0f, -1.0f, -1.0f);
30	D3DXVec3Normalize(&m_cubeVerts[0].normal, &D3DXVECTOR3(0.0f, 0.0f, -1.0f));
31	D3DXVec3Normalize(&m_cubeVerts[1].normal, &D3DXVECTOR3(0.0f, 0.0f, -1.0f));
32	D3DXVec3Normalize(&m_cubeVerts[2].normal, &D3DXVECTOR3(0.0f, 0.0f, -1.0f));
33	D3DXVec3Normalize(&m_cubeVerts[3].normal, &D3DXVECTOR3(0.0f, 0.0f, -1.0f));
43	m_cubeVerts[7].position = D3DXVECTOR3(-1.0f, 1.0f, 1.0f);
44	D3DXVec3Normalize(&m_cubeVerts[4].normal, &D3DXVECTOR3(0.0f, 0.0f, 1.0f));
45	D3DXVec3Normalize(&m_cubeVerts[5].normal, &D3DXVECTOR3(0.0f, 0.0f, 1.0f));
46	D3DXVec3Normalize(&m_cubeVerts[6].normal, &D3DXVECTOR3(0.0f, 0.0f, 1.0f));
47	D3DXVec3Normalize(&m_cubeVerts[7].normal, &D3DXVECTOR3(0.0f, 0.0f, 1.0f));
57	m_cubeVerts[11].position = D3DXVECTOR3(1.0f, 1.0f, -1.0f);
58	D3DXVec3Normalize(&m_cubeVerts[8].normal, &D3DXVECTOR3(0.0f, 1.0f, 0.0f));
59	D3DXVec3Normalize(&m_cubeVerts[9].normal, &D3DXVECTOR3(0.0f, 1.0f, 0.0f));
示例3:
DirectX.cpp开发语言: C++项目名称: ChrisC64代码行数: 745
169	//m_cubeVerts[3].position = D3DXVECTOR3(1.0f, -1.0f, -1.0f);
170	//D3DXVec3Normalize(&m_cubeVerts[0].normal, &D3DXVECTOR3(0.0f, 0.0f, -1.0f));
171	//D3DXVec3Normalize(&m_cubeVerts[1].normal, &D3DXVECTOR3(0.0f, 0.0f, -1.0f));
172	//D3DXVec3Normalize(&m_cubeVerts[2].normal, &D3DXVECTOR3(0.0f, 0.0f, -1.0f));
173	//D3DXVec3Normalize(&m_cubeVerts[3].normal, &D3DXVECTOR3(0.0f, 0.0f, -1.0f));
183	//m_cubeVerts[7].position = D3DXVECTOR3(-1.0f, 1.0f, 1.0f);
184	//D3DXVec3Normalize(&m_cubeVerts[4].normal, &D3DXVECTOR3(0.0f, 0.0f, 1.0f));
185	//D3DXVec3Normalize(&m_cubeVerts[5].normal, &D3DXVECTOR3(0.0f, 0.0f, 1.0f));
186	//D3DXVec3Normalize(&m_cubeVerts[6].normal, &D3DXVECTOR3(0.0f, 0.0f, 1.0f));
187	//D3DXVec3Normalize(&m_cubeVerts[7].normal, &D3DXVECTOR3(0.0f, 0.0f, 1.0f));
197	//m_cubeVerts[11].position = D3DXVECTOR3(1.0f, 1.0f, -1.0f);
198	//D3DXVec3Normalize(&m_cubeVerts[8].normal, &D3DXVECTOR3(0.0f, 1.0f, 0.0f));
199	//D3DXVec3Normalize(&m_cubeVerts[9].normal, &D3DXVECTOR3(0.0f, 1.0f, 0.0f));
示例4:
RenderRibbonSelection.cpp开发语言: C++项目名称: ProteinInsight代码行数: 1999
128			vecUp = pAtomC1->GetAtom()->m_pos - pAtomC5->GetAtom()->m_pos;
129			D3DXVec3Normalize( &vecUp, &vecUp );
130
170			vecUp = vec4-vec2;
171			D3DXVec3Normalize( &vecUp, &vecUp );
172
187				D3DXVECTOR3 aveVec = (vec1+vec2)/2;
188				D3DXVec3Normalize(&aveVec, &aveVec);
189				m_arrayUpVec[i] = aveVec;
222			D3DXVECTOR3 dirVec = ((vec2-vec1) + (vec3-vec2))/2;
223			D3DXVec3Normalize(&dirVec, &dirVec);
224			m_arrayRibbonCurveDirVec.push_back(dirVec);
232			D3DXVec3Cross(&result, &result, &m_arrayRibbonCurveDirVec[i*m_numSegment] );
233			D3DXVec3Normalize(&result, &result);
234
示例5:
d3dutil.cpp开发语言: C++项目名称: AmirArdroudi代码行数: 617
51    light.Diffuse.b   = 1.0f;
52    D3DXVec3Normalize( (D3DXVECTOR3*)&light.Direction, &vecLightDirUnnormalized );
53    light.Position.x   = x;
381    D3DXVECTOR3 vA, vB;
382    D3DXVec3Normalize(&vA, pvFrom);
383    D3DXVec3Normalize(&vB, pvTo);
384    D3DXVECTOR3 vHalf(vA + vB);
385    D3DXVec3Normalize(&vHalf, &vHalf);
386    return D3DXQuaternionUnitAxisToUnitAxis2(pOut, &vA, &vHalf);
589    D3DXVECTOR3 vDir = m_vLookatPt - m_vEyePt;
590    D3DXVec3Normalize( &m_vView, &vDir );
591    D3DXVec3Cross( &m_vCross, &m_vView, &m_vUpVec );
示例6:
NVMeshMender.cpp开发语言: C++项目名称: plex代码行数: 1147
63		D3DXVECTOR3 tmp2 = t2->normal;
64		D3DXVec3Normalize( &tmp1, &tmp1);
65		D3DXVec3Normalize( &tmp2, &tmp2);
91		D3DXVECTOR3 tmp2 = t2->tangent;
92		D3DXVec3Normalize( &tmp1, &tmp1);
93		D3DXVec3Normalize( &tmp2, &tmp2);
119		D3DXVECTOR3 tmp2 = t2->binormal;
120		D3DXVec3Normalize( &tmp1, &tmp1);
121		D3DXVec3Normalize( &tmp2, &tmp2);
239			}
240			D3DXVec3Normalize( &gnorm, &gnorm );
241			groupNormalVectors.push_back( gnorm );
335			}
336			D3DXVec3Normalize( >ang, >ang );
337			groupTangentVectors.push_back(gtang);
示例7:
GameplayCam.cpp开发语言: C++项目名称: diamondcore-engine代码行数: 406
89	// Move at mSpeed along net direction.
90	D3DXVec3Normalize(&dir, &dir);
91	D3DXVECTOR3 newPos = m_vPosition + dir * m_fSpeed * dt;
160	// Keep camera's axes orthogonal to each other and of unit length.
161	D3DXVec3Normalize(&m_vLookAt, &m_vLookAt);
162
163	D3DXVec3Cross(&m_vUp, &m_vLookAt, &m_vRight);
164	D3DXVec3Normalize(&m_vUp, &m_vUp);
165
166	D3DXVec3Cross(&m_vRight, &m_vUp, &m_vLookAt);
167	D3DXVec3Normalize(&m_vRight, &m_vRight);
168
275	D3DXVECTOR3 L = target - pos;
276	D3DXVec3Normalize(&L, &L);
277
示例8:
Hexagon.cpp开发语言: C++项目名称: terrahex代码行数: 3345
174			//p[j]=getVertexPosition(loadedVertices[v])-m;
175			//D3DXVec3Normalize(&p[j],&p[j]);
176			//j++;
181				p[j]=getVertexPosition(loadedVertices[hexagons[hex].vertices[0]])-m;
182				D3DXVec3Normalize(&p[j],&p[j]);
183				j++;
196	}
197	D3DXVec3Normalize(&n,&n);
198	if(n.y>=0)
223			v3=v3-v4;
224			D3DXVec3Normalize(&v1,&v1);
225			D3DXVec3Normalize(&v3,&v3);
228
229			//D3DXVec3Normalize(&normal,&normal);
230			return -normal;
示例9:
KWGeometry.cpp开发语言: C++项目名称: beadle代码行数: 240
88
89	D3DXVec3Normalize(&m_direction, &m_direction);
90}
166	D3DXVECTOR3 lineVect = GetVector();
167	D3DXVec3Normalize(&lineVect, &lineVect);
168	D3DXVECTOR3 mToO = p - middle;
178	Direction = lookAt;
179	D3DXVec3Normalize(&Direction, &Direction);
180	FovY = fovY;
190	float toLength = D3DXVec3Length(&toPoint);
191	D3DXVec3Normalize(&toPoint, &toPoint);
192	float dot = D3DXVec3Dot(&toPoint, &Direction);
示例10:
Player.cpp开发语言: C++项目名称: stardustbusters_iex代码行数: 474
179			//�x�N�g���̐��K��(z��)
180			D3DXVec3Normalize( &fvec, &fvec );
181		}
185			//�x�N�g���̐��K��(x��)
186			D3DXVec3Normalize( &rvec, &rvec );
187		}
189		GetVecMatrix( &Obj.TransMatrix, &move, 2 );
190		D3DXVec3Normalize( &move, &move );
191		move *= speed;
202					//�x�N�g���̐��K��(x��)
203					D3DXVec3Normalize( &rvec, &rvec );
204					angle.z += -AxisX;
213				//�x�N�g���̐��K��(x��)
214				D3DXVec3Normalize( &rvec, &rvec );
215				angle.z += s;

本文地址:https://www.itbaoku.cn/snippets/415926.html