You are not logged in.

1

Thursday, April 11th 2013, 12:09pm

How to highlight a selected area while dimming the not selected area?!

Hello everyone,

We are making a virual tour of Het Spoorwegmuseum in Utrecht. Our idea was to make a map which will send you to different areas using polygonal hotspot structure.
To keep a long story short;

This is the effect we want to achieve: http://www.spoorwegmuseum.nl/flash/flash_plattegrond.swf
We want to dim the rest of the map while highlighten the selected area.

But we only got it this far with the default functions of KrPano: http://www.profimage.nl/panos/projecten/…t/a/LWpfXy.html

Here is the xml-code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<?xml version="1.0" encoding="UTF-8"?>
<!-- for xml compliance -->
<krpano version="1.0.8.14">
	<action name="playpanosounds">
		playbackgroundsound(none);
	</action>
	<action name="stoppanosounds">
		stopbackgroundsound();
	</action>
	<action name="closepanoobjects">
	</action>
	<!--************** Panorama *******************************************************************-->
	<!-- @File="LWpfXy0.xml" @PanoName="spoorwegmuseum plattegrond inelkaar" @FilePath="C:/Users/Profimage/Pictures/spoorwegmuseum plattegrond inelkaar.psd" -->
	<panoview h="0" v="-0.0629978" fov="0.533381"/>
	<!-- view parameters -->
	<view fisheye="0" limitview="range" hlookatmin="-0.5" hlookatmax="0.5" vlookatmin="-0.329688" vlookatmax="0.203693" fovmin="0.533381" fov="0.533381" hlookat="0" vlookat="-0.0629978"/>
	<progress showload="none" showwait="none"/>
	<autorotate horizon="-0.0629978" tofov="0.533381" waittime="1" speed="5"/>
	<!-- preview image -->
	<preview url="LWpfXydata/LWpfXy0/preview.jpg"/>
	<!-- the pano itself -->
	<image type="SPHERE" hfov="1" vfov="0.776972" voffset="0" multires="true" tilesize="697" baseindex="0">
    	<level tiledimagewidth="3587" tiledimageheight="2787">
        	<sphere url="LWpfXydata/LWpfXy0/2/%v_%u.jpg"/>
    	</level>
    	<level tiledimagewidth="1793" tiledimageheight="1393">
        	<sphere url="LWpfXydata/LWpfXy0/1/%v_%u.jpg"/>
    	</level>
    	<level tiledimagewidth="896" tiledimageheight="696">
        	<sphere url="LWpfXydata/LWpfXy0/0/%v_%u.jpg"/>
    	</level>
	</image>
	<!--************** Hotspots and lensflares ****************************************************-->
	<hotspot name="spot0" onclick="openurl('http://www.profimage.nl/panos/projecten/5/spoorwegmuseum_utrecht/g/LWpfXy.html', _self);" bordercolorhover="0x000000" borderalphahover="1" fillcolorhover="0x000000" fillalphahover="0.490196">
    	<point ath="0.0938659" atv="0.187277"/>
    	<point ath="0.124289" atv="0.163359"/>
    	<point ath="0.140119" atv="0.157195"/>
    	<point ath="0.125278" atv="0.153496"/>
    	<point ath="0.122558" atv="0.152016"/>
    	<point ath="0.118105" atv="0.14166"/>
    	<point ath="0.10747" atv="0.135002"/>
    	<point ath="0.0916399" atv="0.134016"/>
    	<point ath="0.0891665" atv="0.132783"/>
    	<point ath="0.0876824" atv="0.120947"/>
    	<point ath="0.0810042" atv="0.116016"/>
    	<point ath="0.062701" atv="0.11429"/>
    	<point ath="0.0609696" atv="0.11281"/>
    	<point ath="0.0619589" atv="0.102207"/>
    	<point ath="0.0520653" atv="0.0950564"/>
    	<point ath="0.0337621" atv="0.0938235"/>
    	<point ath="0.0357408" atv="0.090618"/>
    	<point ath="0.0325254" atv="0.0847001"/>
    	<point ath="0.030794" atv="0.0869193"/>
    	<point ath="0.0293099" atv="0.0871659"/>
    	<point ath="0.0290626" atv="0.088892"/>
    	<point ath="0.0268365" atv="0.0938235"/>
    	<point ath="0.0238684" atv="0.0918509"/>
    	<point ath="0.0278259" atv="0.0819877"/>
    	<point ath="0.020653" atv="0.0790288"/>
    	<point ath="0.0194163" atv="0.0819877"/>
    	<point ath="0.0179322" atv="0.0819877"/>
    	<point ath="0.0189216" atv="0.0834672"/>
    	<point ath="0.0176849" atv="0.0871659"/>
    	<point ath="0.0124907" atv="0.0834672"/>
    	<point ath="0.0129854" atv="0.0773027"/>
    	<point ath="-0.00680188" atv="0.0851933"/>
    	<point ath="0.00803859" atv="0.093577"/>
    	<point ath="0.0139748" atv="0.111577"/>
    	<point ath="0.0228791" atv="0.141413"/>
	</hotspot>
	<hotspot name="spot1" onclick="openurl('http://www.profimage.nl/panos/projecten/5/spoorwegmuseum_utrecht/d/LWpfXy.html', _self);" bordercolorhover="0x000000" borderalphahover="1" fillcolorhover="0x000000" fillalphahover="0.490196">
    	<point ath="0.414708" atv="0.109544"/>
    	<point ath="0.355832" atv="0.0731413"/>
    	<point ath="0.266441" atv="0.0180905"/>
    	<point ath="0.225876" atv="0.0303553"/>
    	<point ath="0.219422" atv="0.0392472"/>
    	<point ath="0.20809" atv="0.0424416"/>
    	<point ath="0.208052" atv="0.0551914"/>
    	<point ath="0.275968" atv="0.100878"/>
    	<point ath="0.266134" atv="0.104557"/>
    	<point ath="0.277197" atv="0.127553"/>
    	<point ath="0.32268" atv="0.156989"/>
    	<point ath="0.387216" atv="0.141658"/>
    	<point ath="0.410264" atv="0.112529"/>
	</hotspot>
	<hotspot name="spot2" onclick="openurl('http://www.profimage.nl/panos/projecten/5/spoorwegmuseum_utrecht/c/LWpfXy.html', _self);" bordercolorhover="0x000000" borderalphahover="1" fillcolorhover="0x000000" fillalphahover="0.490196">
    	<point ath="0.279747" atv="-0.076515"/>
    	<point ath="0.423847" atv="0.0036123"/>
    	<point ath="0.410717" atv="0.00804557"/>
    	<point ath="0.400049" atv="0.047945"/>
    	<point ath="0.346709" atv="0.0628868"/>
    	<point ath="0.26514" atv="0.0137924"/>
    	<point ath="0.255457" atv="0.0165837"/>
    	<point ath="0.218365" atv="-0.00738879"/>
    	<point ath="0.215247" atv="-0.0275848"/>
    	<point ath="0.203923" atv="-0.0453179"/>
    	<point ath="0.195881" atv="-0.049587"/>
	</hotspot>
	<hotspot name="spot3" onclick="openurl('http://www.profimage.nl/panos/projecten/5/spoorwegmuseum_utrecht/b/LWpfXy.html', _self);" bordercolorhover="0x000000" borderalphahover="1" fillcolorhover="0x000000" fillalphahover="0.490196">
    	<point ath="-0.139776" atv="0.0883836"/>
    	<point ath="-0.139776" atv="0.100302"/>
    	<point ath="-0.138707" atv="0.128022"/>
    	<point ath="-0.137772" atv="0.129228"/>
    	<point ath="-0.137906" atv="0.134584"/>
    	<point ath="-0.205041" atv="0.156645"/>
    	<point ath="-0.212557" atv="0.150026"/>
    	<point ath="-0.212374" atv="0.14782"/>
    	<point ath="-0.222273" atv="0.140282"/>
    	<point ath="-0.22374" atv="0.140282"/>
    	<point ath="-0.230339" atv="0.134766"/>
    	<point ath="-0.230156" atv="0.132744"/>
    	<point ath="-0.239322" atv="0.12447"/>
    	<point ath="-0.241155" atv="0.12447"/>
    	<point ath="-0.249038" atv="0.118403"/>
    	<point ath="-0.249038" atv="0.116197"/>
    	<point ath="-0.258203" atv="0.108291"/>
    	<point ath="-0.259853" atv="0.108475"/>
    	<point ath="-0.266636" atv="0.102775"/>
    	<point ath="-0.266453" atv="0.100017"/>
    	<point ath="-0.276169" atv="0.0922953"/>
    	<point ath="-0.278002" atv="0.0921115"/>
    	<point ath="-0.284601" atv="0.0865958"/>
    	<point ath="-0.284785" atv="0.0845734"/>
    	<point ath="-0.293951" atv="0.0762999"/>
    	<point ath="-0.295967" atv="0.0762999"/>
    	<point ath="-0.3011" atv="0.0718874"/>
    	<point ath="-0.306233" atv="0.0739098"/>
    	<point ath="-0.308616" atv="0.072439"/>
    	<point ath="-0.315765" atv="0.075013"/>
    	<point ath="-0.317599" atv="0.0744614"/>
    	<point ath="-0.333181" atv="0.0790578"/>
    	<point ath="-0.333181" atv="0.0797932"/>
    	<point ath="-0.343263" atv="0.0823672"/>
    	<point ath="-0.343813" atv="0.0840219"/>
    	<point ath="-0.349496" atv="0.0853088"/>
    	<point ath="-0.354445" atv="0.0803448"/>
    	<point ath="-0.354445" atv="0.0781385"/>
    	<point ath="-0.370761" atv="0.0645332"/>
    	<point ath="-0.373144" atv="0.0652686"/>
    	<point ath="-0.499817" atv="0.102775"/>
    	<point ath="-0.499633" atv="0.0490894"/>
    	<point ath="-0.441338" atv="0.0332778"/>
    	<point ath="-0.441097" atv="0.013067"/>
    	<point ath="-0.442682" atv="0.00715842"/>
    	<point ath="-0.44155" atv="0.00670392"/>
    	<point ath="-0.441323" atv="0.00215889"/>
    	<point ath="-0.440417" atv="0.00147713"/>
    	<point ath="-0.441097" atv="-0.000113626"/>
    	<point ath="-0.44087" atv="-0.00306789"/>
    	<point ath="-0.439737" atv="-0.00465865"/>
    	<point ath="-0.437925" atv="-0.0048859"/>
    	<point ath="-0.437472" atv="-0.00306789"/>
    	<point ath="-0.436565" atv="-0.00193164"/>
    	<point ath="-0.436112" atv="-0.00238614"/>
    	<point ath="-0.435886" atv="-0.0182937"/>
    	<point ath="-0.437245" atv="-0.0207935"/>
    	<point ath="-0.437019" atv="-0.022157"/>
    	<point ath="-0.436112" atv="-0.0226115"/>
    	<point ath="-0.436112" atv="-0.0269293"/>
    	<point ath="-0.43563" atv="-0.035813"/>
    	<point ath="-0.444923" atv="-0.0444536"/>
    	<point ath="-0.44651" atv="-0.0442263"/>
    	<point ath="-0.450816" atv="-0.047637"/>
    	<point ath="-0.451949" atv="-0.0496835"/>
    	<point ath="-0.461242" atv="-0.0578693"/>
    	<point ath="-0.462602" atv="-0.0578693"/>
    	<point ath="-0.465095" atv="-0.0605979"/>
    	<point ath="-0.465549" atv="-0.0667373"/>
    	<point ath="-0.465095" atv="-0.0658278"/>
    	<point ath="-0.464642" atv="-0.0944782"/>
    	<point ath="-0.466682" atv="-0.0960699"/>
    	<point ath="-0.465322" atv="-0.0972068"/>
    	<point ath="-0.464415" atv="-0.101527"/>
    	<point ath="-0.459882" atv="-0.103346"/>
    	<point ath="-0.441296" atv="-0.118581"/>
    	<point ath="-0.44107" atv="-0.121537"/>
    	<point ath="-0.43291" atv="-0.123583"/>
    	<point ath="-0.430417" atv="-0.121537"/>
    	<point ath="-0.42951" atv="-0.119718"/>
    	<point ath="-0.403445" atv="-0.113578"/>
    	<point ath="-0.401179" atv="-0.114488"/>
    	<point ath="-0.399592" atv="-0.113124"/>
    	<point ath="-0.399592" atv="-0.109486"/>
    	<point ath="-0.337262" atv="-0.0605979"/>
    	<point ath="-0.31369" atv="-0.0665099"/>
    	<point ath="-0.313463" atv="-0.0708302"/>
    	<point ath="-0.314143" atv="-0.0726493"/>
    	<point ath="-0.309377" atv="-0.0738413"/>
    	<point ath="-0.30635" atv="-0.0720902"/>
    	<point ath="-0.306636" atv="-0.0677991"/>
    	<point ath="-0.269719" atv="-0.0444536"/>
    	<point ath="-0.268359" atv="-0.0455906"/>
    	<point ath="-0.269039" atv="-0.0465001"/>
    	<point ath="-0.268812" atv="-0.047637"/>
    	<point ath="-0.267226" atv="-0.0480918"/>
    	<point ath="-0.264733" atv="-0.0485466"/>
    	<point ath="-0.262013" atv="-0.0478644"/>
    	<point ath="-0.262013" atv="-0.044681"/>
    	<point ath="-0.262919" atv="-0.0437715"/>
    	<point ath="-0.262693" atv="-0.0419524"/>
    	<point ath="-0.261106" atv="-0.0414976"/>
    	<point ath="-0.262919" atv="-0.0396786"/>
    	<point ath="-0.262919" atv="-0.0355857"/>
    	<point ath="-0.264028" atv="-0.00327755"/>
    	<point ath="-0.147963" atv="0.0873371"/>
    	<point ath="-0.141814" atv="0.0861803"/>
	</hotspot>
	<hotspot name="spot4" onclick="openurl('http://www.profimage.nl/panos/projecten/5/spoorwegmuseum_utrecht/f/LWpfXy.html', _self);" bordercolorhover="0x000000" borderalphahover="1" fillcolorhover="0x000000" fillalphahover="0.490196">
    	<point ath="-0.122926" atv="-0.103622"/>
    	<point ath="-0.0982246" atv="-0.102458"/>
    	<point ath="-0.00868391" atv="-0.0426908"/>
    	<point ath="0.00405249" atv="-0.0349288"/>
    	<point ath="0.0750675" atv="-0.0248383"/>
    	<point ath="0.0800849" atv="-0.0469599"/>
    	<point ath="0.124469" atv="-0.0426908"/>
    	<point ath="0.124083" atv="-0.00892626"/>
    	<point ath="0.136048" atv="-0.00776196"/>
    	<point ath="0.142223" atv="-0.00232859"/>
    	<point ath="0.13296" atv="-0.00310478"/>
    	<point ath="0.104014" atv="0.0182406"/>
    	<point ath="0.112119" atv="0.0279431"/>
    	<point ath="0.112119" atv="0.0314359"/>
    	<point ath="0.0993825" atv="0.035705"/>
    	<point ath="0.0920494" atv="0.0178525"/>
    	<point ath="0.0125434" atv="0.0423027"/>
    	<point ath="0.0129294" atv="0.0714101"/>
    	<point ath="-0.0113856" atv="0.0818887"/>
    	<point ath="-0.183134" atv="-0.0403622"/>
    	<point ath="-0.174643" atv="-0.075291"/>
    	<point ath="-0.132188" atv="-0.107503"/>
	</hotspot>
	<hotspot name="spot5" onclick="openurl('http://www.profimage.nl/panos/projecten/5/spoorwegmuseum_utrecht/e/LWpfXy.html', _self);" bordercolorhover="0x000000" borderalphahover="1" fillcolorhover="0x000000" fillalphahover="0.490196">
    	<point ath="0.185836" atv="-0.0112548"/>
    	<point ath="0.158433" atv="-0.000776196"/>
    	<point ath="0.142995" atv="-0.00194049"/>
    	<point ath="0.136048" atv="-0.00737386"/>
    	<point ath="0.124855" atv="-0.00970245"/>
    	<point ath="0.124855" atv="-0.0679172"/>
    	<point ath="0.0843304" atv="-0.0725743"/>
    	<point ath="0.0847163" atv="-0.0477361"/>
    	<point ath="0.0808568" atv="-0.0469599"/>
    	<point ath="0.0746816" atv="-0.0248383"/>
    	<point ath="0.00443844" atv="-0.0349288"/>
    	<point ath="-0.007912" atv="-0.0423027"/>
    	<point ath="-0.0982246" atv="-0.10207"/>
    	<point ath="-0.121768" atv="-0.103622"/>
    	<point ath="-0.131802" atv="-0.107115"/>
    	<point ath="-0.115978" atv="-0.118758"/>
    	<point ath="-0.0785411" atv="-0.123415"/>
    	<point ath="0.00250868" atv="-0.0733505"/>
    	<point ath="0.0754535" atv="-0.0640362"/>
    	<point ath="0.0812428" atv="-0.0818887"/>
    	<point ath="0.166924" atv="-0.0694696"/>
    	<point ath="0.193169" atv="-0.0527813"/>
    	<point ath="0.187379" atv="-0.0504528"/>
    	<point ath="0.185836" atv="-0.012031"/>
	</hotspot>
	<action name="hidepanospotsaction">
		set(hotspot[spot0].visible, false);
		set(hotspot[spot1].visible, false);
		set(hotspot[spot2].visible, false);
		set(hotspot[spot3].visible, false);
		set(hotspot[spot4].visible, false);
		set(hotspot[spot5].visible, false);
	</action>
	<action name="showpanospotsaction">
		set(hotspot[spot0].visible, true);
		set(hotspot[spot1].visible, true);
		set(hotspot[spot2].visible, true);
		set(hotspot[spot3].visible, true);
		set(hotspot[spot4].visible, true);
		set(hotspot[spot5].visible, true);
	</action>
	<!-- close all hotspots -->
