|
|
使用vc.net2005,修改前是:
D3DXMATRIX V;
TheCamera.getViewMatrix(&V);
Device->SetTransform(D3DTS_VIEW, &V);
修改后是:
bool Display(float timeDelta)
{
if( Device )
{
if( ::GetAsyncKeyState('W') & 0x8000f )
TheCamera.walk(4.0f * timeDelta);
if( ::GetAsyncKeyState('S') & 0x8000f )
TheCamera.walk(-4.0f * timeDelta);
if( ::GetAsyncKeyState('A') & 0x8000f )
TheCamera.strafe(-4.0f * timeDelta);
if( ::GetAsyncKeyState('D') & 0x8000f )
TheCamera.strafe(4.0f * timeDelta);
if( ::GetAsyncKeyState('R') & 0x8000f )
TheCamera.fly(4.0f * timeDelta);
if( ::GetAsyncKeyState('F') & 0x8000f )
TheCamera.fly(-4.0f * timeDelta);
if( ::GetAsyncKeyState(VK_UP) & 0x8000f )
TheCamera.pitch(1.0f * timeDelta);
if( ::GetAsyncKeyState(VK_DOWN) & 0x8000f )
TheCamera.pitch(-1.0f * timeDelta);
if( ::GetAsyncKeyState(VK_LEFT) & 0x8000f )
TheCamera.yaw(-1.0f * timeDelta);
if( ::GetAsyncKeyState(VK_RIGHT) & 0x8000f )
TheCamera.yaw(1.0f * timeDelta);
if( ::GetAsyncKeyState('N') & 0x8000f )
TheCamera.roll(1.0f * timeDelta);
if( ::GetAsyncKeyState('M') & 0x8000f )
TheCamera.roll(-1.0f * timeDelta);
D3DXMATRIX V;
TheCamera.getViewMatrix(D3DXMatrixScaling(&V,0.001,0.001,0.001));//切换x文件的大小
Device->SetTransform(D3DTS_WORLD, D3DXMatrixScaling(&V,0.01,0.01,0.01));//切换x文件的大小
Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0);
Device->BeginScene();
for(int i = 0; i < Mtrls.size(); i++)
{
Device->SetMaterial( &Mtrls );
Device->SetTexture(0, Textures);
Mesh->DrawSubset(i);
}
d3d: rawBasicScene(Device, 1.0f);
Device->EndScene();
Device-> resent(0, 0, 0, 0);
}
return true;
}
修改前可以变换视角,.x文件比较,将其缩小。修改后无法变换。请帮帮忙!谢谢!
这是一个杯子倒水的过程,在问一下如何实现杯子倾倒的过程,谢谢! |
|