You need to rotate the object representing the lines first.
Code:
D3DXMATRIX mWorld, mView;
D3DXMatrixRotationY( &mView, i );
D3DXMatrixTranslation( &mWorld, 0.0f, 0.0f, 5.0f );
pd3dDevice->SetTransform( D3DTS_WORLD, &mWorld );
pd3dDevice->SetFVF( D3DFVF_MY_VERTEX );
pd3dDevice->SetStreamSource( 0, pCircleList, 0, sizeof(Vertex) );
pd3dDevice->DrawPrimitive( D3DPT_LINELIST, 0, (67 * 720) / 2);
pd3dDevice->SetTransform( D3DTS_WORLD, &mView );
You are setting the world matrix for the object to the view matrix which is incorrect. You need to create an object representing the line grid and then create 2 of these objects. Each of these then will have their own world transformations.
Based on your setup you seem a bit fuzzy on how 3D transformations work. I suggest doing some research on the topic for further understanding.
Here is how I would do it:
Code:
class LineGrid
{
public:
...
void Render();
private:
D3DXVECTOR3 m_vecPos;
D3DXVECTOR3 m_vecRot;
D3DXVECTOR3 m_vecScale;
};
...
void LineGrid::Render()
{
D3DXMATRIX matWorld,matTrans,matRot,matScale;
//Scale
D3DXMatrixScaling(&matScale,m_vecScale.x,m_vecScale.y,m_vecScale.z);
//Rotate - will suffer gimble lock
D3DXMatrixRotationYawPitchRoll(&matRot,m_vecRot.x,m_vecRot.y,m_vecRot.z);
//Translate
D3DXMatrixTranslation(&matTrans,m_vecPos.x,m_vecPos.y,m_vecPos.z);
//Concatenate - order is important
//If you translate then rotate, rotation is around new position
//If you rotate then translate, rotation is around 0,0,0
//You may wish to do both depending on the application
//Scale in model space
//Rotate in model space
//Translate to position
matWorld=matScale*matRot*matTrans;
//Set world transform
m_pDevice->SetTransform(D3DTS_WORLD,&matWorld);
//Draw object
...
...
}
...
...
void My3DApp::Render()
{
//Set view matrix
m_pDevice->SetTransform(D3DTS_VIEW,m_pCameraMgr->GetActiveCamera());
//Render line grid objects
...
...
for (int i=0;i<static_cast<int>(vLineGrids.size());i++)
{
vLineGrids[i]->Render();
}
...
...
}