I need some help with my DirectX transforms. I have a function that displays the axis, like so.
Vertex verts[] = {
Vertex(0,0,0,0,0,0xffff0000),
Vertex(3,0,0,0,0,0xffff0000),
Vertex(0,0,0,0,0,0xff00ff00),
Vertex(0,3,0,0,0,0xff00ff00),
Vertex(0,0,0,0,0,0xff00ffff),
Vertex(0,0,3,0,0,0xff00ffff)
};
vertexBuffer.Write(verts, 6);
vertexBuffer.SetAsSource();
pd3dDevice->DrawPrimitive( D3DPT_LINELIST, 0, 6 );
So far so good, displays the axis looking down the z axis.
Now, when I apply my transforms, I see absolutely nothing. Nada. Zip.
D3DXMATRIXA16 matWorld;
D3DXMatrixRotationY( &matWorld, timeGetTime()/1000.0f );
pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
D3DXVECTOR3 vEyePt( 0.0f, 3.0f,-5.0f );
D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f );
D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f );
D3DXMATRIXA16 matView;
D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec );
pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
D3DXMATRIXA16 matProj;
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f );
pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
Any idea what I'm doing wrong?
"a riddle wrapped in a mystery inside an enigma" - Churchill