WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 10-09-2009, 10:15 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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
import vizpp
viz.go()

KeystoneShader = """
uniform sampler2D vizpp_InputTex;
uniform float osg_FrameTime;
void main (void)
{
	float s = gl_TexCoord[0].s + (gl_TexCoord[0].t * sin(osg_FrameTime) * 0.3);
	float t = gl_TexCoord[0].t;
	gl_FragColor = texture2D( vizpp_InputTex, vec2(s,t) );
}
"""
vizpp.addEffect( vizpp.ShaderEffect(frag=KeystoneShader) )

viz.add('gallery.ive')
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
split screen honey006 Vizard 3 05-21-2009 09:57 AM
screen image erchrastil Vizard 8 06-27-2008 11:45 AM
position of html-file on screen active_world Vizard 1 05-16-2008 07:24 PM
Smooth transition from Linear to Bezier in animation masaki Vizard 2 01-13-2008 11:22 AM
Tracking a small space aaThomas Precision Position Tracker (PPT) 3 05-31-2007 10:59 AM


All times are GMT -7. The time now is 11:26 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC