Software-OK
≡... News | ... Home | ... FAQ | Impressum | Contact | Listed at | Thank you |

  
HOME ► Windows Tip - OpenGL ► «««« 04 / 18 »»»»

OpenGL or DirectX - remove projection distortion!


Whether in OpenGL, DirectX, or other 3D solutions, projection distortion is an annoying and unsightly behavior when calculating and projecting onto the screen!





1.) ... The problem of distortion when projecting 3D objects!
2.) ... Behavior when removing projection distortion!




1.) The problem of distortion when projecting 3D objects!

Using the image below as a reference, increasing the width creates a horizontal stretch. It seems very plausible that the Fov-Y angle must increase to cause a vertical stretch that fixes the proportionality of the bordered image.

Here, you can clearly see how the spheres in the upper left corner are distorted. Even though this is mathematically correct, it's quite unsightly and distorts the 3D experience!

( ...see Image 1 ) 


GLfloat fFovy = 60.0f; // Field-of-view
GLfloat fZNear = 0.5f; // Near clipping plane
GLfloat fZFar = 10000.0f; // Far clipping plane

// Calculate viewport aspect
RECT rv;
GetClientRect(m_pMainWnd->m_hWnd, &rv);
fAspect = (GLfloat)(rv.right-rv.left) / (GLfloat)(rv.bottom-rv.top);

// Define viewport
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

gluPerspective(fFovy, fAspect, fZNear, fZFar);
glMatrixMode(GL_MODELVIEW);



(Image-1) The projection distortion in the display!
The projection distortion in the display!


-
▲ Back to the top ▲


2.) Behavior when removing projection distortion!


As mentioned, the field of view parameter is very important!

If you imagine your window as a physical window to the world you're viewing, and your eye as the observation point, you can imagine a pyramid. For a small window, and if you're far enough away from the monitor, the pyramid becomes very pointed: the field of view is therefore small. I'd say you probably drew with a field of view of 90-120 degrees or more, when you were actually viewing it at around 25-45 degrees (since your window isn't full screen, but rather small).

This introduces significant distortion, which is necessary to look correct when you really view your window up close.

Your perspective might simply be too strong. Try reducing the field of view angle.
In most cases, you don't know where your viewer is in relation to your image, so you have to guess. This makes choosing the field of view an aesthetic matter.

Even without projection distortion, the 3D representation will appear wrong, or even more wrong!

( ... see picture 2 ) 


(Image-2) Without projection distortion in the display!
No projection distortion in the display!


-
▲ Back to the top ▲


Updated on: 12 April 2025 20:37 Windows
Keywords: opengl, directx, remove, projection, distortion, whether, other, solutions, annoying, unsightly, behavior, when, calculating, projecting, onto, screen


Similar information on the page

Windows

... Wi-Fi and Wireless display on Windows 11?


The wireless display function under Windows 11 is very convenient and easy to make a presentation on the big TV screen in the living room or in the office
Windows

... Easy Share the folder with everyone on Windows 11?


The easy file sharing in Windows 11 can be deactivated and activated quite easily via the corresponding folder or drive options Content: 1. Share Folder,
Windows

... Clean up TEMP quickly on Windows 11


Its easy to quickly clean up temporary files and temporary folders on Windows 11 or with one button klick 1. Deleting the temporary files via the
Windows

... Multiple windows with multiple monitors behave on Windows 11


The new function to easily influence the behavior of the window with multiple monitors on Windows 11 is practical and can also be adapted Everyone probably
Windows

... Is the new Windows 11 really installed?


It is quite easy to see whether the new Windows 11 has really been installed on your computer Content: 1. Is the new Windows 11 installed? 2.
Windows

... Difference between screen keyboard and touch keyboard, Windows 11, 10, ...?


The difference between screen keyboard and touch keyboard under Windows 11, 10, The ►  classic on-screen keyboard and the touchscreen keyboard  are
Windows

... Uninstall applications on Windows 11


Nothing is easier than uninstalling applications under Windows 11 to free up a little space on your PC 1. Uninstall Windows applications quickly



▲ Back to the top ▲



... OpenGL Tip



3D.Benchmark.OK # AlwaysMouseWheel # AutoHideDesktopIcons # AutoPowerOptionsOK # ClassicDesktopClock # DesktopDigitalClock # DesktopNoteOK # DesktopOK # DontSleep # Edge-Chromium # ExperienceIndexOK # Find.Same.Images.OK # FontViewOK # GetPixelColor # GetWindowText # Internet # IsMyHdOK # KeepMouseSpeedOK # NewFileTime # OpenCloseDriveEject # OpenGL # PhotoResizerOK # Q-Dir # QuickMemoryTestOK # QuickTextPaste # Registry # ShortDoorNote # StressMyPC # System # TheAeroClock # Tools # Version # WinScan2PDF #




  

  + Freeware
  + Order on the PC
  + File management
  + Automation
  + Office Tools
  + PC testing tools
  + Decoration and fun
  + Desktop-Clocks
  + Security

  + SoftwareOK Pages
  + Micro Staff
  + Freeware-1
  + Freeware-2
  + Freeware-3
  + FAQ
  + Downloads

  + Top
  + Desktop-OK
  + The Quad Explorer
  + Don't Sleep
  + Win-Scan-2-PDF
  + Quick-Text-Past
  + Print Folder Tree
  + Find Same Images
  + Experience-Index-OK
  + Font-View-OK


  + Freeware
  + Office.Files.Images
  + Film.Strip.Explorer
  + WinScan2PDF
  + DontSleep
  + ExperienceIndexOK
  + QuickTextPaste
  + DesktopNoteOK
  + ShortDoorNote
  + AutoHideDesktopIcons
  + PAD-s


Home | Thanks | Contact | Link me | FAQ | Settings | Windows 10 | gc24b | English-AV | Impressum | Translate | PayPal | PAD-s

 © 2025 by Nenad Hrg ERR2: softwareok.de • softwareok.com • softwareok.com • softwareok.eu
87.244 msec.


>> ☕ Buy SoftwareOK a Coffee ☕ <<



► I would like to change the Explorer colors to the "old Norton Commander"! ◄
► The MiniBrowserOK! ◄
► Drag your favorite site to the bookmark bar? ◄
► Desktop Analog APP not from MS Windows 11, 10 Store for Free! ◄


This website does not store personal data. However, third-party providers are used to display ads,
which are managed by Google and comply with the IAB Transparency and Consent Framework (IAB-TCF).
The CMP ID is 300 and can be individually customized at the bottom of the page.
more Infos & Privacy Policy

....