</krpano>

jsimpson

Beginner

Posts: 10

Location: United States

Occupation: Programmer

  • Send private message

2

Friday, April 12th 2013, 3:43am

Hilighting hotspots

I think you need to add onover and onout attributes to each hotspot.


The onover attribute would specify an action which would set the alpha of the current hotspot to 0, allowing the underlying image to appear at full brightness.
In the same action change the alpha of all the other hotspots to to a value between 0 and 1, causing the underlying image to appear darker.

The action specified in the onout attribute would reset all hotspot alpha values to 0, making the entire map visible.

It will take some experimenting with hotspot fillcolor and alpha to achieve the results you desire.

Umalo

Professional

Posts: 1,051

Location: Osijek, Croatia, EU

  • Send private message

3

Friday, April 12th 2013, 4:19pm

First create the mask that will cover all parts other than covered by your spots. You can take a look on vigneting or similar examples in Krpano examples. E.g. link

When you combine with you should get something like:

Than you give your spots fill that match the masked area. result as here:

Give your spots on over action to set alpha="0" becoming transparent and giving you area you want to see with no mask -> when mouse over you should get:


If you ask your self how to make mask image. I would turn on default visbility and fill of all existing spots. Make screencapture. Go to some vector editing programs. Put your original image on background. Put your screen capture on layer above (with perfect matching with your iamge) On new layer drow objects to exactly match the spots. At the end draw one big box and substract your spot object. Result should be similar to left side image in my a.jpg.