D3DXVec3Cross 示例代码

2022-03-03

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

示例1:
KWCamera.cpp开发语言: C++项目名称: beadle代码行数: 209
13	//������up����ǰ����m_look�������������ķ���
14	D3DXVec3Cross(&m_right, &up, &m_look);
15	D3DXVec3Normalize(&m_right, &m_right);
17	//����up������ʹ֮��ֱ��look������right�������ɵ�ƽ��
18	D3DXVec3Cross(&m_up, &m_look, &m_right);
19	D3DXVec3Normalize(&m_up, &m_up);
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);
37	D3DXVec3Normalize(&m_right, &m_right);
138	D3DXVECTOR3 worldUp(0, 1.0f, 0); //�����ķ�����
139	D3DXVec3Cross(&right, &worldUp, &m_dir);
140	D3DXVec3Normalize(&right, &right);
示例2:
RenderRibbonSelection.cpp开发语言: C++项目名称: ProteinInsight代码行数: 1999
230			D3DXVECTOR3 result;
231			D3DXVec3Cross(&result, &m_arrayRibbonCurveDirVec[i*m_numSegment], &m_arrayUpVec[i] );
232			D3DXVec3Cross(&result, &result, &m_arrayRibbonCurveDirVec[i*m_numSegment] );
344					D3DXVECTOR3 upVec;
345					D3DXVec3Cross(&upVec, &dirVec, &D3DXVECTOR3(0,0,10));
346
412					//    find UpVec
413					D3DXVec3Cross(&upVec, &dirVec, &D3DXVECTOR3(0,0,10));
414
981		{	//	처음
982			D3DXVec3Cross( &outNormal1, &nv3, &nv1 );
983			D3DXVec3Cross( &outNormal4, &nv2, &nv3 );
989		{
990			D3DXVec3Cross( &outNormal2, &nv1, &nv4 );
991			D3DXVec3Cross( &outNormal3, &nv4, &nv2 );
示例3:
NVMeshMender.cpp开发语言: C++项目名称: coc-1.4-xray-64代码行数: 1158
823
824		D3DXVec3Cross( &t.normal, &edge0, &edge1);
825
897				//to calculate the binormal
898				D3DXVec3Cross(&(theVerts[i].binormal), &(theVerts[i].normal), &(theVerts[i].tangent) );
899
904				//the tangent
905				D3DXVec3Cross(&(theVerts[i].tangent), &(theVerts[i].binormal), &(theVerts[i].normal) );
906			}
928
929				D3DXVec3Cross(&(theVerts[i].tangent), &(theVerts[i].normal), &startAxis );
930				D3DXVec3Cross(&(theVerts[i].binormal), &(theVerts[i].normal), &(theVerts[i].tangent) );
939				//then they are too similar lets make them more different
940				D3DXVec3Cross(&(theVerts[i].binormal), &(theVerts[i].normal), &(theVerts[i].tangent) );
941			}
示例4:
GameplayCam.cpp开发语言: C++项目名称: diamondcore-engine代码行数: 406
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);
278	D3DXVECTOR3 R;
279	D3DXVec3Cross(&R, &up, &L);
280	D3DXVec3Normalize(&R, &R);
282	D3DXVECTOR3 U;
283	D3DXVec3Cross(&U, &L, &R);
284	D3DXVec3Normalize(&U, &U);
303	D3DXVECTOR3 R;
304	D3DXVec3Cross(&R, &D3DXVECTOR3(0,1,0), &L);
305	D3DXVec3Normalize(&R, &R);
示例5:
Electricity.cpp开发语言: C++项目名称: diamondcore-engine代码行数: 515
294		D3DXVec3Normalize(&normal, &look);
295		D3DXVec3Cross(&right, &camUp, &normal);
296		D3DXVec3Cross(&up, &normal, &right);
323	D3DXVec3Normalize(&normal, &look);
324	D3DXVec3Cross(&right, &camUp, &normal);
325	D3DXVec3Cross(&up, &normal, &right);
363		D3DXVec3Normalize(&normal, &look);
364		D3DXVec3Cross(&right, &camUp, &normal);
365		D3DXVec3Cross(&up, &normal, &right);
391	D3DXVec3Normalize(&normal, &look);
392	D3DXVec3Cross(&right, &camUp, &normal);
393	D3DXVec3Cross(&up, &normal, &right);
示例6:
Terrain.cpp开发语言: C++项目名称: Edaenge代码行数: 418
65			D3DXVECTOR3 norm;
66			D3DXVec3Cross(&norm, &v2, &v1);
67			D3DXVec3Normalize(&norm,&norm);
82		D3DXVECTOR3 norm;
83		D3DXVec3Cross(&norm, &v1, &v2);
84		D3DXVec3Normalize(&norm,&norm);
99		D3DXVECTOR3 norm;
100		D3DXVec3Cross(&norm, &v2, &v1);
101		D3DXVec3Normalize(&norm,&norm);
116		D3DXVECTOR3 norm;
117		D3DXVec3Cross(&norm, &v2, &v1);
118		D3DXVec3Normalize(&norm,&norm);
133		D3DXVECTOR3 norm;
134		D3DXVec3Cross(&norm, &v1, &v2);
135		D3DXVec3Normalize(&norm,&norm);
示例7:
DXUTcamera.cpp开发语言: C++项目名称: EdwardKL代码行数: 1525
75    float fDot = D3DXVec3Dot( &vFrom, &vTo );
76    D3DXVec3Cross( &vPart, &vFrom, &vTo );
77
940    D3DXVec3Normalize( pXBasis, pXBasis );
941    D3DXVec3Cross( pYBasis, pZBasis, pXBasis );
942    D3DXVec3Normalize( pYBasis, pYBasis );
943    D3DXVec3Cross( pZBasis, pXBasis, pYBasis );
944
1382    D3DXVec3Normalize( pXBasis, pXBasis );
1383    D3DXVec3Cross( pYBasis, pZBasis, pXBasis );
1384    D3DXVec3Normalize( pYBasis, pYBasis );
1385    D3DXVec3Cross( pZBasis, pXBasis, pYBasis );
1386
示例8:
DXUTcamera.cpp开发语言: C++项目名称: eiketinen代码行数: 1528
75    float fDot = D3DXVec3Dot( &vFrom, &vTo );
76    D3DXVec3Cross( &vPart, &vFrom, &vTo );
77
940    D3DXVec3Normalize( pXBasis, pXBasis );
941    D3DXVec3Cross( pYBasis, pZBasis, pXBasis );
942    D3DXVec3Normalize( pYBasis, pYBasis );
943    D3DXVec3Cross( pZBasis, pXBasis, pYBasis );
944
1387    D3DXVec3Normalize( pXBasis, pXBasis );
1388    D3DXVec3Cross( pYBasis, pZBasis, pXBasis );
1389    D3DXVec3Normalize( pYBasis, pYBasis );
1390    D3DXVec3Cross( pZBasis, pXBasis, pYBasis );
1391
示例9:
r2_R_sun.cpp开发语言: C++项目名称: coc-1.4-xray-64代码行数: 1718
120
121    D3DXVec3Cross( &n1_n2, &n1, &n2 );
122    D3DXVec3Cross( &n2_n0, &n2, &n0 );
123    D3DXVec3Cross( &n0_n1, &n0, &n1 );
124
882        D3DXVec3TransformNormal( &upVector, &m_lightDir, &m_View );  // lightDir is defined in eye space, so xform it
883        D3DXVec3Cross( &leftVector, &upVector, &eyeVector );
884        D3DXVec3Normalize( &leftVector, &leftVector );
885        D3DXVec3Cross( &viewVector, &upVector, &leftVector );
886
示例10:
r2_R_sun.cpp开发语言: C++项目名称: coc-1.4-xray-64代码行数: 1341
122
123    D3DXVec3Cross( &n1_n2, &n1, &n2 );
124    D3DXVec3Cross( &n2_n0, &n2, &n0 );
125    D3DXVec3Cross( &n0_n1, &n0, &n1 );
126
469        D3DXVec3TransformNormal( &upVector, &m_lightDir, &m_View );  // lightDir is defined in eye space, so xform it
470        D3DXVec3Cross( &leftVector, &upVector, &eyeVector );
471        D3DXVec3Normalize( &leftVector, &leftVector );
472        D3DXVec3Cross( &viewVector, &upVector, &leftVector );
473

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