Skip to main content
gamedev.net
🔒 Locked

Objects stretched at screen edges

Started by Derek Baker 4 replies 1.1k views
Original Post
Derek Baker
Derek Baker
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
wendigo23
wendigo23
Perspective projection stretches things. It's normal.
Derek Baker
Derek Baker
Thanks for the reply, but what I'm seeing here doesn't match what I see in any 3d game.


Derek
Helius
Helius
Try reducing your FOV.

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

Topic Locked

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

Sign in to reply to this topic.