trace("DEFAULTS"); set(sceneLoaded, 0); def(imageType, string, "horizontal"); def(kenBurnsOn, boolean, true); if(device.desktop, set(kenBurnsOn, true); ); def(startFov, number, 0.52); def(endFov, number, 0.56); def(startVLookAt, number, -0.01); def(endVLookAt, number, 0); def(startHLookAt, number, 0.028); def(endHLookAt, number, 0); def(imageWidth, number, 5387); def(imageHeight, number, 3591); calc(horizontalMovement, startHLookAt - endHLookAt); calc(verticalMovement, startVLookAt - endVLookAt); calc(totalTime, 6 * 1000); def(loadTime, number, timertick); set(calcPauseTime,0); def(lastHLookAt, number, 0); def(lastVLookAt, number, 0); def(lastFov, number, startFov); def(startTime, number, 0); def(passedTime, number, 0); def(remainingTime, number, get(totalTime)); if((horizontalMovement === verticalMovement AND startFov === 0.56 AND endFov === 0.56), setupNothing(); , setupKenburns(); ) set(sceneLoaded, 1); trace("ADJUSTMENTS"); calc(viewRatio, stagewidth / stageheight); calc(imgRatio, imageWidth / imageHeight); calc(widthRatio, stagewidth / imageWidth); calc(heightRatio, stageheight / imageHeight); if(imgRatio LT 1, calc(startFov, startFov / 0.56); calc(endFov, endFov / 0.56); set(tempFov, startFov); remapfovtype(tempFov, VFOV, HFOV, stagewidth, stageheight); set(tempFov2, startFov); remapfovtype(tempFov2, VFOV, HFOV, imageWidth, imageHeight); calc(tempFov, tempFov / tempFov2); calc(halfFOV, tempFov / 2); roundval(halfFov, 4); set(tempFov, endFov); remapfovtype(tempFov, VFOV, HFOV, stagewidth, stageheight); set(tempFov2, endFov); remapfovtype(tempFov2, VFOV, HFOV, imageWidth, imageHeight); calc(tempFov, tempFov / tempFov2); calc(halfFOV2, tempFov / 2); roundval(halfFov2, 4); , calc(startFov, startFov / 0.56); calc(endFov, endFov / 0.56); set(tempFov, startFov); remapfovtype(tempFov, VFOV, HFOV, stagewidth, stageheight); set(tempFov2, startFov); remapfovtype(tempFov2, VFOV, HFOV, imageWidth, imageHeight); calc(tempFov, tempFov / tempFov2); calc(halfFOV, tempFov / 2); roundval(halfFov, 4); set(tempFov, endFov); remapfovtype(tempFov, VFOV, HFOV, stagewidth, stageheight); set(tempFov2, endFov); remapfovtype(tempFov2, VFOV, HFOV, imageWidth, imageHeight); calc(tempFov, tempFov / tempFov2); calc(halfFOV2, tempFov / 2); roundval(halfFov2, 4); ); if(imgRatio LT 1, if(startVLookAt GT 0, calc(tempV, startVLookAt + halfFov); , calc(tempV, startVLookAt - halfFov); ); if(endVLookAt GT 0, calc(tempV, endVLookAt + halfFov2); , calc(tempV, endVLookAt - halfFov2); ); , if(startHLookAt GT 0, calc(tempH, startHLookAt + halfFov); if(tempH GT 0.5, calc(startHLookAt, 0.5 - halfFov); ); , calc(tempH, startHLookAt - halfFov); if(tempH LT -0.5, calc(startHLookAt, -0.5 + halfFov); ); ); if(endHLookAt GT 0, calc(tempH, endHLookAt + halfFov2); if(tempH GT 0.5, calc(endHLookAt, 0.5 - halfFov2); ); , calc(tempH, endHLookAt - halfFov2); if(tempH LT -0.5, calc(endHLookAt, -0.5 + halfFov2); ); ); ); trace("PLAY SCENE"); if(kenBurnsOn === false OR (horizontalMovement === verticalMovement AND startFov === 0.56 AND endFov === 0.56), doNothing(); , doKenburns(); ); trace("setup nothing"); if(imageType === "vertical", calc(HxWRatio, get(imageHeight) / get(imageWidth)); calc(HxWRatio2, get(imageWidth) / get(imageHeight)); roundval(HxWRatio,3); roundval(HxWRatio2,3); set(view.fovtype, "VFOV"); set(image.vfov, 1); set(image.hfov,get(HxWRatio)); set(view.fovmin, 0.1); set(view.fovmax, 2); calc(test, startFov / HxWRatio2); set(view.fov, get(test)); ,	set(view.fovtype, "HFOV"); set(view.fov, 1); set(view.limitview, "fullrange"); ) trace("do nothing"); calc(duration, remainingTime / 1000); roundval(duration,3); delayedcall(disdelayoff, get(duration), onfinish()); trace("setup kenburns"); calcImageAdjustments(); set(lastHLookAt, startHLookAt); set(lastVLookAt, startVLookAt); set(lastFov, get(startFov)); set(view.hlookat, get(startHLookAt)); set(view.vlookat, get(startVLookAt)); set(view.fov, get(startFov)); set(view.fovmin, 0); if(imageWidth LT imageHeight, set(view.limitview, "offrange"); set(view.hlookatmin, -1.5); set(view.hlookatmax, 1.5); set(view.vlookatmin, -0.5); set(view.vlookatmax, 0.5); set(view.fovtype, "VFOV"); set(image.type, "CYLINDER"); set(image.vfov, 1); calc(HxWRatio, imageWidth / imageHeight); roundval(HxWRatio,3); set(view.fovmin, 0.1); set(view.fovmax, 2); set(image.hfov, get(HxWRatio)); calc(test, startFov / HxWRatio); set(view.fov, get(test)); , set(view.limitview, "fullrange"); set(view.fovmax, 1); ); trace("do kenburns"); calc(duration, remainingTime / 1000); roundval(duration,3); trace(view.vfov, "|", view.hfov, "|", view.hlookat, "|", view.vlookat, "|", view.vlookat, "|", view.vlookat, "| duration ", duration); lookto(get(endHLookAt), get(endVLookAt), get(endFov), tween(linear, get(duration)), true, true, onfinish());