Viewing distance problem
I''m trying to set the viewing distance further away, but no matter what I put in for the far viewing plane in the D3DXMatrixPerspectiveFovLH function it''s still around 60. I can decrease it but I cannot increase it. Anyone know why?
I use this code to change the view distance.
Check that you are putting the range in the correct parameter. If this still doesnt work then can you send info on how you are setting up the view projection, I have noticed some really weird effects looking backwars instead of forwards when using LookAt functions.
[edited by - MatthewEva on November 14, 2003 10:44:58 AM]
[edited by - MatthewEva on November 14, 2003 10:45:44 AM]
BOOL RenderRange(FLOAT fRange){// Initialise Projection Matrix D3DXMATRIX matProj; D3DXMatrixPerspectiveFovLH(&matProj, D3DX_PI/4, 1.0f,1.0f, fRange);// Attempt To Change Viewport Range HRESULT hr = pDevice->SetTransform( D3DTS_PROJECTION, &matProj); if (FAILED(hr)) return FALSE; return TRUE;}
Check that you are putting the range in the correct parameter. If this still doesnt work then can you send info on how you are setting up the view projection, I have noticed some really weird effects looking backwars instead of forwards when using LookAt functions.
[edited by - MatthewEva on November 14, 2003 10:44:58 AM]
[edited by - MatthewEva on November 14, 2003 10:45:44 AM]
This is unrelated to your problem, but why do you set 1.0f for the third parameter ? If your window is not square (windowed or fullscreen) it would be better to set it to (width/height), usually 1.25f or 1.333f.
Here''s the code:
I can''t see anything wrong with it, can you?
D3DXMATRIX matProj;D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 200.0f );g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
I can''t see anything wrong with it, can you?
It''s going to sound stupid, but...
Do a ''find in files'' for ''D3DTS_PROJECTION'' and make sure you''re not setting it anywhere else in your project that you forgot about.
Do a ''find in files'' for ''D3DTS_PROJECTION'' and make sure you''re not setting it anywhere else in your project that you forgot about.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement