06-20-2016, 06:56 AM
|
#15
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Quote:
Originally Posted by plush2
So I think I've found a script to help with this at the Google mathmap project. Now, among other things I need to know what sort of transform I need to use to create the desired effect from this math.
I've tried with gfx_blit and I can get panning to work but that's all, no bending or windowing of the image. I know I'm way out of my depth with all this but I'm wanting to see it done.
Code:
//@param1:FoV 'view' 150 15 320 150 1
//@param2:eye 'eye' 1 0 1.5 0.5 0.01
//@param3:pan 'pan' 0 -180 180 0.5 1
//@param4:vsh 'shape' 0 -1 1 0 0.01
img1 = 0;
img2 = input_ismaster();
input_info(src,W,H);
pi = 3.14159265;
//angular scale factors
Sppr = W / (2*pi); //source pixels/radian
d = eye + 1;
wfov = pi * min( FoV, 160 * d ) / 180; //radians
Drpp = 2*d*tan(wfov/(2*d)) / W;
W > 0 ? (
gfx_a = W;
//destination coordinates in radians
xr = x * Drpp; yr = (y - Y * vsh) * Drpp;
//project from dest to source
azi = d * atan2( xr, d);
alt = atan2( yr * (eye + cos(azi)), d );
//source coordinates in pixels
sx = Sppr*azi; sy = Sppr*alt;
//pan & interpolate
sx = sx + W*pan/360;
gfx_blit(img1, paspect, sx|0, sy|0, W, H);
);
//if sx > X then sx = sx - W end;
//if sx < -X then sx = sx + W end;
//in(xy:[sx, sy])
The basic desire is to have Panini type viewer for equirectangular panoramic video.
|
Have a video to test with? I think you could use gfx_xformblit() or whatever it is called to undeform it...
|
|
|