You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, March 15th 2019, 12:41pm

WebVR floating/following hotspots to instantly change zoom level (FOV)

Hello everyone,

My first post on this forum, also pardon my english if any mistake, my native language is french.

I know krpano for some time now an I tried it for some experiments especially with stereoscopic panos in VR. It is very good and brings many great possibilities for virtual tours, but I never really began to use it extensivelly and my skills in coding (like in XML) are quite low. I plan to use it more now so I have to learn...

For now I have a specific question. In a tour with several stereoscopic panos, in WebVR mode I want to have a floating/following set of little hotspots that can trigger some different zoom levels (fiels of view), inside VR view, without changing any other parameter (like orientation). For example 3 hotspots for 3 zoom levels, one for wide angle view, one for normal view and one for zoomed view. I want those 3 hotspots following the view like the default floating arrows used to go to preview or next scene in WebVR (around 45° down).


So I think it is quite simple to achieve but I don't know how to code this. I replaced the code of the default floating arrows of WebVR (in vtourskin.xml file), but I don't know what to write to make it trigger an instant change in fiel of view value. Maybe we have to change some parameter in the webvr.xml file, from the vtourskin.xml file? I guess there is just something to write for "onclick=";"" in hotspot arguments.

This is the part of the vtourskin.xml file I replace to test this with floating hotspots (just 2 arrows for now):

Quoted

<!-- VR scene switching hotspots -->
<style name="skin_webvr_menu_style" depth="250" scale="0.1" distorted="true" ath="0" atv="45" alpha="0.25" />
<hotspot name="skin_webvr_prev_scene" keep="true" style="skin_base|skin_webvr_menu_style" crop="0|64|64|64" ox="-24" rotate="+90" vr_timeout="2000" onclick="skin_nextscene_loop(-1);" visible="false" devices="html5.and.webgl" />
<hotspot name="skin_webvr_next_scene" keep="true" style="skin_base|skin_webvr_menu_style" crop="64|64|64|64" ox="-12" rotate="+90" vr_timeout="2000" onclick="skin_nextscene_loop(+1);" visible="false" devices="html5.and.webgl" />

So I don't know with what to replace the code "skin_nextscene_loop(-1)", to set a new field of view instead.
Like I said my coding skills are still very low especially in XML, so if someone can explain me what to write and where, it would be really appreciated.
Regards,Hoel

2

Friday, March 15th 2019, 2:11pm

the view settings are documented here:
https://krpano.com/docu/xml/#view

to set the fov you would write for example
set(view.fov, 50);

3

Friday, March 15th 2019, 2:14pm

Thanks for reply, I will try this soon.

4

Friday, March 15th 2019, 2:22pm

I tried what you said but with no luck...
I put the code " onclick="set(view.fov, 120);" " in the hotspot parameters but nothing change after the cursor timeout (in VR mode).

5

Friday, March 15th 2019, 3:01pm

ah sorry, you probably cant set view.fov in webvr

maybe this works
set(plugin[webvr].zoom, 1.5);

https://krpano.com/plugins/webvr/#zoom

i've never done that, tough
and dont know if that is advised and if it works for all webvr modes

why do you want to change the fov in webvr?

6

Friday, March 15th 2019, 5:38pm

Yes I tried this instead and it works, Thank you!
It also works with set(plugin[webvr].mobilevr_lens_fov, xx);. I don't know if there are differences between changing fov and zoom values, I will look at it.
As for changing fov like that in WebVR, it is to give option to change it quickly without removing VR headset and without changing anything else. So it is possible in a given scene to look for a moment at some detail by zooming in like with binoculars, or instead to have some very large view like in a door peephole. Of course it will give unreal aspect to the scene but it is just for some short inspections. People are already used to see world through binoculars and peephole in real life so it will not be too problematic I think. For zooming it is necessary to have very high resolution panos, and the stereo effect is reduced a little but it is not disturbing.

I am still experimenting many aspects of stereoscopic 360 so with time I will see if these zooming options are of any interest globally, for VR virtual tours.

Thanks again for helping

Similar threads