You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

boxx1

Beginner

  • "boxx1" started this thread

Posts: 16

Location: Estonia

  • Send private message

1

Thursday, May 20th 2010, 1:25pm

A bug with masking the interactive area.

Dear comrades,

I face a strange problem. It might be a bug, but I would prefer it to be just my mistake to be solved.

I put the interactive area on the scene. This is a kitchen furniture, and I need to open the door of the fridge. So I made another photo with the open door, and now set it as a hotspot named "fridge" in the code. I played with distortion but still could not set it exactly as on the scene. The edges do not perfectly fit the original picture. So desided to make a mask, that will repeat the shape of the door and cut the unnessessary space around. And it actually works great for this case.

BUT, when I move the scene left to the hlookat under 20, the mask desappears and the cut area appears back onto the screen. When I rotate the scene to the right side the mask shows up again and does its job.

Here is the link:
[url]http://wheretogoin.eu/tours/fairs/estonia/interjoor/2010/firmad/Arens/
[/url]

Once the scene is loaded, click onto the (!) hotspot and it opens the door. Then slightly move the scene to the left and you will see the area around the door turns dark. It means that the white mask, that surrounds the door disappeared.

Is that the mistake in the code or is it a bug? Do you know any quicksolution?

Thanks

2

Thursday, May 20th 2010, 1:48pm

Hi,

this is a kind of flashplayer limitation with masks:

when using mask the flashplayer will convert the element which uses the mask and the mask to internal bitmaps, and these bitmaps are limited to 2880x2880 pixels,

but the problem here - size calculation for the bitmaps doesn't respect the screen clipping, so due the perspective distortion the size of the hotspot becomes larger then 2880 pixel, and so the flashplayer stops using the mask,

you should also notice a heavy slow down when the mask will be applied,

a better solution (in kind of rendering performance and working) would be to use image with integrated alpha channel (e.g. a png),

I'm also working on an internal solution where I do the screen clipping manually, but then there will be still the slow down because of the flashplayer internal bitmap conversion every frame,

best regards,
Klaus

boxx1

Beginner

  • "boxx1" started this thread

Posts: 16

Location: Estonia

  • Send private message

3

Thursday, May 20th 2010, 1:56pm

Thanks for an answer. I also thought about using PNG. But the size of the picture becomes 200+ kb with 128 colors only (instead of 100 kb jpeg with 45% quality).

Anyway it seems that I will need to come up with this solution then. Hope it will not slow down the viewer that bad as mask did, will it?

4

Thursday, May 20th 2010, 2:17pm

Hi,

a other solution - why not composting the fringe image with the cube face (copying the 'background' from the front cube-face image to fringe image)?

then no mask is needed and saving it as jpeg it also possible, and from the rendering performance side this will be the best solution at all!

e.g. see here I have modded your fringe.jpg in that way:


best regards,
Klaus

boxx1

Beginner

  • "boxx1" started this thread

Posts: 16

Location: Estonia

  • Send private message

5

Thursday, May 20th 2010, 2:37pm

Thanks a lot, Klaus.

It looks much better, than mine. But still I gave up tilting and adjusting the cropped image to the original scene. Even with this solution there are still some mismarching edges. That is why I tried to solve this with masking the edges. I updated the file, you can check the same link.

By the way, what if I reduce the size of the mask image to 50% and put the scale="2". Will this cheet the flash player?

6

Thursday, May 20th 2010, 2:54pm

Hi,

the mismatching edges are because of the incorrect position,

see this thread for a how to for exact positioning:
Example/Tutorial - interactive area in the pano (aligned distorted hotspot)

e.g. try this:

Source code

1
2
3
4
5
6
7
8
9
10
11
<hotspot name="fridge"
         url="spots/fridge_mod.jpg"
         ath="0"
         atv="0"
         distorted="true"
         width="349.726775"
         height="837.059115"
         edge="lefttop"
         ox="-1.738698"
         oy="-351.465474"
         />


Quoted

By the way, what if I reduce the size of the mask image to 50% and put the scale="2". Will this cheet the flash player?
no, the displayed size counts,

best regards,
Klaus

boxx1

Beginner

  • "boxx1" started this thread

Posts: 16

Location: Estonia

  • Send private message

7

Thursday, May 20th 2010, 7:13pm

Klaus, it is just fantastic. I spent almost a whole day, tilting and spinning the hotspot while there was such a genius algorithm. Thanks, I will definitely take an advantage from it.
And thanks for your help. Everithing is perfect for me now.

Similar threads