Hi all,
I've now learned how to replace cube faces using AS3 code, and I know how to stack panos on top of each other, so now I want to make 'see through' windows.
For this I've made a replacement cubeface with a transparent area in Photoshop, and I've saved it as PNG24 with an alpha channel.
Then I modified my preloader so it loads this new PNG24 cubeface, and replaces one of the original cubefaces with it.
So far, so good.
However, to my disappointment the transparent area is no longer transparent in the pano, it becomes white.
Here's a screenshot:
(I made the foremost pano a little bit translucent to show that there is indeed a pano behind it)
Does anyone know why that is so?
What can I do to retain transparency in that cubeface?
I sure hope someone has the answer, it would be a real pity if this couldn't be made to work.
Cheers!
Erik
edit: new screenshot with more clearly marked 'windows' and text painted on the .png before replacing cube face.
Transparency in cube faces?
-
- Posts: 470
- Joined: Sat Sep 09, 2006 10:51 am
- Contact:
Last edited by erik leeman on Tue Jan 26, 2010 7:52 pm, edited 1 time in total.
My guess is that the AS3.0 in the original file creates shapes filled with color before they are mapped with raster images, so there is a solid based below each JPG. We can't see it while panorama is full loaded but the semi transparent PNG reveals it. There should be a property or variable that control it, but you would have to ask Thomas what are the names in order to control it from outside.
regards
regards
Also, you might want to try using WMODE to set the player transparency ON, perhaps what you see the player based control by object/embed tags...
-
- Posts: 470
- Joined: Sat Sep 09, 2006 10:51 am
- Contact:
I tried wmode="transparent" and <param name="wmode" value="transparent">,
but, as I expected, that didn't do anything.
I guessed it wouldn't because I have light grey as background colour in my embedding code, not white.
Besides, I don't want the HTML-background to be visible (although I imagine that could be useful in some cases), but the other pano!
What I think is my problem, is that Thomas probably set the transparency parameter in his BitmapData specs to 'false'.
And why shouldn't he? How could he have anticipated that one day a fool would attempt to load multiple panos, stack them on top of each other, and make little peep holes in them?
I don't think I would have.
This is a bit of the code I use to load the .png24 (with alpha channel) into the pano:
As (some of) you can see, I set the transparency parameter to 'true', so that should work fine.
Unless I f*cked up of course, being the AS3 nitwit that I am.
The cubeface is loaded allright, the original one is replaced as it should, so my code as such seems to be ok.
I asked Thomas about this, I hope he can tell me what to do (if anything).
Cheers!
Erik
ps: sorry, I didn't try a transparent GIF, it would be a true miracle if that would work ; )
but, as I expected, that didn't do anything.
I guessed it wouldn't because I have light grey as background colour in my embedding code, not white.
Besides, I don't want the HTML-background to be visible (although I imagine that could be useful in some cases), but the other pano!
I think you are right Sebastian.My guess is that the AS3.0 in the original file creates shapes filled with color before they are mapped with raster images, so there is a solid based below each JPG.
What I think is my problem, is that Thomas probably set the transparency parameter in his BitmapData specs to 'false'.
And why shouldn't he? How could he have anticipated that one day a fool would attempt to load multiple panos, stack them on top of each other, and make little peep holes in them?
I don't think I would have.
This is a bit of the code I use to load the .png24 (with alpha channel) into the pano:
Code: Select all
function onImageLoader(evt:Event):void {
var myBitmapData = new BitmapData(imageLoader.width, imageLoader.height, true);
myBitmapData.draw(imageLoader.content);
var bmp:Bitmap = new Bitmap();
bmp.bitmapData = myBitmapData;
vrB.pano.bmpTile[0] = bmp.bitmapData;
}
Unless I f*cked up of course, being the AS3 nitwit that I am.
The cubeface is loaded allright, the original one is replaced as it should, so my code as such seems to be ok.
I asked Thomas about this, I hope he can tell me what to do (if anything).
Cheers!
Erik
ps: sorry, I didn't try a transparent GIF, it would be a true miracle if that would work ; )
-
- Posts: 470
- Joined: Sat Sep 09, 2006 10:51 am
- Contact:
Solved the problem
Posted details in a different thread (http://gardengnomesoftware.com/forum/vi ... 030#p15916)
Here's a screenshot of my testpano showing transparent areas where the pano behind it is visible:
Erik
Posted details in a different thread (http://gardengnomesoftware.com/forum/vi ... 030#p15916)
Here's a screenshot of my testpano showing transparent areas where the pano behind it is visible:
Erik
-
- Posts: 470
- Joined: Sat Sep 09, 2006 10:51 am
- Contact:
Here's an example of an interior with transparent windows:
http://tinyurl.com/Pano2VR-SwitchView
Just click on the red buttons (both of them).
The outside view that is revealed does not move exactly in sync with the interior, instead it moves in a way that simulates the natural parallax that happens when you move your head.
In this demo I exaggerated the parallax effect on purpose to make it more noticeable, it should of course be a lot more subtle to be realistic.
This is just one example of what can be done with transparency, Pano2Vr, and ActionScript3, there's soooo much more you could do!
Cheers!
Erik
http://tinyurl.com/Pano2VR-SwitchView
Just click on the red buttons (both of them).
The outside view that is revealed does not move exactly in sync with the interior, instead it moves in a way that simulates the natural parallax that happens when you move your head.
In this demo I exaggerated the parallax effect on purpose to make it more noticeable, it should of course be a lot more subtle to be realistic.
This is just one example of what can be done with transparency, Pano2Vr, and ActionScript3, there's soooo much more you could do!
Cheers!
Erik