Jump to content
  • Advertisement
Sign in to follow this  
Derek Baker

Objects stretched at screen edges

This topic is 5402 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

When I change the pitch and yaw of my camera, my object gets stretched as it approaches the edges of my window.
   	D3DXMATRIX T,YPR;;
	D3DXMatrixRotationYawPitchRoll(&YPR, Yaw, Pitch, Roll);
 	D3DXMatrixTranslation(&T, 0.0f, 0.0f, 0.0f);
	
 	D3DXMATRIX View = T* YPR;
 	
  	pD3DDevice->SetTransform(D3DTS_VIEW, &View);

D3DXMATRIX Proj;
 	
	D3DXMatrixPerspectiveFovLH(&Proj, D3DX_PI * 0.5f ,(float)cxClient/ cyClient, 
								1.0f, 1000.0f);
	
	pD3DDevice->SetTransform(D3DTS_PROJECTION, &Proj);

I'm sure it's something very obvious, but I've only been programming DX for a few days. Thanks in advance Derek

Share this post


Link to post
Share on other sites
Advertisement
Try reducing your FOV.

Notice that with a high FOV more (stretched) objects are seen in the scene.

Share this post


Link to post
Share on other sites
A normal FOV is PI / 4. Like this:
D3DXMatrixPerspectiveFovLH(&Proj, D3DX_PI / 4.0f,(float)cxClient/ cyClient, 1.0f, 1000.0f);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!