linear transform in 2D screen space
I intend to do some linear transform in 2D window (screen) space in order to do on-the-fly h-/v-keystone correction. I have all the code ready to calculate the linear distortion matrix from four registered corner points of the projection image. At the moment I choose this approach:
Code:
current_pm = viz.MainWindow.getProjectionMatrix() My question: Is there a more elegant way in Vizard to implement this final viewport distortion as a 2D transform only rather than as a distortion of the 3D projection matrix? |
You can use a post-process shader to perform your keystone correction. A shader may be overkill for a simple linear transformation, but it allows for more flexibility for distortion correction. The vizlens module that comes with Vizard uses a post-process shader to perform the lens correction. Here is a simple example of a post-process shader:
Code:
import viz |
All times are GMT -7. The time now is 08:52 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC