• Advertisement

Archived

This topic is now archived and is closed to further replies.

Viewing distance problem

This topic is 5218 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Please post some of your code... makes it easier for us to help you

Share this post


Link to post
Share on other sites
I use this code to change the view distance.


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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Here''s the code:

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?

Share this post


Link to post
Share on other sites
Not that stupid though. I looked for ''D3DTS_PROJECTION'' in other files, but I didn''t find anything so I started to look up the rendering function and found out that the skybox is always 50 units away from the camera, hiding things further away.

Share this post


Link to post
Share on other sites

  • Advertisement