Original Post
I am having trouble transforming my objects in world space. Its seemigly simple, but i've tried many thing i found online, and still i cant crack it. Heres the code: I have a created cube, and am trying to transform a position matrix just before rendering it. The code looks legit to me, so maybe the problem is in some other part of the code, or somehow in the way i set up my world. The world is in right handed coordinate system, i doubt it, buy might this be a problem? Also another question, when i change the world matrix, as i understand it, EVERYTHING drawn after this is moved right? So i may be moving the ground and everything along with my object? But then againt i can use my camera as reference, and still dont see any displacement! Any ideas? ps. I am also using effects(ID3DXEffect*), maybe i need to use its settransform?! [Edited by - avion85 on May 25, 2009 5:51:11 PM]
D3DXMATRIXA16 matWorld;
D3DXMatrixTranslation(&matWorld,10.0f,10.0f,50.0f);
HR(gd3dDevice->SetTransform( D3DTS_WORLD, &matWorld ));
HR(gd3dDevice->SetStreamSource(0, SphereVertexBuffer, 0, sizeof(VertexPos)));
HR(gd3dDevice->SetIndices(SphereIndexBuffer));
HR(gd3dDevice->SetVertexDeclaration(VertexPos::Decl));
HR(gd3dDevice->DrawIndexedPrimitive( D3DPT_TRIANGLELIST,0,0,num_vertices,0,4*meridians*(parallels-1)));