D3D - Perspective Confusion
I'm a little confused because I am not getting results from my attempts to change my perspective in D3D
I am trying stuff like
Code:
int DirectXWindow::RenderDxScene(void)
{
HRESULT hr = S_OK;
hr = m_pd3dDevice->TestCooperativeLevel();
switch(hr)
{
// ...
}
m_pd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
D3DCOLOR_COLORVALUE(0, 0, 0, 1.0f), 1.0f, 0);
m_pd3dDevice->BeginScene();
// D3DXMATRIX matWorld; // Either this
// D3DXMatrixTranslation(&matWorld, 0.0f, 0.0f, 5000.0f);
// m_pd3dDevice->SetTransform(D3DTS_WORLD, &matWorld);
D3DXMATRIX matView; // Or this
D3DXMatrixLookAtLH(&matView,
&D3DXVECTOR3(0.0f, 3.0f, -5000.0f),
&D3DXVECTOR3(0.0f, 0.0f, 0.0f),
&D3DXVECTOR3(0.0f, 1.0f, 0.0f));
m_pd3dDevice->SetTransform(D3DTS_VIEW, &matView);
ScenePrimitive * s = triangle;
m_pd3dDevice->SetTexture(0, 0);
m_pd3dDevice->SetMaterial(&s->material);
m_pd3dDevice->SetFVF(s->fvf);
m_pd3dDevice->SetStreamSource(0, s->buffer, 0, sizeof(Vertex));
m_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);
m_pd3dDevice->EndScene();
if(m_pd3dDevice->Present(0, 0, 0, 0) == D3DERR_DEVICELOST)
{
dout << "Present\n";
}
return 1;
}
Neither do anything, and my triangle just sits there, large and unaffected by my attempts to move it. Is there any obvious reason :?