这篇教程C++ D3DXVec3TransformNormal函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中D3DXVec3TransformNormal函数的典型用法代码示例。如果您正苦于以下问题:C++ D3DXVec3TransformNormal函数的具体用法?C++ D3DXVec3TransformNormal怎么用?C++ D3DXVec3TransformNormal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了D3DXVec3TransformNormal函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: D3DXVec3TransformCoordvoid ReflRender::BeginRT(Engine& engine, const RtFlags& flags){ const DWORD cClipPlanes[6] = {D3DCLIPPLANE0, D3DCLIPPLANE1, D3DCLIPPLANE2, D3DCLIPPLANE3, D3DCLIPPLANE4, D3DCLIPPLANE5}; _MyBase::BeginRT(engine, flags); CameraDesc desc = engine.GetContext().GetCamera().GetDesc(); D3DXVec3TransformCoord(&desc.pos, &desc.pos, &_reflMat); D3DXVec3TransformNormal(&desc.dir, &desc.dir, &_reflMat); D3DXVec3TransformNormal(&desc.up, &desc.up, &_reflMat); desc.up = -desc.up; _reflCamera.SetDesc(desc); //reflCamera.AdjustFarPlane(sceneBox, maxFarDist); engine.GetContext().ApplyCamera(&_reflCamera); DWORD enableClipPlanes = cClipPlanes[0]; engine.GetDriver().GetDevice()->SetClipPlane(0, _reflPlane); LSL_ASSERT(_clipPlanes.size() <= 5); for (unsigned i = 0; i < _clipPlanes.size(); ++i) { enableClipPlanes |= cClipPlanes[i + 1]; engine.GetDriver().GetDevice()->SetClipPlane(i + 1, _clipPlanes[i]); } engine.GetContext().SetRenderState(rsClipPlaneEnable, enableClipPlanes); ApplyRT(engine, flags);}
开发者ID:DimaKirk,项目名称:rrr3d,代码行数:31,
示例2: D3DXMatrixRotationZvoid CElementManager::CreateCircle(const D3DXVECTOR3& pos, FLOAT intensity, const SMap *map, FLOAT lastTime, FLOAT length, INT max, DWORD color, BOOL isPlayer) { D3DXVECTOR3 dir; D3DXMATRIX trans; if (intensity > 1.f) intensity = 1.f; INT cnt = static_cast<INT>(max*intensity+0.5f); D3DXMatrixRotationZ(&trans, 2*D3DX_PI/cnt); UINT t; do { rand_s(&t); dir.x = t%10-5.f; rand_s(&t); dir.y = t%10-5.f; } while (dir.x == 0.f && dir.y == 0.f); dir.z = 0.f; D3DXVec3Normalize(&dir, &dir); if (isPlayer) for (INT i(0); i < cnt; ++i) { D3DXVec3TransformNormal(&dir, &dir, &trans); m_pEcho.push_back(new CLine(pos, dir, intensity, map, intensity <= 2.f/9, lastTime, length, color)); } else for (INT i(0); i < cnt; ++i) { D3DXVec3TransformNormal(&dir, &dir, &trans); m_pAmbience.push_back(new CLine(pos, dir, intensity, map, intensity <= 2.f/9, lastTime, length, color)); }}
开发者ID:wyrover,项目名称:Echo,代码行数:31,
示例3: D3DXVec3TransformCoordvoid BoundingBox::Transform(const D3DXMATRIX& m){ D3DXVec3TransformCoord(¢er, ¢er, &m); D3DXVec3TransformNormal(&vx, &vx, &m); D3DXVec3TransformNormal(&vy, &vy, &m); D3DXVec3TransformNormal(&vz, &vz, &m);}
开发者ID:Hrnchamd,项目名称:MGE-XE,代码行数:7,
示例4: D3DXVECTOR3//just rotate lights a little in placevoid Scene::UpdateLights(double fTime){ D3DXVECTOR3 offAngleVec3 = D3DXVECTOR3(1, -4, 0); D3DXMATRIX rotY; D3DXVECTOR3 dir; D3DXVec3Normalize(&offAngleVec3, &offAngleVec3); D3DXMatrixRotationY(&rotY, (float)(fTime / 4.f) * 3.14159265f); D3DXVec3TransformNormal(&dir, &offAngleVec3, &rotY); m_lights[0].vLightDir = dir; D3DXVec3Normalize(&offAngleVec3, &offAngleVec3); D3DXMatrixRotationY(&rotY, (float)(-fTime / 3.f) * 3.14159265f); D3DXVec3TransformNormal(&dir, &offAngleVec3, &rotY); m_lights[1].vLightDir = dir; D3DXVec3Normalize(&offAngleVec3, &offAngleVec3); D3DXMatrixRotationY(&rotY, (float)(fTime / 2.f) * 3.14159265f); D3DXVec3TransformNormal(&dir, &offAngleVec3, &rotY); m_lights[2].vLightDir = dir; D3DXVec3Normalize(&offAngleVec3, &offAngleVec3); D3DXMatrixRotationY(&rotY, (float)(-fTime / 4.f) * 3.14159265f); D3DXVec3TransformNormal(&dir, &offAngleVec3, &rotY); m_lights[3].vLightDir = dir;}
开发者ID:151706061,项目名称:D3DSamples,代码行数:27,
示例5: D3DXMatrixRotationAxisvoid Camera::Pitch( float angle ){ D3DXMATRIX R; D3DXMatrixRotationAxis(&R, &mRight, angle); D3DXVec3TransformNormal(&mUp, &mUp, &R); D3DXVec3TransformNormal(&mLook, &mLook, &R);}
开发者ID:jaffafa,项目名称:pacman-reloaded,代码行数:7,
示例6: D3DXMatrixRotationAxisvoid Camera::Pitch(float _angle){ D3DXMATRIX p; D3DXMatrixRotationAxis(&p, &right, _angle); D3DXVec3TransformNormal(&up, &up, &p); D3DXVec3TransformNormal(&look, &look, &p);}
开发者ID:sywor,项目名称:3D_Projekt,代码行数:8,
示例7: D3DXMatrixRotationYvoid Camera::RotateY( float angle ){ D3DXMATRIX R; D3DXMatrixRotationY(&R, angle); D3DXVec3TransformNormal(&mRight, &mRight, &R); D3DXVec3TransformNormal(&mUp, &mUp, &R); D3DXVec3TransformNormal(&mLook, &mLook, &R);}
开发者ID:jaffafa,项目名称:pacman-reloaded,代码行数:8,
示例8: D3DXMatrixRotationYvoid Camera::rotateY(float angle){ D3DXMATRIX rotation; D3DXMatrixRotationY(&rotation,angle); D3DXVec3TransformNormal(&right,&right,&rotation); D3DXVec3TransformNormal(&up,&up,&rotation); D3DXVec3TransformNormal(&look,&look,&rotation); }
开发者ID:Kamelen,项目名称:D3D2proj2,代码行数:9,
示例9: D3DXMatrixRotationAxisvoid Camera::pitch(float angle){ D3DXMATRIX rotation; D3DXMatrixRotationAxis(&rotation,&right,angle); D3DXVec3TransformNormal(&up,&up,&rotation); D3DXVec3TransformNormal(&look,&look,&rotation); }
开发者ID:Kamelen,项目名称:D3D2proj2,代码行数:9,
示例10: D3DXMatrixRotationYvoid Camera::RotateY(float _angle){ D3DXMATRIX r; D3DXMatrixRotationY(&r, _angle); D3DXVec3TransformNormal(&right, &right, &r); D3DXVec3TransformNormal(&up, &up, &r); D3DXVec3TransformNormal(&look, &look, &r);}
开发者ID:sywor,项目名称:3D_Projekt,代码行数:9,
示例11: D3DXMatrixTranslationRay OBB::GetContactPoint(Ray &ray) { D3DXMATRIX p, r, world, invWorld; D3DXMatrixTranslation(&p, m_pos.x, m_pos.y, m_pos.z); D3DXMatrixRotationQuaternion(&r, &m_rot); D3DXMatrixMultiply(&world, &r, &p); D3DXMatrixInverse(&invWorld, NULL, &world); D3DXVECTOR3 org, dir; D3DXVec3TransformCoord(&org, &ray.m_org, &invWorld); D3DXVec3TransformNormal(&dir, &ray.m_dir, &invWorld); D3DXPLANE planes[] = {D3DXPLANE(0.0f, 0.0f, -1.0f, -m_size.z), D3DXPLANE(0.0f, 0.0f, 1.0f, -m_size.z), D3DXPLANE(0.0f, -1.0f, 0.0f, -m_size.y), D3DXPLANE(0.0f, 1.0f, 0.0f, -m_size.y), D3DXPLANE(-1.0f, 0.0f, 0.0f, -m_size.x), D3DXPLANE(1.0f, 0.0f, 0.0f, -m_size.x) }; D3DXVECTOR3 result, normal; int numPlanes = 0; int numIntersections = 0; for (int i=0; i<6; i++) { float d = org.x * planes[i].a + org.y * planes[i].b + org.z * planes[i].c; if (d > -planes[i].d) { D3DXVECTOR3 r; if (D3DXPlaneIntersectLine(&r, &planes[i], &org, &(org + dir * 1000.0f)) != NULL) { numPlanes++; if (abs(r.x) <= m_size.x && abs(r.y) <= m_size.y && abs(r.z) <= m_size.z) { D3DXVec3TransformCoord(&r, &r, &world); result = r; normal = D3DXVECTOR3(planes[i].a, planes[i].b, planes[i].c); numIntersections++; } } } } if (numIntersections == 0) { //Warning! OBB No Intersections! return Ray(ray.m_org, -ray.m_dir); } D3DXVec3Normalize(&normal, &normal); D3DXVec3TransformNormal(&normal, &normal, &world); return Ray(result, normal);}
开发者ID:7zhang,项目名称:studies,代码行数:56,
示例12: D3DXMatrixRotationAxis |