define_window_layout_xml { } Root { inputs 0 name stereographic.nk frame 68 last_frame 3599 lock_range true format "1024 1024 0 0 1024 1024 1 square_1K" proxy_type scale proxy_format "640 480 0 0 640 480 1 PC_Video" } StickyNote { inputs 0 name StickyNote1 label http://mathworld.wolfram.com/StereographicProjection.html xpos -421 ypos -260 } Camera { inputs 0 translate {-1 0 0} projection_mode spherical focal 5.5832 winroll 12.1105 name Camera1 xpos 491 ypos 68 } Light { inputs 0 intensity 200 falloff true translate {-0.04 2.77 -0.896} name Light1 xpos 702 ypos -11 } push 0 Axis { inputs 0 translate {5 0 0} rotate {50 22 11} scaling {1 1 3} name Axis1 xpos 692 ypos -132 } CheckerBoard2 { inputs 0 format "512 512 0 0 512 512 1 square_512" name CheckerBoard2 xpos 582 ypos -311 } Cube { cube {-10 -10 -10 10 10 10} name Cube1 xpos 582 ypos -212 } Normals { invert true name Normals1 xpos 582 ypos -156 } TransformGeo { inputs 2 name TransformGeo1 xpos 582 ypos -114 } Scene { inputs 3 name Scene1 xpos 592 ypos -11 } Constant { inputs 0 channels rgb format "1024 1024 0 0 1024 1024 1 square_1K" name Constant2 xpos 707 ypos 63 } ScanlineRender { inputs 3 transparency false max_tessellation 1 output_motion_vectors false name ScanlineRender1 xpos 582 ypos 86 cached true } CheckerBoard2 { inputs 0 format "1024 1024 0 0 1024 1024 1 square_1K" name CheckerBoard1 xpos 265 ypos -318 } Transform { scale 0.98 center {512 512} name Transform1 xpos 265 ypos -242 } Constant { inputs 0 channels rgb color {1 0 0 0} format "1024 1024 0 0 1024 1024 1 square_1K" name Constant1 xpos 375 ypos -236 } Merge2 { inputs 2 name Merge1 xpos 265 ypos -213 } BlackOutside { name BlackOutside1 xpos 265 ypos -184 } Read { inputs 0 file doritos/%08d.jpg format "2048 842 0 0 2048 842 1 " first 2100 last 3599 name doritos xpos 91 ypos -320 } Reformat { format "2048 2048 0 0 2048 2048 1 square_2K" box_width 512 box_height 512 box_fixed true resize distort name Reformat2 xpos 91 ypos -244 } Read { inputs 0 file haus.jpg format "3000 1500 0 0 3000 1500 1 " name haus xpos -71 ypos -319 } Reformat { format "2048 2048 0 0 2048 2048 1 square_2K" box_width 512 box_height 512 box_fixed true resize distort name Reformat1 xpos -71 ypos -243 } Switch { inputs 4 which 3 name Switch1 xpos 187 ypos 273 } Expression { temp_name0 p temp_expr0 sqrt((x/width-xo)*(x/width-xo)+(y/height-yo)*(y/height-yo)) temp_name1 c temp_expr1 "2*atan2(p, 2*arr)" temp_name2 lat temp_expr2 "asin(cos(c)*sin(lat1) + (((y/height-yo)*sin(c)*cos(lat1)) / p))" temp_name3 long temp_expr3 "(long0 + atan((x/width-xo)*sin(c), p*cos(lat1)*cos(c) - (y/height-yo)*sin(lat1)*sin(c)))" expr0 "r(((long-longo)*longm*width)%width < 0 ? width + ((long-longo)*longm*width)%width : ((long-longo)*longm*width)%width, (lat-lato)*latm*height)" expr1 "g(((long-longo)*longm*width)%width < 0 ? width + ((long-longo)*longm*width)%width : ((long-longo)*longm*width)%width, (lat-lato)*latm*height)" expr2 "b(((long-longo)*longm*width)%width < 0 ? width + ((long-longo)*longm*width)%width : ((long-longo)*longm*width)%width, (lat-lato)*latm*height)" name Stereographic xpos 187 ypos 334 addUserKnob {20 Stereographic} addUserKnob {7 arr t "Radius of the sphere projected from" R 0 0.5} arr 0.0918854 addUserKnob {7 lat1 t "Latitude offset - repeats outside the range 0 to 2*pi" R -5 5} lat1 -0.706667 addUserKnob {7 long0 t "Longitude offset - repeats outside the range 0 to 2*pi" R -5 5} long0 0.253333 addUserKnob {7 xo t "x offset of result" R -1 1} xo 0.5 addUserKnob {7 yo t "y offset of result" R -1 1} yo 0.5 addUserKnob {26 "" l "" T "This takes a latlong 360x180 panorama as input and reprojects it as a stereographic panorama.\nYou can use the SphericalTransform node to convert other kinds of pano to latlong,\nalso known as equirectangular or confusingly as \"spherical\" in Nuke's Camera node.\n\nTo understand how this projection works, imagine the input pano printed on acetate and\nwrapped around a sphere. This sphere then sits on a table. A light is sat just inside the\nsphere, at the top, pointing downwards and projecting the image onto the table. The table is\nthe output image. Every spot on the sphere will be projected onto a different part of the table\nexcept the point at the very top, just next to the light, which is never seen.\n\nYou don't want to touch the knobs below unless you want a messy partial image :)\n\nlewis@lewissaaunders.com"} addUserKnob {7 longo R -4 4} longo {{-pi i}} addUserKnob {7 lato R -4 4} lato {{-pi/2 i}} addUserKnob {7 longm R -4 4} longm {{1/(2*pi) i}} addUserKnob {7 latm R -4 4} latm {{1/pi i}} } Viewer { frame 68 fps 15 name Viewer1 xpos 314 ypos 398 } StickyNote { inputs 0 name StickyNote2 label "you can grab the interactive\n360 degree doritos/professor\ngreen video as a 2k latlong map\nfrom here:\nhttp://doritos.yb.nl/media/Doritos_final_HQ_VBR.f4v" xpos 8 ypos -468 }