You are not logged in.

1

Monday, January 4th 2016, 7:09pm

Integrate the slider effect in a multi-scene VT -> problem

Hi, I spent my weekend to learn how to make the slider effect and it was successful.
I made my own on a simple scene , and it works like in the example.

However, I try now to integrate it in a virtualtour that has multiresolution and several scenes.
My new scene appears normally in the thumb bar, I can access it from a hotspot, and I can access another scene from a hotspot put in my new scene. The slide bar is loaded normally and moves, but there is a loading problem for the scene. Only the preview is loaded and nothing happens with the slide bar.




I put the same code as the working example in <scene> <\scene> and changed the folders URL

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
	<scene name="scene_kitchen" title="kitchen" onstart="" thumburl="panos/kitchen.tiles/thumb.jpg" lat="" lng="" heading="">
		<view hlookat="0" vlookat="0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="range" vlookatmin="-82.465" vlookatmax="82.465" />
		<preview url="panos/kitchen.tiles/preview.jpg" />				<image type="CUBE" multires="false" tilesize="2048">			</image>


	<plugin name="slider_bg" url="skin/slider_background.png" align="bottom" x="0" y="200" handcursor="false" zorder="1" />		<plugin name="slider_grip" url="skin/slider_grip.png" align="left" edge="center" parent="slider_bg" x="0" zorder="2" 			dragging="if(pressed, 						sub(dx, mouse.stagex, drag_stagex); 						add(newx, drag_currentx, dx); 						if(newx LT 0, set(newx,0));						if(newx GT plugin[slider_bg].pixelwidth, copy(newx,plugin[slider_bg].pixelwidth));						copy(x,newx);						div(val, newx, plugin[slider_bg].pixelwidth);						setblend(get(val));						delayedcall(0,dragging());					  );"			ondown="copy(drag_currentx,x); copy(drag_stagex,mouse.stagex); dragging();"			/>

	<action name="addface">		addhotspot(%1);		set(hotspot[%1].url, %2);		set(hotspot[%1].ath, %3);		set(hotspot[%1].atv, %4);		set(hotspot[%1].width,  1000);		set(hotspot[%1].height, 1000);		if(device.html5, if(device.desktop,			<!-- desktop html5 browsers need overlapping cube faces -->			set(hotspot[%1].width,  1002);			set(hotspot[%1].height, 1002);		  ));		set(hotspot[%1].distorted, true);		set(hotspot[%1].enabled, false);		if(isflash, set(hotspot[%1].visible, false));		set(hotspot[%1].alpha, 0.0);		set(hotspot[%1].details, 16);	</action>

	<action name="addcube">		addface(face_%1_F, 'kitchen.tiles/%1_f.jpg',    0,   0);		addface(face_%1_L, 'kitchen.tiles/%1_l.jpg',  -90,   0);		addface(face_%1_R, 'kitchen.tiles/%1_r.jpg',  +90,   0);		addface(face_%1_B, 'kitchen.tiles/%1_b.jpg', +180,   0);		addface(face_%1_Z, 'kitchen.tiles/%1_u.jpg',    0, -90);		addface(face_%1_N, 'kitchen.tiles/%1_d.jpg',    0, +90);	</action>

	<action name="setalpha" devices="flash">		set(%1.alpha, %2);		if(%1.alpha == 0.0, set(%1.visible,false), set(%1.visible,true));	</action>		<action name="setalpha" devices="html5">		<!-- safari has some framerate stops/problems when toggling the visibility - so keep here the spots always visible -->		set(%1.alpha, %2);	</action>

	<action name="setcubealpha">		setalpha(hotspot[face_%1_F], %2);		setalpha(hotspot[face_%1_L], %2);		setalpha(hotspot[face_%1_R], %2);		setalpha(hotspot[face_%1_B], %2);		setalpha(hotspot[face_%1_Z], %2);		setalpha(hotspot[face_%1_N], %2);	</action>

	<action name="start">		addcube(pano1);		addcube(pano2);		setblend(0);	</action>

	<action name="setblend" devices="flash">		sub(blend2, 1.0, %1);		setcubealpha(pano1, get(blend2));		setcubealpha(pano2, %1);	</action>		<action name="setblend" devices="html5">		set(blend1, %1);		sub(blend2, 1.0, %1);		copy(hotspot[face_pano1_F].alpha, blend1);		copy(hotspot[face_pano1_L].alpha, blend1);		copy(hotspot[face_pano1_R].alpha, blend1);		copy(hotspot[face_pano1_B].alpha, blend1);		copy(hotspot[face_pano1_Z].alpha, blend1);		copy(hotspot[face_pano1_N].alpha, blend1);		copy(hotspot[face_pano2_F].alpha, blend2);		copy(hotspot[face_pano2_L].alpha, blend2);		copy(hotspot[face_pano2_R].alpha, blend2);		copy(hotspot[face_pano2_B].alpha, blend2);		copy(hotspot[face_pano2_Z].alpha, blend2);		copy(hotspot[face_pano2_N].alpha, blend2);	</action>		<!-- place your scene hotspots here -->	<hotspot name="spot1" style="skin_hotspotstyle" ath="63.149" atv="9.856" linkedscene="scene_ss-25m-local_sous_chlore" />		</scene>


here is the full XML


Do you know what I should change ?

Thank you for your answer

This post has been edited 2 times, last edit by "simious" (Jan 4th 2016, 7:30pm)


Umalo

Professional

Posts: 1,051

Location: Osijek, Croatia, EU

  • Send private message

2

Sunday, January 10th 2016, 2:34am

Hi Simon

1. you need to trigger start action on scene start attribute to initiate creation of the hotspots (from cube images)
2. Most probably you don't want 1 scene + 2 (fake scene images that looks like scene with this slider code) to be overlapping. So, I removed creation of second cube set commenting

Source code

1
<!--addcube(pano2); -->
Now we have only scene regular tiles loaded and 1 cube set. Due to the fact that "cube" hotspots are over the pano they are displayed at start. If you want to see at start real scene tiles than you need to add this first line before

Source code

1
2
sub(val,1,val);
before this call: setblend(get(val)); 
to have cube hotspot "invisibe at start" and that slider moving from left to right increase cube alpha
All above if your kitchen.tiles/%1_f.jpg are loaded correctly. When I was doing this code I needed to add panos/kitchen.tiles/%1_f.jpg as I added kitchen.tiles as separate panos folder and added pano1_b.jpg (+ulrf) manualy from slider examples there too.

Working demo you have on latest board under links.

3

Friday, January 15th 2016, 1:30pm

Thank you, solved thanks to your help

Similar threads