krpano 教程 - loadscene looktohotspot lookto zoomto 跳转过渡场景介绍
loadscene 跳转热点 - 过渡效果 就是切换scene时 两个scene之间的过渡效果。
loadscene(name,null,第三参数,第四参数)
第一参数
name 名称可以是编号
第二参数
载入附带参数 如果没有则使用null 。可以通过 符号合并多个var1 val1的设置形
sphere image.jpg amp;view.fov 120 amp;view.fisheye 0.35
第三个参数:
无缝融合相似场景
onclick loadscene(scene2, null, KEEPVIEW|KEEPMOVING|NOPREVIEW, BLEND(1));
KEEPVIEW 是保持相同的视角 包括切换前的hlookat以及vlookat和fov blend(1)则保证了融合的速度有一秒的时间
载入时额外的标签 如果没有则使用null 。可以使用 | 字符整合多个标签。可用的标签 MERGE (推荐使用)将当前全景与新全景的所有设定相融。如果新全景中有plugins和hotspots与需要保留的重名 则新元素不会被载入。对于虚拟漫游推荐使用该设置。KEEPIMAGE – 保留当前图像 仅HTML5 KEEPVIEW – 保留当前view设置KEEPMOVING – 在混合过程保持运动 (仅HTML5)KEEPSCENES – 保留当前场景 (仅loadpano)KEEPDISPLAY – 保留当前display设置KEEPCONTROL – 保留当前control设置KEEPPLUGINS – 保留当前已经载入的pluginsKEEPHOTSPOTS – 保留当前已经载入的hotspotsNOPREVIEW – 忽略新xml的 preview 标签KEEPBASE – 预定义组合 KEEPDISPLAY | KEEPCONTROL | KEEPPLUGINS KEEPALL – 预定义组合 KEEPVIEW | KEEPDISPLAY | KEEPCONTROL | KEEPPLUGINS REMOVESCENES – 移除所有当前定义了的scene元素 (与 set(scene.count,0);作用一样 )IGNOREKEEP – 忽略keep设定 移除所有keep ”true”的元素IMAGEONLY – 只加载全景图像 以及预览图 仅HTML5 不能用于loadpanoscene
第四参数
混合淡入到下一个全景 – 转场动画。
可用的混合模式
NOBLEND 无混合 直接切换到下一个全景 默认 。
BLEND(time, tweentype) 混合 / 淡入淡出当前全景与下一个全景。time – 以秒为单位的混合时间 (默认 2.0)。
tweentype – 混合曲线/运行形态 混合动画的类型。(默认 easeInCubic) – 查看 tweentypes。
COLORBLEND(time, color, tweentype)混合至某种颜色 然后从该颜色转到下一个全景。
time – 以秒为单位的混合时间 (默认 2.0)。
color – 转场时两个全景之间的颜色 十六进制颜色值 (默认 0x000000 黑色)。
tweentype – 混合曲线/运行形态 混合动画的类型。(默认 easeInOutSine) – 查看 tweentypes。
LIGHTBLEND(time, color, colorscale, tweentype)添加或减去某种颜色 然后交叉淡化到下一个全景。
time – 以秒为单位的混合时间 (默认 2.0)。
color – 添加的颜色 十六进制颜色 (默认 0xFFFFFF 白色)。
colorscale – 颜色的比例系数 使用负数表示减去 (默认 2.0)。
tweentype – 混合曲线/运行形态 混合动画的类型。(默认 easeInCubic) – 查看 tweentypes。
SLIDEBLEND(time, angle, smooth, tweentype)在当前和下一个全景之间的幻灯片动画。
time – 以秒为单位的混合时间 (默认 2.0)。
angle – 幻灯片切换的角度 (默认 0.0)。
smooth – 转场线条的平滑/模糊程度 (0.0到 1.0, 默认 0.2)。
tweentype – 混合曲线/运行形态 混合动画的类型。(默认 linear) – 查看 tweentypes。
(仅WebGL)OPENBLEND(time, shape, smooth, zoom, tweentype)在当前和下一个全景之间的展开动画。
time – 以秒为单位的混合时间 (默认 2.0)。
shape – 定义展开形状 (-1.0 到 1.0) – 0.0 圆圈展开, -1.0 垂直展开, 1.0 水平展开 (默认 0.0)。
smooth – 转场线条的平滑/模糊程度 (0.0 到 1.0, 默认 0.2)。
zoom – 对旧全景的放大。 (0.0 到 1.0, 默认 0.0).。
tweentype – 混合曲线/运行形态 混合动画的类型。(默认 linear) – 查看 tweentypes。
(Flash或仅WebGL)
ZOOMBLEND(time, zoom, tweentype)放大到当前视域 交叉淡化到下一个全景。
time – 以秒为单位的混合时间 (默认 2.0)。
zoom – 缩放因子 (默认 2.0).
tweentype – 混合曲线/运行形态 混合动画的类型。(默认 easeInOutSine) – 查看 tweentypes。
自定义多效果选择
loadscene(scenename, null, MERGE, get(blendmodes[name].blend)); 自定义多效果选择 blendmodes name no blending description 无过渡效果 blend NOBLEND / blendmodes name simple crossblending description 简单淡入淡出 blend BLEND(1.0, easeInCubic) / blendmodes name zoom blend description 缩放过渡 blend ZOOMBLEND(2.0, 2.0, easeInOutSine) / blendmodes name black-out description 黑场过渡 blend COLORBLEND(2.0, 0x000000, easeOutSine) / blendmodes name white-flash description 白场过渡 blend LIGHTBLEND(1.0, 0xFFFFFF, 2.0, linear) / blendmodes name right-to-left description 从右至左 blend SLIDEBLEND(1.0, 0.0, 0.2, linear) / blendmodes name top-to-bottom description 从上至下 blend SLIDEBLEND(1.0, 90.0, 0.01, linear) / blendmodes name diagonal description 对角线 blend SLIDEBLEND(1.0, 135.0, 0.4, linear) / blendmodes name circle open description 圆形展开 blend OPENBLEND(1.0, 0.0, 0.2, 0.0, linear) / blendmodes name vertical open description 垂直展开 blend OPENBLEND(0.7, 1.0, 0.1, 0.0, linear) / blendmodes name horizontal open description 水平展开 blend OPENBLEND(1.0, -1.0, 0.3, 0.0, linear) / blendmodes name elliptic zoom description 椭圆缩放 blend OPENBLEND(1.0, -0.5, 0.3, 0.8, linear) /
looktohotspot 移动到热点
looktohotspot(name)
lookto 移动到热点
使用lookto动作可以设计自动漫游的路线。使用了oninterrupt 则用户可以中断lookto 以及执行oninterrupt中设定的动作。如果没有oninterrupt 则用户的交互操作无法中断lookto等动作 必须等到所有lookto这样的动作执行完 才能接着执行下面的动作或者用户可以进行交互。
lookto(0,1,60,smooth(5,5,5));
zoomto 移动到热点
moveto和zoomto是简化版的lookto 前者保持了在运动过程中fov不变 后者保持了在运动过程中hlookat和vlookat的不变。下面是一个zoomto的演示案例。
zoomto(70,smooth(15,15,15));





本文链接: http://lookscese.immuno-online.com/view-680495.html