Skip to main content
GameDev.net gamedev.net
🔒 Locked

Z axis rendering issue.

Started by -=Code=- Dec 24, 2001 at 4:31 AM 0 replies 200+ views
Original Post
-=Code=-
-=Code=-
Hey there, What could be some causes for any vertices with components in the z axis just not being drawn? triangle[i++].setVertices( 100, 0, 0); // x axis triangle[i++].setVertices(-100, 0, 0); triangle[i++].setVertices( 0, 100, 0); // y axis triangle[i++].setVertices( 0, -100, 0); triangle[i++].setVertices( 0, 0, 100); // z axis triangle[i++].setVertices( 0, 0, -100); For Lines List rendering. The z-axis is not drawn. Render states. g_pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE); g_pDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); g_pDevice->SetRenderState(D3DRS_LIGHTING, FALSE); Matrices as follows: D3DXMATRIX mat; D3DXMatrixPerspectiveFovLH(&mat, D3DX_PI/6, WINDOW_WIDTH/WINDOW_HEIGHT, 1.0, 100.0); g_pDevice->SetTransform(D3DTS_PROJECTION, &(D3DMATRIX)mat); D3DXMatrixIdentity(&mat); g_pDevice->SetTransform(D3DTS_WORLD, &(D3DMATRIX)mat); D3DXMatrixTranslation(&mat, 0.0f, 0.0f, 100.0); g_pDevice->SetTransform(D3DTS_VIEW, &(D3DMATRIX)mat); D3DXMatrixRotationZ(&mat, rot+=0.01f); g_pDevice->SetTransform(D3DTS_WORLD, &(D3DMATRIX)mat); Also I use two vertex buffers one for unprocessed and another for processed. The first two lines are drawn and rotate accordingly. Also for Lines List I have 3 in 3rd arguement. Anything wrong? Thanks for any help. Edited by - -=Code=- on December 24, 2001 5:36:39 AM Edited by - -=Code=- on December 24, 2001 5:37:03 AM
steg
steg
You could try setting your Z-clipping distance to more than 100 in D3DXMatrixPerspectiveFovLH ? Also, the view transformation normally takes three vectors up,lookat and right ?

Reg''ds,
Steve
If it isn't working, take a bath, have a think and try again...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.