psychopy.visual.windowwarp
- warping to spherical, cylindrical, or other projections¶Copyright (C) 2014 Allen Institute for Brain Science
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation on 29 June 2007. This program is distributed WITHOUT WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER WARRANTY, EXPRESSED OR IMPLIED. See the GNU General Public License Version 3 for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
Warper
¶Class to perform warps.
Supports spherical, cylindrical, warpfile, or None (disabled) warps
Warping is a final operation which can be optionally performed on each frame just before transmission to the display. It is useful for perspective correction when the eye to monitor distance is small (say, under 50 cm), or when projecting to domes or other non-planar surfaces.
These attributes define the projection and can be altered dynamically using the changeProjection() method.
win : Handle to the window.
This table gives the main properties of each projection
Warp |
eyepoint modifies warp |
verticals parallel |
horizontals parallel |
perspective correct |
---|---|---|---|---|
spherical |
y |
n |
n |
y |
cylindrical |
y |
y |
n |
n |
warpfile |
n |
? |
? |
? |
None |
n |
y |
y |
n |
compatible warp definition. (see http://paulbourke.net/dome/warpingfisheye/)
Defines the resolution of the warp in both X and Y when not using a warpfile. Typical values would be 64-300 trading off tolerance for jaggies for speed.
Position of the eye in X and Y as a fraction of the normalized screen width and height. [0,0] is the bottom left of the screen. [1,1] is the top right of the screen.
Flip the entire output horizontally. Useful for back projection scenarious.
Flip the entire output vertically. useful if projector is flipped upside down.
monitor definition.
‘warper.dist_cm’ and then calling changeProjection().
Example usage to create a spherical projection:
from psychopy.visual.windowwarp import Warper
win = Window(monitor='testMonitor', screen=1,
fullscr=True, useFBO = True)
warper = Warper(win,
warp='spherical',
warpfile = "",
warpGridsize = 128,
eyepoint = [0.5, 0.5],
flipHorizontal = False,
flipVertical = False)