Skip to main content
gamedev.net
🔒 Locked

Aspect ratio problem

Started by Sante05 0 replies 550+ views
Original Post
Sante05
Sante05
Hi. I''m starting with D3D and I''ve made an app that shows a textured square rotating around an edge. I''m running it in fullscreen, and the problem is that my square becomes a rectangle when rendered. It deformates, showing wider than it really is. I wonder if that''s because of the Aspect Ratio value in the D3DXMatrixPerspectiveFovLH call. I''ve tried with my screen width/screen height (800/600) and with 1.0f, but I don''t see any change. So, do anyone know how to make my square look like a square? Thank you.
-----DevZing Blog (in Spanish)
masonium
masonium
if you use 800/600, it should work. Just make sure you use 800.0f/600.0f instead of the width and height DWORDS that you most likely used when setting up the device. (800/600 == 1, 800.0f/600.0f == 1.333333f). I had the same problem, but I used width/height and my square became a square

No, HTML is not an OO language.

Topic Locked

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

Sign in to reply to this topic.