选择部分热点不在VR模式中显示
2017-03-22 18:00
281 查看
截至krpano 1.19 pr5,在VR中支持的热点只有distorted为true的图像热点,这些图像热点可能是链接到其它场景,或者是弹出图片,如果是后者的话,在VR中是有问题的,我们希望在VR下,这些用途为弹出图片的热点不要显示,只在正常模式下显示。
我们有下面两种用途的热点:
<hotspot name="spot2" style="skin_hotspotstyle" ath="42.657" atv="24.198" linkedscene="scene_02mt" />
<hotspot name="spot3" style="hotspotstyle|normalhs" ath="22.657" atv="14.198" onclick="openpic()" />
spot2是用于链接到其它scene里的,而spot3是弹出图片的。我们给spot3加了一个style为normalhs,如下。在这个例子中,所有不想在VR中显示的但distorted为true的图像热点,我们都加上这个设置:
<style name="normalhs" normal="false" onloaded="if(webvr.isenabled,set(visible,false),set(visible,true));" />
注意,如果所加的热点本身有onloaded。例如,
<hotspot name="spot3" style="hotspotstyle" ath="22.657" atv="14.198" onclick="openpic()" onloaded="otheraction();" />
这样的话,需要把normalhs单独写出来。写成
<hotspot name="spot3" style="hotspotstyle" ath="22.657" atv="14.198" onclick="openpic()" normal="false" onloaded="if(webvr.isenabled,set(visible,false),set(visible,true));otheraction();" />
然后tour.xml加入下面代码,在scene外,上面style元素也一样是放在scene外面。
<action name="normalhs_enterVR">
for(set(i,0), i LT hotspot.count, inc(i),
if(hotspot[get(i)].normal == false ,
set(hotspot[get(i)].visible, false);
);
);
</action>
<action name="normalhs_exitVR">
for(set(i,0), i LT hotspot.count, inc(i),
if(hotspot[get(i)].normal == false ,
set(hotspot[get(i)].visible, true);
);
);
</action>
这两段action就是控制进入VR和退出VR是控制那些含有normal属性且数值为false的热点的显示和隐藏。我们在代码中使用了循环,然后对属性进行了判断,然后设置其visible。
另外在tour.xml加入下面代码(一定要在第三行include代码的后面写,这样才能覆盖掉vtourskin里面的webvr插件设定),将normalhs_enterVR和normalhs_exitVR的调用分别加入到onentervr和onexitvr两个事件当中。
<plugin name="WebVR" keep="true" devices="html5"
pluginurl="%SWFPATH%/plugins/webvr.js"
url=""
multireslock.desktop="true"
multireslock.mobile.or.tablet="false"
mobilevr_support="true"
mobilevr_fake_support="true"
onavailable="removelayer(webvr_enterbutton); skin_arrange_buttons(); webvr_onavailable();"
onentervr="normalhs_enterVR();skin_showloading(false); webvr_onentervr(); webvr_setup(); skin_reloadscene_webvr();"
onexitvr="webvr_onexitvr(); webvr_setup(); skin_reloadscene_webvr();normalhs_exitVR();"
/>
参考:sparselight.cn
我们有下面两种用途的热点:
<hotspot name="spot2" style="skin_hotspotstyle" ath="42.657" atv="24.198" linkedscene="scene_02mt" />
<hotspot name="spot3" style="hotspotstyle|normalhs" ath="22.657" atv="14.198" onclick="openpic()" />
1 2 3 | <hotspotname="spot2"style="skin_hotspotstyle"ath="42.657"atv="24.198"linkedscene="scene_02mt"/> <hotspotname="spot3"style="hotspotstyle|normalhs" ath="22.657"atv="14.198"onclick="openpic()"/> |
<style name="normalhs" normal="false" onloaded="if(webvr.isenabled,set(visible,false),set(visible,true));" />
1 | <style name="normalhs"normal="false"onloaded="if(webvr.isenabled,set(visible,false),set(visible,true));" /> |
<hotspot name="spot3" style="hotspotstyle" ath="22.657" atv="14.198" onclick="openpic()" onloaded="otheraction();" />
1 | <hotspotname="spot3"style="hotspotstyle" ath="22.657"atv="14.198"onclick="openpic()"onloaded="otheraction();"/> |
<hotspot name="spot3" style="hotspotstyle" ath="22.657" atv="14.198" onclick="openpic()" normal="false" onloaded="if(webvr.isenabled,set(visible,false),set(visible,true));otheraction();" />
1 | <hotspotname="spot3"style="hotspotstyle" ath="22.657"atv="14.198"onclick="openpic()"normal="false"onloaded="if(webvr.isenabled,set(visible,false),set(visible,true));otheraction();" /> |
<action name="normalhs_enterVR">
for(set(i,0), i LT hotspot.count, inc(i),
if(hotspot[get(i)].normal == false ,
set(hotspot[get(i)].visible, false);
);
);
</action>
<action name="normalhs_exitVR">
for(set(i,0), i LT hotspot.count, inc(i),
if(hotspot[get(i)].normal == false ,
set(hotspot[get(i)].visible, true);
);
);
</action>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <action name="normalhs_enterVR"> for(set(i,0),i LThotspot.count,inc(i), if(hotspot[get(i)].normal== false, set(hotspot[get(i)].visible,false); ); ); </action> <action name="normalhs_exitVR"> for(set(i,0),i LThotspot.count,inc(i), if(hotspot[get(i)].normal== false, set(hotspot[get(i)].visible,true); ); ); </action> |
另外在tour.xml加入下面代码(一定要在第三行include代码的后面写,这样才能覆盖掉vtourskin里面的webvr插件设定),将normalhs_enterVR和normalhs_exitVR的调用分别加入到onentervr和onexitvr两个事件当中。
<plugin name="WebVR" keep="true" devices="html5"
pluginurl="%SWFPATH%/plugins/webvr.js"
url=""
multireslock.desktop="true"
multireslock.mobile.or.tablet="false"
mobilevr_support="true"
mobilevr_fake_support="true"
onavailable="removelayer(webvr_enterbutton); skin_arrange_buttons(); webvr_onavailable();"
onentervr="normalhs_enterVR();skin_showloading(false); webvr_onentervr(); webvr_setup(); skin_reloadscene_webvr();"
onexitvr="webvr_onexitvr(); webvr_setup(); skin_reloadscene_webvr();normalhs_exitVR();"
/>
1 2 3 4 5 6 7 8 9 10 11 | <pluginname="WebVR"keep="true"devices="html5" pluginurl="%SWFPATH%/plugins/webvr.js" url="" multireslock.desktop="true" multireslock.mobile.or.tablet="false" mobilevr_support="true" mobilevr_fake_support="true" onavailable="removelayer(webvr_enterbutton); skin_arrange_buttons(); webvr_onavailable();" onentervr="normalhs_enterVR();skin_showloading(false); webvr_onentervr(); webvr_setup(); skin_reloadscene_webvr();" onexitvr="webvr_onexitvr(); webvr_setup(); skin_reloadscene_webvr();normalhs_exitVR();" /> |
相关文章推荐
- 在3D世界中创建不同的相机模式——使用四叉树隐藏不在视野中的部分网格
- UBUNTU 11.10 开机不在显示UBUNTU内核选择菜单
- 弹出式日期选择组件日历显示VS2005重写部分
- C++ 部分文件不在编辑器中显示
- easyUI 中datagrid控件从后台获取数据生成列,想让其中部分属性数据不在表中显示
- discuz7.2 firefox下编辑器模式选择不显示
- 建站或者网站搬家换空间的时候,企业站长最关心的一个问题是该如何选择网站空间,而这一问题对于一些擅长的站长来说非常小意思,但对于部分企业站长来说是一个比较头疼的问题。根据不完整数据显示,很多企业站长因为
- (未解决)MDI程序开多个视图,用Tab页并排显示。Debug下完全成功显示,Release调试模式下成功显示,但是直接点Release下的exe,部分弹出视图为空
- UE4 怎样在VR模式下摄像机的正前方显示某个东西,譬如3DUI?
- 让IE依据HTML头标签选择显示模式
- UBUNTU 11.10 开机不在显示UBUNTU内核选择菜单
- IE7部分标签(span、input )设置text-indent:-9999px后不在相应位置显示
- 选择模式:xml通过同目录下的xsl显示数据
- 1怎样让输入的text文本填写的部分只添加数字、2怎样将输入的数字一次性全部删除 3怎样选择密码 让它不显示 4 怎样实现在没有return的情况下点击button的情况下就能够使键盘页面下落5 怎样实现点击指定的button来对使指定的text进行键盘弹出 6怎样改变button按钮的状态
- IE7 部分标签设置text-indent:-9999px后不在相应位置显示的处理
- IE内核浏览器的兼容模式下,部分Flash不能显示的问题
- 弹出式日期选择组件日历显示VS2005重写部分
- 打开印度日历,选择发送到MMS,其中Subject部分显示为乱码
- maya的面选择显示模式,中心点或整个面的设置方法
- 6.9 singleinstance启动模式 & app不在最近任务列表中显示