projection matrix

Started by
4 comments, last by lakibuk 22 years, 9 months ago
I don't know how to setup a correct projection matrix in directx7. I am using the helper function from the tutorials: float near=1.0f; float far=1000.0f; float viewport_width=800.0f; float viewport_height=600.0f; D3DUtil_SetProjectionMatrix(matProj, fFOV, fAspect, near, far); How do i calculate fFOV and fAspect ? My graphics looks distorted, this should be cubes: Edited by - lakibuk on June 26, 2001 2:32:12 PM
Karl - Blueskied Games | my german site: Gratis Spiele
Advertisement
The FOV will be how many degrees around you can see, humans see about 90, but you don't wan't to use that as your FOV in a game, probably around 60 will work.
The Aspect is your windows width/height. If you use standard screen resolutions as your window sizes (or if you use fullscreen), your aspect is about 1.33333333333333... and on and on, but you could get away with 1.33333f;

Edited by - Slinger on June 26, 2001 2:52:38 PM
could it be that aspect is height/width ?
Karl - Blueskied Games | my german site: Gratis Spiele
...and what''s wrong with using 90 for FOV?
Last I checked, that''s what Quake, and its precursors, and its sequels, all use...

If you''re only calling the function once to set up your matrix, you should probably feed it (window width / window height) rather than precalculate it, so you get the most precision the system supports. Incidentally, you HAVE to do this if you run in a window where the aspect ratio may not be fixed
--Tr][aD--
lakibuk> the aspect is the width/height.

TrIaD> a 90 degree FOV looks strange on a computer monitor, its all distorted, and can give some people motion sickness. I''m almost positive that Quake uses a 60 FOV.
quote:
humans see about 90, but you don''t wan''t to use that as your FOV in a game, probably around 60 will work.


"Normal" people have a FOV of more than 180 degrees.

quote:
...and what''s wrong with using 90 for FOV?
Last I checked, that''s what Quake, and its precursors, and its sequels, all use...


There''s nothing *wrong* with 90 degree FOVs. There''s nothing *wrong* with cubism either. It just doesn''t look right.

You can use any FOV that you like for your game. But to make the graphics look right the FOV must depend on the size of the monitor and the distance to the monitor:



In this case the FOV should be set to 80 degrees.

Note that in real life you shouldn''t sit that close to your monitor

This topic is closed to new replies.

Advertisement