You are not logged in.

Dear visitor, welcome to 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.


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):


<!-- 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.


Friday, March 15th 2019, 2:11pm

the view settings are documented here:

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


Friday, March 15th 2019, 2:14pm

Thanks for reply, I will try this soon.


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).


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);

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?


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


Wednesday, February 5th 2020, 8:54pm

Hi folks,

I am the eternal newbie in the forum rs. I tried the code below ... *sad*
ah sorry, you probably cant set view.fov in webvr

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

I actually tested both codes and they didn't work on the webvr, the lookat works (although I'm still looking for a smoother solution like the lookto works in webvr ... if anyone knows any please let me know) *thumbsup* .
> set(plugin[webvr].mobilevr_lens_fov, xx);
> set(plugin[webvr].zoom, 1.5);

Follow my codes, if you can help me find the problem, it will be of great help! The camera's position changes but the zoom remains the same:

<hotspot name="goout" style="back" ath="-156" atv="-44"
set(plugin [webvr].mobilevr_lens_fov, 3);
lookat(-60, -39, 55);">

add_example_thumb('My btn', -76, -419, '%CURRENTXML%/../imgs/point.png', set(plugin [webvr].mobilevr_lens_fov, 3); lookat(-132, -30););
Many tnx! *thumbup*

Similar threads