Currently, I have using the following array of vertices to draw a triangle:
and I am also transforming the world matrix every time I render (in a loop) so the above triangle is rotated on X axis using the following code:PHP Code:
CUSTOMVERTEX g_vertices[] =
{
{ -1.0f, -1.0f, 0.0f, D3DCOLOR_XRGB(255,0,255), }, // x, y, z, color
{ 1.0f, -1.0f, 0.0f, D3DCOLOR_XRGB(0,255,0), },
{ 0.0f, 1.0f, 0.0f, D3DCOLOR_XRGB(0,0,255),},
Above code works fine but when I don't use the world transformation (I don't rotate any object means I don't use 2nd piece of code^^), the triangle won't show up. Why is it doing that?PHP Code://set the world matrics (rotate the object on Y)
D3DXMatrixRotationX(&mat, timeGetTime()/250.0f);
if(FAILED(lpD3DDev->SetTransform(D3DTS_WORLD, &mat)))
{
ShowError("Unable to set the world matrics");
return false;
}




Reply With Quote