我是靠谱客的博主 超帅金针菇,最近开发中收集的这篇文章主要介绍krpano 修改右键菜单,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

krpano 修改右键菜单

首先找到你的tour.xml文件 把下面代码放到里面

<contextmenu fullscreen="true" versioninfo="true">
<item name="kr" caption="KRPANO"
/>
<item name="fs" caption="FULLSCREEN" />
<item name="cc" caption="更改控制模式" onclick="cm_changecontrolmode();"
separator="true" />
<item name="nv" caption="正常视角"
onclick="cm_normal_view();"
showif="view.vlookatrange == 180" separator="true"
/>
<item name="fv" caption="鱼眼视角"
onclick="cm_fisheye_view();"
showif="view.vlookatrange == 180" devices="flash|webgl" />
<item name="sv" caption="立体视角" onclick="cm_stereographic_view();" showif="view.vlookatrange == 180" devices="flash|webgl" />
<item name="av" caption="建筑视角" onclick="cm_architectural_view();" showif="view.vlookatrange == 180"
/>
<item name="pv" caption="帕尼尼视角"
onclick="cm_pannini_view();"
showif="view.vlookatrange == 180" devices="flash|webgl" />
<item name="lp" caption="小行星视角" onclick="cm_littleplanet_view();"
showif="view.vlookatrange == 180" devices="flash|webgl" />
</contextmenu>

放完后,点击右键就可以看到了,但是只完成了一半,现在开始添加视角

<action name="cm_changecontrolmode">
switch(control.mouse, moveto, drag);
switch(control.touch, moveto, drag);
</action>
<action name="cm_look_straight">
if(view.vlookat LT -80 OR view.vlookat GT +80,
tween(view.vlookat, 0.0, 1.0, easeInOutSine);
tween(view.fov,
100, distance(150,0.8));
);
</action>
<action name="cm_normal_view">
cm_look_straight();
tween(view.architectural, 0.0, distance(1.0,0.5));
tween(view.pannini,
0.0, distance(1.0,0.5));
tween(view.fisheye,
0.0, distance(1.0,0.5));
</action>
<action name="cm_architectural_view">
cm_look_straight();
tween(view.architectural, 1.0, distance(1.0,0.5));
tween(view.pannini,
0.0, distance(1.0,0.5));
tween(view.fisheye,
0.0, distance(1.0,0.5));
</action>
<action name="cm_fisheye_view">
cm_look_straight();
tween(view.architectural, 0.0,
distance(1.0,0.5));
tween(view.pannini,
0.0,
distance(1.0,0.5));
tween(view.fisheye,
0.35, distance(1.0,0.5));
</action>
<action name="cm_stereographic_view">
cm_look_straight();
tween(view.architectural, 0.0, distance(1.0,0.5));
tween(view.pannini,
0.0, distance(1.0,0.5));
tween(view.fisheye,
1.0, distance(1.0,0.8));
</action>
<action name="cm_pannini_view">
cm_look_straight();
tween(view.architectural, 0.0, distance(1.0,0.5));
tween(view.pannini,
1.0, distance(1.0,0.8));
if(view.fisheye LT 0.1,
tween(view.fisheye, 1.0, distance(1.0,0.8));
);
</action>
<action name="cm_littleplanet_view">
tween(view.architectural, 0.0, distance(1.0,0.5));
tween(view.pannini,
0.0, distance(1.0,0.5));
tween(view.fisheye,
1.0, distance(1.0,0.8));
tween(view.fov,
150, distance(150,0.8));
tween(view.vlookat,
90, distance(100,0.8));
add(new_hlookat, view.hlookat, 123.0);
tween(view.hlookat, get(new_hlookat), distance(100,0.8));
</action>

上面就是修改右键菜单的全部了。

注意:

  1. name属性是必须要有的,各个item的name不能一样。
  2. caption就是显示在右键菜单的文字。
  3. 这里有两个特殊的保留字,一个是KRPANO,这个是显示krpano的官方版权信息条目,如果你没有购买去右键版权的授权,即使你将这一行代码删除,这个显示krpano版权的条目也会显示在最后。
  4. 另外一个FULLSCREEN,如果你把它去掉了,它就不显示了,它是用来控制进入或退出全屏的。

最后

以上就是超帅金针菇为你收集整理的krpano 修改右键菜单的全部内容,希望文章能够帮你解决krpano 修改右键菜单所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(36)

评论列表共有 0 条评论

立即
投稿
返回
顶部