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, 26. September 2019, 11:28

lookto with offset

Hi,
I'm trying to lookto hotspot when clicked but not centered in the screen...
Here is an exemple : http://360images.fr/barebonelookto/

Works fine when hotspot has ath="0" but it doesn't when ath is different.
Plus I would like to look to the offset position directly without having to look first at the centered position and then calculate the offset coordinates with screentosphere.

Don't know if it's possible, well I guess it is with some math but I'm very bad with math...

Any clue ?

Here is my actual code :

Quellcode

1
2
3
4
5
6
7
8
9
<style name="hsstyle" url="hs.png" onclick="lookto_offset(get(name))"/>
	
<action name="lookto_offset">
lookto(get(hotspot[%1].ath), get(hotspot[%1].atv), get(hotspot[%1].tofov), smooth(50,50,50),true,true,
calc(hpix,stagewidth * 0.25);calc(vpix,stageheight * 0.5);screentosphere(hpix, vpix, toh, tov);lookto(get(toh),get(tov),get(view.fov),smooth(50,50,50));
);
</action>
	
<hotspot name="hs1" style="hsstyle" ath="0" atv="0" tofov="20"/>

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

2

Donnerstag, 26. September 2019, 12:43

Hi)

I tried calculating offsets, but it seems I'm lacking some deeper understanding of calculations between 3D space of the pano and screen plane.

Quellcode

1
<action name="lookto_offset" >		showlog();		calc(hpix,stagewidth * 0.25);		calc(vpix,stageheight * 0.5);		spheretoscreen(hotspot[%1].ath,hotspot[%1].atv, x,y);		screentosphere(hpix, vpix, toh, tov);				set(screen_distance, calc((3 * hpix) - x));		trace('screen_distance == ' , screen_distance);				set(spherical_distance, calc(hotspot[%1].ath - toh));		trace('sp dist == ' , spherical_distance);				set(fov_difference, calc(hotspot[%1].tofov / view.fov));		trace('fov diff == ' , fov_difference);				set(target, calc(hotspot[%1].ath - (spherical_distance * fov_difference)));		trace(target);		lookto(calc(hotspot[%1].ath - (spherical_distance * fov_difference)), calc(hotspot[%1].atv), get(hotspot[%1].tofov), smooth(50,50,50),true,true);	</action>




Obviously, the current FOV and target FOV of the hotspot must be taken into consideration.
Regards,

Alexey

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

3

Donnerstag, 26. September 2019, 14:27

Thx for trying Alexey !

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

4

Donnerstag, 26. September 2019, 14:59

Another approach would be (with fovtype="hfov") :

Quellcode

1
2
3
<action name="lookto_offset">
lookto(calc(hotspot[%1].ath - (hotspot[%1].tofov / 4)),get(hotspot[%1].atv),get(hotspot[%1].tofov),smooth(50,50,50));
</action>

but it's still not precise...

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

5

Freitag, 27. September 2019, 13:47

Hi Klaus, no clue on this one ?

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

6

Freitag, 29. November 2019, 09:15

Hi again,
Still not a single small idea from anybody on this one ?