Sie sind nicht angemeldet.

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

1

Donnerstag, 28. April 2022, 16:35

Zoom slider Flat panorama

Hi,
To update a zoom indicator for regular panoramas we can use this action :

Quellcode

1
2
3
4
5
6
<action name="updateslider">
  sub(val, view.fov, view.fovmin);
  sub(fovrange, view.fovmax, view.fovmin);
  div(val, fovrange);
  mul(plugin[slider_grip].y, val, plugin[slider_bg].pixelheight);
</action>


but when the pano is flat how to set the correct fovmax value as it changes according to the screen and image ratio when limitview is set to auto ?
thnx !

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

2

Donnerstag, 28. April 2022, 22:09

Hi jeromebg

In this example I have code bolow:

Quellcode

1
2
calc(val,1 - (view.fov - view.fovmin) / (view.fovmax - view.fovmin));
mul(plugin[slider_grip].x, val, plugin[slider_bg].pixelwidth);


Maybe this will help

Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

3

Freitag, 29. April 2022, 08:51

Thanx for your help Piotr !
Unfortunately this doesn't work for me, I feel stupid ;)

https://360images.fr/360/saint-cirq-lapopie/

4

Freitag, 29. April 2022, 09:20

<layer name="slider_bg" type="container" keep="true" maskchildren="true" align="righttop" bgroundedge="5" bgcolor="0xffffff" bgalpha="0.1" x="5" y="100" width="10" >
<layer name="slider_grip" type="container" align="top" edge="top" bgroundedge="5" bgcolor="0xffffff" bgalpha="0.4" keep="true" width="10" height="20"/>
</layer>



<events onviewchanged="updateslider();" />

<action name="updateslider">
calc(plugin[slider_bg].height, view.fovmax);

sub(val, view.fov, view.fovmin);
sub(fovrange, view.fovmax, view.fovmin);
div(val, fovrange);

calc(plugin[slider_grip].y, val * plugin[slider_bg].pixelheight - plugin[slider_grip].pixelheight );


if(plugin[slider_grip].y LT 0,
set(plugin[slider_grip].y,0);
);

trace(plugin[slider_grip].y);
</action>

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

5

Freitag, 29. April 2022, 09:26

Thanx panoyun, but what is the difference with the initial code in my initial post ?

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

6

Freitag, 29. April 2022, 10:51

Ok, in fact the trick was to set the fovmax according to the screen and image ratio...

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<events name="sliderevents" onviewchanged="updateslider();" onresize="set_fovmax()"/>

	<action name="set_fovmax">
		div(imageratio, image.hfov, image.vfov);
		div(screenratio, stagewidth, stageheight);
		if(imageratio LT screenratio,
			set(view.fovtype, HFOV);
			copy(view.fovmax, image.hfov);
		,
      		        set(view.fovtype, VFOV);
			copy(view.fovmax, image.vfov);
		);
	</action>

<action name="updateslider">
  sub(val, view.fov, view.fovmin);
  sub(fovrange, view.fovmax, view.fovmin);
  div(val, fovrange);
  mul(plugin[slider_grip].y, val, plugin[slider_bg].pixelheight);
</action>