Sie sind nicht angemeldet.

1

Samstag, 30. Juli 2016, 17:56

hotspot distortion - get correct rx, ry, and rz values

hi there,

i'm surprised cant find any infos about finding the rx, ry, and rz values for a correct hotspot distortion.

what i have is a hotspot with an arrow (just png with frontal view of the arrow pointing upwards)
now i want to project the arrow to the floor (xz plane) ... basically like a sticker on the floor.

to do this you must set distorted="true" and set the rx, ry, and rz values depending on your ath and atv values.

this is still relatively easy when you want the hotspot image oriented to/away from the center/your camera:
then you can just set ry=0 and rx=atv-90

but when you want to rotate the sticker on the floor now... setting rz=angle will totally mess up the rotation!
does anybody understand what i mean and how to do this?

index

ps. and maybe to shorten that down:
if you want to place a hotspot as a sticker on a horizontal surface (ground, table)
how do you set the correct rx, ry, and rz values depending on the ath and atv values?
specially if you want to rotate the sticker on the surface to specific angles!
(example some magazine aligned on a table which is rotated by 30 degrees)

Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von »indexofrefraction« (30. Juli 2016, 22:43)


Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

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

  • Nachricht senden

3

Donnerstag, 4. August 2016, 18:18

to do this use the editor plugin.

no.. no post deleting possible as far as i know.

Tuur *thumbsup*

4

Donnerstag, 4. August 2016, 23:17

to do this use the editor plugin.


no, i want to just set the ath/atv
and then dynamically calculate and set the correct perspective
(rx, ry, rz values)

5

Donnerstag, 11. August 2016, 10:22

this already fades out of the 2nd page...
humbly allowing myself to bump it
(angel)

6

Donnerstag, 11. August 2016, 10:57

Hi,

3d-rotations are a bit more complicated - the rotation results are also depending on the 'order' of the axis-rotations! ;-)

By default rx/ry/rz are using the order 'Y-X-Z' - see the docs:
http://krpano.com/docu/xml/#hotspot.rx

by enabling the inverserotation setting it would be also possible to invert the order:
http://krpano.com/docu/xml/#hotspot.inverserotation

Other orders are currently not directly supported, but with some custom action code it would be possible to use any custom rotations/orders and convert them back to the order that krpano supports.

E.g. see in the example the 'alc_pos_from_hfov_yaw_pitch_roll' action:
Example/Tutorial - Extract a Distorted Hotspot from any kind of Pano Image (with perfect pixel alignment)

There the rotation order from PTGUI will be convert to the rotations order from krpano - the code there is basically a 'euler to matrix' and 'matrix to euler' conversion but with different rotation orders.

Best regards,
Klaus

7

Freitag, 12. August 2016, 11:03

thanks for your answer klaus, but i don't really get it...

the rotation results are also depending on the 'order' of the axis-rotations!
By default rx/ry/rz are using the order 'Y-X-Z'

i saw that in the documentation before i asked, but what does that mean?

do i have to set the rx/ry/rz in the correct order?
set ry before rx, before xz?
i don't believe that, and these two lines have the same same result...

Quellcode

1
2
set(ry,30); set(rx,45); set(rz,60);
set(rx,45); set(ry,30); set(rz,60);

.....

i also tried (no risk no fun) ...

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
	<action name="calc_ry_ry_rz_from_yaw_pitch_roll">
		div(yaw,%1,-57.295779);
		div(pitch,%2,57.295779);
		div(roll,%3,-57.295779);
		Math.cos(ch,yaw);Math.sin(sh,yaw);
		Math.cos(ca,pitch);Math.sin(sa,pitch);
		Math.cos(cb,roll);Math.sin(sb,roll);
		mul(m0,ca,ch);
		mul(tmp,cb,sa);mul(tmp,ch);mul(tmp2,sb,sh);add(m3,tmp,tmp2);
		mul(m4,cb,ca);
		mul(tmp,cb,sa);mul(tmp,sh);mul(tmp2,sb,ch);sub(m5n,tmp,tmp2);mul(m5n,-1);
		mul(tmp,sb,sa);mul(tmp,ch);mul(tmp2,cb,sh);sub(m6n,tmp,tmp2);mul(m6n,-1);
		Math.atan2(yaw,m6n,m0);
		Math.atan2(roll,m5n,m4);
		Math.asin(pitch,m3);
		mul(rx,yaw,57.295779);
		mul(ry,pitch,57.295779);
		mul(rz,roll,57.295779);
	</action>

calc_ry_ry_rz_from_yaw_pitch_roll(calc(atv-90),0,0);     <!-- works fine, but same as just set(rx,calc(atv-90)); -->
calc_ry_ry_rz_from_yaw_pitch_roll(calc(atv-90),0,30);   <!-- uncorrect rotation -->
calc_ry_ry_rz_from_yaw_pitch_roll(calc(atv-90),30,0);   <!-- uncorrect rotation -->


i m in a very dark tunnel here...
:/ index

8

Sonntag, 14. August 2016, 22:22

i m attaching an illustration of what i want to do:
1) hotspot image flat, pointing directly at the camera/center
2) hotspot rx=atv-90 ... works to "stick" it to the ground
3) rotating the spot, pointing a bit more to the left and not directly to/away from the cam... is a mistery. *confused*

http://imgur.com/a/g6VFk

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »indexofrefraction« (2. Januar 2017, 12:15)


9

Montag, 2. Januar 2017, 12:13

bumping this...
its one of the unsolved misteries
maybe to be solved in 2017
.)

Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

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

  • Nachricht senden

10

Montag, 2. Januar 2017, 14:50

Hi,

did you try rotate?

set(rotate,-20);

Hope it helps!

edit: i had hopes.. but it doesn't work.. sorry.. would be nice though when the rotate works like 2d also when hotspot is distorted.

Tuur *thumbsup*

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Tuur« (4. Januar 2017, 09:50)


11

Freitag, 6. Januar 2017, 20:01


did you try rotate?


thanks tuur, but sadly that doesn't work...
i need klaus *rolleyes*

12

Sonntag, 7. Februar 2021, 23:01

A very old thread, sorry to bump it, but docu still says "don't use rotate hotspot with distorted hotspots!" and I'm unsure how to proceed.

Does anyone know an easy workaround?
I'm asking before I photoshop each hotspot to its desired angle *g*

Thanks
loki