But just one more thing. Ive gotten rid of all the scale , rotate stuff etc. I just want to make sure this code is right.
world function again
float constants[4] = {0, 0.5f, 1.0f, 2.0f};lp_Device->SetVertexShaderConstantF( 0, (float*)&constants, 1 );D3DXMATRIX matWorld, matView, matProj;//view settingD3DXMatrixLookAtLH( &matView, &D3DXVECTOR3( 50, -10, 10 ), &D3DXVECTOR3( 0, 0, 0 ), &D3DXVECTOR3( 0, 1, 0 ));lp_Device->SetTransform( D3DTS_VIEW, &matView );////projection setting D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/2, 1.0f, 1, 500 );lp_Device->SetTransform( D3DTS_PROJECTION, &matProj );////world setting...D3DXMatrixTranslation(&matWorld ,x , y, z);//D3DXMatrixMultiply(&matWorld,&matWorld,&matView);D3DXMatrixMultiply( &matWorld, &matWorld, &matProj ); D3DXMatrixTranspose( &matWorld, &matWorld );//lp_Device->SetVertexShaderConstantF( 4, (float*)&matWorld, 4 );float color[4] = {1,1,1,0};lp_Device->SetVertexShaderConstantF( 8, (float*)&color, 1 );float lightDir[4] = {-1,0,1,0}; // fatter slicelp_Device->SetVertexShaderConstantF( 12, (float*)&lightDir, 1 );
[edited by - johnnyBravo on September 24, 2003 6:06:27 AM]