Objects stretched at screen edges

Started by
4 comments, last by Derek Baker 19 years, 6 months ago
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
Advertisement
Perspective projection stretches things. It's normal.
Thanks for the reply, but what I'm seeing here doesn't match what I see in any 3d game.


Derek
Try reducing your FOV.

Notice that with a high FOV more (stretched) objects are seen in the scene.
A normal FOV is PI / 4. Like this:
D3DXMatrixPerspectiveFovLH(&Proj, D3DX_PI / 4.0f,(float)cxClient/ cyClient, 1.0f, 1000.0f);
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
Thanks guys.


Derek

This topic is closed to new replies.

Advertisement