Sie sind nicht angemeldet.

ramirox3

Fortgeschrittener

  • »ramirox3« ist der Autor dieses Themas

Beiträge: 354

Wohnort: La Ceja, Colombia

Beruf: photographer

  • Nachricht senden

1

Mittwoch, 26. August 2020, 02:30

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

Fortgeschrittener

  • »ramirox3« ist der Autor dieses Themas

Beiträge: 354

Wohnort: La Ceja, Colombia

Beruf: photographer

  • Nachricht senden

2

Donnerstag, 27. August 2020, 17:21

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

Donnerstag, 27. August 2020, 18:30

Quellcode

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.

Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von »indexofrefraction« (27. August 2020, 23:21)


ramirox3

Fortgeschrittener

  • »ramirox3« ist der Autor dieses Themas

Beiträge: 354

Wohnort: La Ceja, Colombia

Beruf: photographer

  • Nachricht senden

4

Donnerstag, 27. August 2020, 22:29

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

Donnerstag, 27. August 2020, 23:19

the code had some bugs.... corrected above

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

Quellcode

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

Fortgeschrittener

  • »ramirox3« ist der Autor dieses Themas

Beiträge: 354

Wohnort: La Ceja, Colombia

Beruf: photographer

  • Nachricht senden

6

Freitag, 28. August 2020, 00:41

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

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

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

  • Nachricht senden

7

Freitag, 28. August 2020, 11:04

Zitat

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

Freitag, 28. August 2020, 14:17

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

ramirox3

Fortgeschrittener

  • »ramirox3« ist der Autor dieses Themas

Beiträge: 354

Wohnort: La Ceja, Colombia

Beruf: photographer

  • Nachricht senden

9

Samstag, 29. August 2020, 01:39

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

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »ramirox3« (29. August 2020, 01:51)


Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

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

  • Nachricht senden

10

Samstag, 29. August 2020, 10:30

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

Fortgeschrittener

  • »ramirox3« ist der Autor dieses Themas

Beiträge: 354

Wohnort: La Ceja, Colombia

Beruf: photographer

  • Nachricht senden

11

Samstag, 29. August 2020, 17:41

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