Okay forgive me if this is at all vague, but I've been up all night trying to catch up with some coding.
I have a reasonably large and defined terrain with minimal optimisations in place and I have just started to introduce predefined meshes (.X objects) which come with materials and textures. Previously I was working in a fixed-function-pipeline approach as I have only recently started working with DirectX9. It has become apparent that FFP is old school and deprecated in DirectX10, so I have been moving relevant code to using a HLSL approach.
In my initial approach I had loaded my models into a std::vector container of models and created another std::vector of objects which contain a reference to which model to display. In my render loop, I would iterate this container and check to see if the objects were within the Field-of-view of my camera. If so I would first translate the meshes to their positions, using a SetTransform() call, then DrawSubset().
However it has become clear that SetTransform() is not applicable to the HLSL approach; therefore I'm a little stumped to how I can pre-translate these meshes to their relevant positions, or whether I should be translating them within the vertex shader. The meshes are stored within an ID3DXMESH type and it seems that I can access the Index and Vertex Buffer of these meshes; Am I supposed to take the contents of these buffers, translate the contents then draw them? Or am I really going the wrong way about doing this?
I am familiar with the Vertex Buffer approach, but not sure what the vertex format is within the mesh itself.
Any help would be appreciated as I'm about to tear my eyeballs out.
Edit
I'll accept Sergio's answer as it pushed me in the right direction although the solution came when I realised in my debug output a line about committing changes.
Solution
After transforming my mesh I needed to call g_pEffect->CommitChanges();
As someone said earlier you should be doing the translation on your vertex shader, if you have a worldViewProjection matrix constant within your shader, then you need to multiply the vertex position by that matrix and return the transformed position on your output before you move onto your pixel shader.
Make sure the world transform you are passing in with your view and projection is not just an identity as this wont transform the verts at all.
This is a sample on how you can achieve this on your vertex shader, which is essentially multiplying the incoming untransformed vertex position by the worldViewProj matrix.
VS_OUTPUT vs_main( float4 inPos: POSITION )
{
VS_OUTPUT output;
output.pos = mul( inPos, g_worldViewProj );
return output;
}