You are not logged in.

ramirox3

Intermediate

  • "ramirox3" started this thread

Posts: 354

Location: La Ceja, Colombia

Occupation: photographer

  • Send private message

1

Wednesday, August 26th 2020, 2:30am

I need help get hlookat vlookat positions

hello, I'm trying to make a layer that is located in the center, pan around 4 different and close positions, indicating how a pane moves. everything works perfectly for me, but only in the starting position.
this is the code:

<layer name = "helpa" style = "" keep = "true" url = "hotspots / helpa.png" align.
desktop = "bottomright" x.desktop = "190" y.desktop = "5" align.tablet = "topright" x.tablet = "5" y.tablet = "15" zorder = "99"
alpha = "0.8" scale = "0.8" visible = "true" enabled = "true"
onclick = "switch (autorotate.enabled); action (skin_hideskin); set (layer [tg] .visible, true); action (skin_hideskin); set (layer [tg] .visible, true);
delayedcall (1, lookto (187,0.0,120,
smooth (6,25,12)));
delayedcall (3, lookto (173,0.0,120, smooth (6,25,12)));
delayedcall (6, lookto (180,7.0,120, smooth (6,25,12)));
delayedcall (9, lookto (180, -7.0,120, smooth (6,25,12)));
delayedcall (12, lookto (180,0.0,120, smooth (6,25,12)));
delayedcall (13, set (layer [tg] .visible, false)); action (skin_showskin); switch (autorotate.enabled); "
/>

Being in a different position than the initial one, everything gets complicated, I have tried many variables but I can't get it.
How do I make the onclick order take the current position and simply increment or decrement the amount needed in Hlookat and vlookat.
I appreciate any hint

Ramiro

ramirox3

Intermediate

  • "ramirox3" started this thread

Posts: 354

Location: La Ceja, Colombia

Occupation: photographer

  • Send private message

2

Thursday, August 27th 2020, 5:21pm

I pick up this thread in order to get help.
The idea is that when I click on the help button at the bottom right, an icon becomes visible by moving the panorama to four different positions as hlookat and vlookat, and then the icon disappears when you return to the initial position.
Everything works perfectly in the initial position with values ​​0.0. But when I click on another position other than the initial one, it does not work correctly, since it is in other coordinates as for hlookat.
the code is this
onclick = "set (layer [tg] .visible, true);
delayedcall (1, lookto (8,0.0,120, smooth (6,25,12)));
delayedcall (3,
lookto (-8,0.0,120, smooth (6,25,12)));
delayedcall (6, lookto (0,0.0,120, smooth (6,25,12)));
delayedcall (9, lookto (0, -8.0,120, smooth (6,25,12)));
delayedcall (11, lookto (0.8.0.120, smooth (6.25.12)));
delayedcall (14, lookto (0,0.0,120, smooth (6,25,12)));
delayedcall (16, set (layer [tg] .visible, false)); action (skin_showskin);
"
/>

You can see the intent here:

https://www.ciudadcubica.com/prueba1/
I have tried other possibilities like this but not succeeding:
delayedcall (1, lookto (get (h) + offset8, get (v), get (f); smooth (6,25,12)));
A clue would be of great help to me

3

Thursday, August 27th 2020, 6:30pm

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
... onclick="helpme();" ...

<action name="helpme" scope="local">
	set(local.deg, 8); // degree of movement
	set(local.smt, smooth(6, 25, 12)); // smooth setting
	set(local.off, 1); // start offset
	set(local.dur, 3); // duration of each phase

	copy(local.hlval, view.hlookat);
	calc(local.hlmax, hlval + deg);
	calc(local.hlmin, hlval - deg);
	copy(local.vlval, view.vlookat);
	calc(local.vlmax, vlval + deg);
	calc(local.vlmin, vlval - deg);
	copy(local.fov, view.fov);
	// set(local.fov, 120); // for fixed value

	set(layer[tg].visible, true);
	delayedcall(calc(off + dur * 0), lookto(get(hlmax), get(vlval), get(fov), get(smt)));
	delayedcall(calc(off + dur * 1), lookto(get(hlmin), get(vlval), get(fov), get(smt)));
	delayedcall(calc(off + dur * 2), lookto(get(hlval), get(vlval), get(fov), get(smt)));
	delayedcall(calc(off + dur * 3), lookto(get(hlval), get(vlmin), get(fov), get(smt)));
	delayedcall(calc(off + dur * 4), lookto(get(hlval), get(vlmax), get(fov), get(smt)));
	delayedcall(calc(off + dur * 5), lookto(get(hlval), get(vlval), get(fov), get(smt)));
	delayedcall(calc(off + dur * 6), set(layer[tg].visible, false));
	// skin_showskin();
