::Doubt of Aspect Ratio::

vindos

Newcomer
hi guys
Am really confused about the significance of aspect ratio in the line

FLOAT fAspect = ((FLOAT)m_Desc.Width / m_Desc.Height);
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, fAspect, 0.0f, 100.0f );

I tried to create a rectangular Vertex Buffer of the screen size with X position varying from -1 to +1 and Y position varying from -1 to +1.

If my aspect ratio is set as 1 then my VB is full screen size, but if i have my original aspect ratio set ( fAspect = 1.62 ) then i need a value of - 1.4 to +1.4 in the x direction to get a full screen VB.While Yscale remains the same.
If i set an aspect ratio directx automatically multiplies each coordinate with a factor?????
 
To truly understand this you might want to get more familiar with graphics theory ;)

This isn't really anything special to Direct3D - it's a general property of some projection transforms. Have a read of what the documentation says. Google as well as any good graphics textbook will cover this thoery as well.

Specifying your vertices in projection space (-1..+1) to get a screen-aligned quad is often done with an identity projection matrix. Or just passed through by the VS unit.

hth
Jack
 
Back
Top