I'm trying to rotate models independently of each other however I cannot for the life of my figure out how. I have gotten to the stage of writing this:
std::vector<int>::size_type st = Models.size();
if (!Models.empty())
{
for (unsigned x = 0; x < st; x++)
{
D3DXMATRIX matRotate;
D3DXMatrixRotationY(&matRotate, D3DXToRadian((x + 1) * 60));
cBuffer[x].Final = matRotate * matView * matProjection;
cBuffer[x].Rotation = matRotate;
devcon->UpdateSubresource(pCBuffer, 0, NULL, &cBuffer[x], 0, 0);
devcon->VSSetShader(pVS, 0, 0);
devcon->VSSetConstantBuffers(0, 1, &pCBuffer);
devcon->PSSetShader(pPS, 0, 0);
Models.at(x)->Render(devcon);
}
}
swapchain->Present(0, 0);
but this only updates for the first assignment of rotation. Why isn't it rotating and how do I make it? Thanks in advance.