Allah Is Here

Hi,

... ... ... I use the Visual C++ and DirectX 9.0 ... Have problems making the Rotations, Translations and Scaling Matrices to work on my VertexBuffer... The codes I use are below...

///////////////////////////////////////////////////////////////////////////////////////////////////////

D3DXMatrixRotationZ(&RotationMatrix1, 2.0f);

D3DXMatrixRotationZ(&RotationMatrix2, 1.5f);

D3DXMatrixTranslation(&TranslationMatrix, 3.0f, 0.0f, 0.0f);

D3DXMatrixScaling(&ScalingMatrix, 1.0f, 0.5f, 1.0f);

////////////////////////////////////////////////////////////////////////////////////////////////////////

m_pD3DDevice->SetViewport(&m_RViewport);

m_WorldMatrix = TranslationMatrix * RotationMatrix1 * ScalingMatrix;

m_pD3DDevice->SetTransform(D3DTS_WORLD, &m_WorldMatrix);

m_pD3DDevice->SetVertexShader(D3DFVF_SIMPLEVERTEX);

m_pD3DDevice->SetStreamSource(0, m_pVertexBuffer, sizeof(SIMPLE_VERTEX));

m_pD3DDevice->DrawPrimitive(D3DPT_POINTLIST, 0, NUM_VERTICES);

////////////////////////////////////////////////////////////////////////////////////////////////////////

_________Is it that when get to the m_pD3DDevice->SetTransform(), this command is supposed to Transform the VertexBuffer Vertices... Or do I need another kind of command to work and address and make the m_WorldMatrix Transform the Vertices in the VertexBuffer m_pVertexBuffer... What Do I Need to do Precisely... Anybody help soon...



Re: Game Technologies: Graphics Problems Using Rotations and Translations and Scaling Matrices... Anybody HELP...?

shade

Hint : Why are you both specificing a vertex shader and using fixed function transformations

->SetVertexShader(...) and ->SetTransform(D3DTS_WORLD, ...)






Re: Game Technologies: Graphics Problems Using Rotations and Translations and Scaling Matrices... Anybody HELP...?

Allah Is Here

Hi,

... ... ... I don't even know why the book I read mention to Set the Vertex Shader and SetTransform and so on... The book doesn't explain Why Vertex Shader and SetTransform or what... Can you EXPLAIN to me what's wrong with using VertexShader with SetTransform... Do these don't work well together... Is the VertexShader Not supposed to be used with SetTransform...

_________ I just need to know how to make the Matrices work with the VertexBuffer and Transform the Vertices... How do I do that precisely... So, first, the codes below...

D3DXMatrixRotationZ(&RotationMatrix1, 2.0f);

D3DXMatrixRotationZ(&RotationMatrix2, 1.5f);

D3DXMatrixTranslation(&TranslationMatrix, 3.0f, 0.0f, 0.0f);

D3DXMatrixScaling(&ScalingMatrix, 1.0f, 0.5f, 1.0f);

m_WorldMatrix =TranslationMatrix * RotationMatrix1 * ScalingMatrix;

_________Now, what to make the Matrices to Transform the Vertices of the m_pVertexBuffer...