View Full Version : partly mask an hotspot while the other parts stay visible: how?
phberlin
12-15-2008, 12:17 AM
Hello everyone,
I have a (hopefully) simple question -- maybe someone can point me to the right direction?
I am trying to "mask" a part of a hotspot (e.g. make a part invisible while the other areas of the hotspot stay visible). In my understanding, this is what blendMode "alpha" is meant for? Anyway, I'm obviously too dumb to get it done...
I have two hotspots, both are distorted box objects. Hotspot A (the one to be masked) has depth = 1, hotspot B (the mask) has depth = 2. I gave hotspot A "layer" as blendMode and made hotspot B's blendMode "alpha". Hotspot B ( a JPG file) is either completely black or white (I tried both), but nothing happens...
Huh, can anyone tell me how to do this? (Since my hotspot A is actually a FLV video, I can't give it an alpha mask directly).
Pleeeeeeeease, help me. I know it must be possible -- but how?
Thanks in advance, Philipp
phberlin
12-16-2008, 04:31 PM
Hhm, more than 90 visits and nobody has a clue? I'd really appreciate an answer here, since this would be most useful in so many cases. I can't believe that I am the only person trying to use alpha masks, am I?
Panorado
12-18-2008, 05:24 PM
Philipp, Sorry if I am way off... but thinking about it, maybe like this? (you mean like putting a video in a TV set like in the "Adding Some Life" example?).
I would... create a .swf file and load it as a hotspot. In the .swf you could create your "mask" and the .swf could load the video. (I know not many people use SwishMax but...) in SwishMax I can just say, "use bottom item as mask", create the .swf and "bam" it is masked in FPP.
phberlin
12-19-2008, 11:38 AM
Hey Panorado,
thanks for your reply. Indeed, I've never thought of this possibility and it's well worth a try :-) The video I have now is an FLV that I load using the FLVplayer. I need masking because I do not want to have a regular (rectangular) shape, but an irregular outline of the video (to mimic traffic in front of a window with an arc, for example).
I'll give it a go as soon as I have figured out how to do it the way you propose :-) (I do not know a lot about Flash or SwishMax; in fact, I only have a trial version of Flash on my machine).
Thanks again, Philipp
christophe
12-19-2008, 11:58 AM
Hello,
I'm trying to understand what you really need.
In fact you want to hide a flv video (a) with a jpg (b), am i right ?
If yes, it 's easy by changing the flv url when click.
If no, please, try to tell us more or give a link to feel better the situation.
Regards
phberlin
12-19-2008, 04:36 PM
Hi Christophe, thanks for your reply. I haven't anything online yet (it's just an experiment yet without something to show), so unfortunately I can't provide a link. But it's easy to explain what I want to achieve:
Imagine you have a normal panorama showing the interior of a room inside a building. This room has a window. This window has an arc, so it's not rectangular. So, now I want to show a FLV (or in what ever format) video "inside" the window to simulate the moving traffic outside. Because of the window's shape (and because I only want to make the "glass areas" visible), I can not simply put the video in place, but have to mask those parts that are to be invisible. Please see my attached sketch (most likely not the best sketch ever made, haha), maybe that makes it more understandable.
I think it must be possible to mask parts of a video -- most likely I am only to dumb to find out how to :-)
Thanks to everyone!
Philipp
siesfor
12-19-2008, 04:53 PM
couldn't you just create a png of the window (and however much of the wall you need to cover the flv) with the glass part made transparent and placed over top of the flv?
phberlin
12-19-2008, 05:01 PM
I'll have to try that. But I'm afraid it's going to be a problem to make that PNG fit onto the panorama without a visual offset, especially because it needs to be distorted to be in the right place. I asked Denis already in September to provide a possibility to position elements on a pixel exact level (rather than by alignX and Y which is not accurate enough). He promised to implement it, but recently he told that he only made it part of v2.4 while he didn't have time to make it useable in the current version...
siesfor
12-19-2008, 05:06 PM
check out Corvus' solution in this thread from a couple weeks back, I think it'll help you out.
http://flashpanoramas.com/forum/showthread.php?t=1939
Panorado
12-19-2008, 05:58 PM
Yep, in the situation described, just put a 'transparent' png. over the top (of course cutting out the middle where you want the video to show through). I really try to avoid laying pictures over in the exact spot... man... that is hard... but as siesfor suggested, that thread is a good explanation. Usually when I want to put video in... I'll create a 'new' object in the room or place so I don't have to align it perfectly.
christophe
12-19-2008, 07:44 PM
Yes it's exactly the way !
Take the cube side where the window is?
Make a hole to have the transparence, save it in png file (mask.png), with editor you place it exactly over the wall and the window with a depth higher than the video and :
Something like this Approximately
<box id="video" url="" alt="open window and take a look outside" pan="TheGoodOneOverTheWall" tilt="TheGoodOneOverTheWall" distance="1" orientation="TheGoodOneOverTheWall" rotationZ="2.00" alignX="-0.54" alignY="-0.46" depth="7" scaleX="0.51" scaleY="0.38" saturation="0.1" contrast="0.2" refreshRate="20" segmentsX="6" segmentsY="4" />
<box id="mask" url="images/mask.png" onLoad="alpha=0" pan="...theGoodOne" tilt="...theGoodOne" distance="1" orientation="theGoodOne" depth="8" useHandCursor="0"
onClick="go_video"
go_video="mask.alpha=1,100; video.alpha=1,700; vid.url=flvplayer.swf?file=traffic.flv; alt=close the window; onClick=close_video"
close_video=" alt=open window and take a look outside; timer+=1,700,,shut; onClick=openvid;"
shut="video.url=,700; mask.alpha=0,800;" />
Hope it will help.
Regards
Christophe
christophe
12-19-2008, 07:48 PM
oops ! forget about some "saturation" and "contrast" or whatever, it was a paste of an old mine.
phberlin
12-20-2008, 12:09 AM
Thanks everyone. I've played around with a transparent PNG, made from the respective cube face with a "hole" to let the video look through. Already looks pretty good. I only have to get the image layer align really perfectly -- maybe I can fix that when reading the mentioned thread (did not have time to look at yet). So again, thanks to everyone here! Great forum...
Philipp
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.