EDIT // Window Compass now includes a Pano2VR 7 project
Posted: Mon Jan 21, 2013 7:27 pm
Hi,
Before version 4 this was a not easy, but now so easy thanks to being able to select North and the new modifier Pan North.
The project works in both the Flash and HTML5 outputs. It looks as if the window compass elements and panorama move out of synchronisation but its just following the 3D distortion of the panorama. To show this there is also a pointer, so when facing N, S, E or W the correct window compass rectangle will be showing at the top of the screen.
How it works:
Each panorama needs its North set in either the User Data or Viewing Parameters.
To keep the math simple I am using a skin window size of 800 x 600, the width being the most important here.
The compass elements are 80px wide, each has a position X/Y of 0/5 and need to be anchored top centre.
The magic is in the Actions Modifiers tab, under Modifiers for each rectangle.
Example from North:
Move X => Pan North => Factor: 10.000 => Offset: 360
North will be centre of the skins window so thats where the 360 comes from, X = 360 puts the north rectangle exactly in the middle of the skin editors window.
For the other elements the offset math is this:
Math summery:
360 = North
360 + 900 = 1260, East
360 + 1800 = 2160, South1
360 - 900 = -540, West
360 - 1800 = -1440, South2.
Why do I have two South's ?
The way the skin works, elements can only be seen going CW (clock wise) from 0 to 180. Past this the you need to use negative numbers.
So 0 to 180 and then 0 to -180.
As this is using the Pan North modifier as you go to different nodes as long as they have North set it will always point in the right direction.
You can add more elements, so to have NE the offset would be 810, for SE the offset would be 1710. Thats using the skin window width of 800 and the rectangles being 80px wide. Please see this skin for a working example:
If you skin window size is 1024 with compass rectangles of 80px then the offset for North would be 492 and all other calculations start from this number.
Regards,
Hopki
Before version 4 this was a not easy, but now so easy thanks to being able to select North and the new modifier Pan North.
The project works in both the Flash and HTML5 outputs. It looks as if the window compass elements and panorama move out of synchronisation but its just following the 3D distortion of the panorama. To show this there is also a pointer, so when facing N, S, E or W the correct window compass rectangle will be showing at the top of the screen.
How it works:
Each panorama needs its North set in either the User Data or Viewing Parameters.
To keep the math simple I am using a skin window size of 800 x 600, the width being the most important here.
The compass elements are 80px wide, each has a position X/Y of 0/5 and need to be anchored top centre.
The magic is in the Actions Modifiers tab, under Modifiers for each rectangle.
Example from North:
Move X => Pan North => Factor: 10.000 => Offset: 360
North will be centre of the skins window so thats where the 360 comes from, X = 360 puts the north rectangle exactly in the middle of the skin editors window.
For the other elements the offset math is this:
Math summery:
360 = North
360 + 900 = 1260, East
360 + 1800 = 2160, South1
360 - 900 = -540, West
360 - 1800 = -1440, South2.
Why do I have two South's ?
The way the skin works, elements can only be seen going CW (clock wise) from 0 to 180. Past this the you need to use negative numbers.
So 0 to 180 and then 0 to -180.
As this is using the Pan North modifier as you go to different nodes as long as they have North set it will always point in the right direction.
You can add more elements, so to have NE the offset would be 810, for SE the offset would be 1710. Thats using the skin window width of 800 and the rectangles being 80px wide. Please see this skin for a working example:
If you skin window size is 1024 with compass rectangles of 80px then the offset for North would be 492 and all other calculations start from this number.
Regards,
Hopki