D3DXVECTOR4 示例代码

2022-03-03

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

示例1:
CascadedShadowMap.cpp开发语言: C++项目名称: Edaenge代码行数: 317
33	//calculate points (in world space) for the frustum slice
34	D3DXVECTOR4 camPos = D3DXVECTOR4(cam->GetPositionD3DX(), 1.0f);
35	D3DXVECTOR4 camForward = D3DXVECTOR4(cam->GetForwardD3DX(), 1.0f);
36	D3DXVECTOR4 camRight = D3DXVECTOR4(cam->GetRightVectorD3DX(), 1.0f);
37	D3DXVECTOR4 camUp = D3DXVECTOR4(cam->GetUpVectorD3DX(), 1.0f);
138	D3DXVECTOR4	farBottomLeftH = D3DXVECTOR4(farBottomLeft.x, farBottomLeft.y, farBottomLeft.z, 1.0f);
139	D3DXVECTOR4	farBottomRightH = D3DXVECTOR4(farBottomRight.x, farBottomRight.y, farBottomRight.z, 1.0f);
140	//Near
141	D3DXVECTOR4	nearTopLeftH = D3DXVECTOR4(nearTopLeft.x, nearTopLeft.y, nearTopLeft.z, 1.0f);
142	D3DXVECTOR4	nearTopRightH = D3DXVECTOR4(nearTopRight.x, nearTopRight.y, nearTopRight.z, 1.0f);
143	D3DXVECTOR4	nearBottomLeftH = D3DXVECTOR4(nearBottomLeft.x, nearBottomLeft.y, nearBottomLeft.z, 1.0f);
144	D3DXVECTOR4	nearBottomRightH = D3DXVECTOR4(nearBottomRight.x, nearBottomRight.y, nearBottomRight.z, 1.0f);
示例2:
LEFont.cpp开发语言: C++项目名称: top-recode代码行数: 1493
459				if (bExit) {
460					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx1, ty2));
461					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx, sy, 0.0f, 1), color, D3DXVECTOR2(tx1, ty1));
462					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx + w, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx2, ty2));
463
464					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx + w, sy, 0.0f, 1), color, D3DXVECTOR2(tx2, ty1));
465					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx + w, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx2, ty2));
466					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx, sy, 0.0f, 1), color, D3DXVECTOR2(tx1, ty1));
467				} else {
468					_vecVer[idxHsl++].SetValue(D3DXVECTOR4(sx, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx1, ty2));
469					_vecVer[idxHsl++].SetValue(D3DXVECTOR4(sx, sy, 0.0f, 1), color, D3DXVECTOR2(tx1, ty1));
示例3:
MPFont.cpp开发语言: C++项目名称: top-recode代码行数: 1486
436				if (bExit) {
437					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx1, ty2));
438					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx, sy, 0.0f, 1), color, D3DXVECTOR2(tx1, ty1));
439					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx + w, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx2, ty2));
440
441					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx + w, sy, 0.0f, 1), color, D3DXVECTOR2(tx2, ty1));
442					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx + w, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx2, ty2));
443					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx, sy, 0.0f, 1), color, D3DXVECTOR2(tx1, ty1));
444				} else {
445					_vecVer[idxHsl++].SetValue(D3DXVECTOR4(sx, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx1, ty2));
446					_vecVer[idxHsl++].SetValue(D3DXVECTOR4(sx, sy, 0.0f, 1), color, D3DXVECTOR2(tx1, ty1));
示例4:
MPFont.cpp开发语言: C++项目名称: top-recode代码行数: 1493
459				if (bExit) {
460					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx1, ty2));
461					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx, sy, 0.0f, 1), color, D3DXVECTOR2(tx1, ty1));
462					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx + w, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx2, ty2));
463
464					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx + w, sy, 0.0f, 1), color, D3DXVECTOR2(tx2, ty1));
465					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx + w, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx2, ty2));
466					_vecAsh[idxAsh++].SetValue(D3DXVECTOR4(sx, sy, 0.0f, 1), color, D3DXVECTOR2(tx1, ty1));
467				} else {
468					_vecVer[idxHsl++].SetValue(D3DXVECTOR4(sx, sy + h, 0.0f, 1), color, D3DXVECTOR2(tx1, ty2));
469					_vecVer[idxHsl++].SetValue(D3DXVECTOR4(sx, sy, 0.0f, 1), color, D3DXVECTOR2(tx1, ty1));
示例5:
SMallMap.cpp开发语言: C++项目名称: top-recode代码行数: 3050
411	for (int n = 0; n < 4; n++) {
412		(*pVertices++).SetValue(D3DXVECTOR4(0, 0, 0, float(n)), _dwColor, vUV[n]);
413	}
424	_pVBWnd->Lock(0, 0, (BYTE**)&pVers, D3DLOCK_DISCARD);
425	(*pVers++).SetValue(D3DXVECTOR4(float(_rcWnd.left), float(_rcWnd.top), 0.9f, 1), 0xffffffff, vUV[0]);
426	(*pVers++).SetValue(D3DXVECTOR4(float(_rcWnd.right), float(_rcWnd.top), 0.9f, 1), 0xffffffff, vUV[1]);
427	(*pVers++).SetValue(D3DXVECTOR4(float(_rcWnd.right), float(_rcWnd.bottom), 0.9f, 1), 0xffffffff, vUV[2]);
428	(*pVers++).SetValue(D3DXVECTOR4(float(_rcWnd.left), float(_rcWnd.bottom), 0.9f, 1), 0xffffffff, vUV[3]);
688#endif
689				(*pVertices++).m_vPos = D3DXVECTOR4(float(sx), float(sy), 0, 1);
690				(*pVertices++).m_vPos = D3DXVECTOR4(float(sx) + SHOWRSIZE, float(sy), 0, 1);
691				(*pVertices++).m_vPos = D3DXVECTOR4(float(sx) + SHOWRSIZE, float(sy) + SHOWRSIZE, 0, 1);
692				(*pVertices++).m_vPos = D3DXVECTOR4(float(sx), float(sy) + SHOWRSIZE, 0, 1);
示例6:
SMallMap.cpp开发语言: C++项目名称: top-recode代码行数: 2870
395	for (int n = 0; n < 4; n++) {
396		(*pVertices++).SetValue(D3DXVECTOR4(0, 0, 0, float(n)), _dwColor, vUV[n]);
397	}
408	_pVBWnd->Lock(0, 0, (BYTE**)&pVers, D3DLOCK_DISCARD);
409	(*pVers++).SetValue(D3DXVECTOR4(float(_rcWnd.left), float(_rcWnd.top), 0.9f, 1), 0xffffffff, vUV[0]);
410	(*pVers++).SetValue(D3DXVECTOR4(float(_rcWnd.right), float(_rcWnd.top), 0.9f, 1), 0xffffffff, vUV[1]);
411	(*pVers++).SetValue(D3DXVECTOR4(float(_rcWnd.right), float(_rcWnd.bottom), 0.9f, 1), 0xffffffff, vUV[2]);
412	(*pVers++).SetValue(D3DXVECTOR4(float(_rcWnd.left), float(_rcWnd.bottom), 0.9f, 1), 0xffffffff, vUV[3]);
645#endif
646				(*pVertices++).m_vPos = D3DXVECTOR4(float(sx), float(sy), 0, 1);
647				(*pVertices++).m_vPos = D3DXVECTOR4(float(sx) + SHOWRSIZE, float(sy), 0, 1);
648				(*pVertices++).m_vPos = D3DXVECTOR4(float(sx) + SHOWRSIZE, float(sy) + SHOWRSIZE, 0, 1);
649				(*pVertices++).m_vPos = D3DXVECTOR4(float(sx), float(sy) + SHOWRSIZE, 0, 1);
示例7:
PhysicsEngine.cpp开发语言: C++项目名称: Edaenge代码行数: 870
99{
100	D3DXVECTOR4 pos;
101	D3DXVec3Transform(&pos, &bs.center, &world);
119{
120	D3DXVECTOR4 tpos1;
121	D3DXVec3Transform(&tpos1, &bs1.center, &world1);
122
123	D3DXVECTOR4 tpos2;
124	D3DXVec3Transform(&tpos2, &bs2.center, &world2);
191
192			D3DXVECTOR4 pos0;
193			D3DXVec3Transform(&pos0, &vert0.pos, &worldMat);
194			D3DXVECTOR4 pos1;
195			D3DXVec3Transform(&pos1, &vert1.pos, &worldMat);
示例8:
Display.cpp开发语言: C++项目名称: abrown28代码行数: 2289
61//-------------------------------------------------------------------------------
62D3DXVECTOR4 g_aclNormalColors[14] = 
63{
64	D3DXVECTOR4(0xFF / 255.0f,0xFF / 255.0f,0xFF / 255.0f, 1.0f), // white
65
66	D3DXVECTOR4(0xFF / 255.0f,0x00 / 255.0f,0x00 / 255.0f,1.0f), // red
67	D3DXVECTOR4(0x00 / 255.0f,0xFF / 255.0f,0x00 / 255.0f,1.0f), // green
68	D3DXVECTOR4(0x00 / 255.0f,0x00 / 255.0f,0xFF / 255.0f,1.0f), // blue
69
70	D3DXVECTOR4(0xFF / 255.0f,0xFF / 255.0f,0x00 / 255.0f,1.0f), // yellow
71	D3DXVECTOR4(0xFF / 255.0f,0x00 / 255.0f,0xFF / 255.0f,1.0f), // magenta
示例9:
Display.cpp开发语言: C++项目名称: ajshort代码行数: 2289
61//-------------------------------------------------------------------------------
62D3DXVECTOR4 g_aclNormalColors[14] = 
63{
64	D3DXVECTOR4(0xFF / 255.0f,0xFF / 255.0f,0xFF / 255.0f, 1.0f), // white
65
66	D3DXVECTOR4(0xFF / 255.0f,0x00 / 255.0f,0x00 / 255.0f,1.0f), // red
67	D3DXVECTOR4(0x00 / 255.0f,0xFF / 255.0f,0x00 / 255.0f,1.0f), // green
68	D3DXVECTOR4(0x00 / 255.0f,0x00 / 255.0f,0xFF / 255.0f,1.0f), // blue
69
70	D3DXVECTOR4(0xFF / 255.0f,0xFF / 255.0f,0x00 / 255.0f,1.0f), // yellow
71	D3DXVECTOR4(0xFF / 255.0f,0x00 / 255.0f,0xFF / 255.0f,1.0f), // magenta
示例10:
Storm3D_ShaderManager.cpp开发语言: C++项目名称: DeejStar代码行数: 1180
299			D3DXPlaneFromPointNormal(&plane, &point, &normal);
300			D3DXVECTOR4 clipPlane(plane.a, plane.b, plane.c, plane.d);
301
306
307			D3DXVECTOR4 projectedPlane;
308			D3DXVec4Transform(&projectedPlane, &clipPlane, &normalizedViewProjection);
311			{
312				D3DXVECTOR4 tempPlane = -clipPlane;
313				D3DXVec4Transform(&projectedPlane, &tempPlane, &normalizedViewProjection);
326
327void Storm3D_ShaderManager::SetViewPosition(const D3DXVECTOR4 &p)
328{
623		// Set transparency?
624		D3DXVECTOR4 ambient = ambient_color;
625		ambient *= sun_properties.w;

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