</action>


tested, works.

This post has been edited 4 times, last edit by "indexofrefraction" (Aug 27th 2020, 11:21pm)


ramirox3

Intermediate

  • "ramirox3" started this thread

Posts: 354

Location: La Ceja, Colombia

Occupation: photographer

  • Send private message

4

Thursday, August 27th 2020, 10:29pm

thanks indexofrefraction for your reply.
I tried it, but the icon shows and disappears, without moving in this period.
When the icon disappears, the panorama is immobile

5

Thursday, August 27th 2020, 11:19pm

the code had some bugs.... corrected above

here another version without these delayed calls
it is better to use the lookto() done calls

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
<action name="helpme" scope="local" autorun="onstart">
	set(local.deg, 10); // degree of movement
	set(local.smt, smooth(12, 50, 24)); // smooth setting
	set(local.off, 2); // offset

	copy(local.hlval, view.hlookat);
	calc(local.hlmax, hlval + deg);
	calc(local.hlmin, hlval - deg);
	copy(local.vlval, view.vlookat);
	calc(local.vlmax, vlval + deg);
	calc(local.vlmin, vlval - deg);
	copy(local.fov, view.fov);
	// set(local.fov, 120); // for fixed value

	set(layer[tg].visible, true);
	delayedcall(get(off),
		lookto(get(hlmax), get(vlval), get(fov), get(smt), true, true,
			lookto(get(hlmin), get(vlval), get(fov), get(smt), true, true,
				lookto(get(hlval), get(vlval), get(fov), get(smt), true, true,
					lookto(get(hlval), get(vlmin), get(fov), get(smt), true, true,
						lookto(get(hlval), get(vlmax), get(fov), get(smt), true, true,
							lookto(get(hlval), get(vlval), get(fov), get(smt), true, true,
								delayedcall(get(off),
									set(layer[tg].visible, false);
								);
							);
						);
					);
				);
			):
		);
	);
</action>

ramirox3

Intermediate

  • "ramirox3" started this thread

Posts: 354

Location: La Ceja, Colombia

Occupation: photographer

  • Send private message

6

Friday, August 28th 2020, 12:41am

woowww. it works!!!!! Thanks
Question: Where can I find information on this type of code on the web. I would like to study more in depth.
Thanks again
Ramiro

Tuur

Sage

Posts: 3,839

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

7

Friday, August 28th 2020, 11:04am

Quoted

Where can I find information on this type of code on the web. I would like to study more in depth.


here: https://krpano.com/home/
but mostly
here: https://krpano.com/docu/xml/
and
here: https://krpano.com/forum/wbb/index.php?l=2

*g*
Tuur *thumbsup*

8

Friday, August 28th 2020, 2:17pm

i forgot to remove the autorun="onstart" :)

ramirox3

Intermediate

  • "ramirox3" started this thread

Posts: 354

Location: La Ceja, Colombia

Occupation: photographer

  • Send private message

9

Saturday, August 29th 2020, 1:39am

i forgot to remove the autorun="onstart" :)

I realized, it was the first thing I removed, thanks.

Tuur Thanks
Those links are the first ones I visit to make inquiries. but in the case of this code supplied by indexofrefraction, I was querying about local.smt and local.off, but got no results. is why I was encouraged to ask for help to obtain other sources

This post has been edited 1 times, last edit by "ramirox3" (Aug 29th 2020, 1:51am)


Tuur

Sage

Posts: 3,839

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

10

Saturday, August 29th 2020, 10:30am

Hi,

'local' is an action scope parameter.
See here: https://krpano.com/docu/xml/#action.scope

The off and smt etc are variables Index creates in his firstlines.
You could easily change to local.pub or so *g*.
You might find some locals in the vtourskin or other krpano example codes..

Tuur *thumbsup*

ramirox3

Intermediate

  • "ramirox3" started this thread

Posts: 354

Location: La Ceja, Colombia

Occupation: photographer

  • Send private message

11

Saturday, August 29th 2020, 5:41pm

*w00t* Thanks. I will take it into account, it is up to me to learn to search