Copy link to clipboard
Copied
Hi,
I'm using the regular 3D API of flash player 10 and i'm rotating on the Y axis a sprite which contains my bitmap. Although the bitmap.smoothing property is set to true, the bitmap is far from smooth.
Does this happened to someone else?
Any ideas?
Tnx.
I do that dmennenoh, on contentLoaderInfo COMPLETE EVENT i smooth the bitmap in the same way, it even says trace(bitmap.smoothing) true.
I kind've nailed down the problem. It comes from the good old AS3 3D API. You know how when an object has 3d propertis applied to it it creates a matrix3D for it. Well on a picture like this one, that has small 1pixel patterns on it, when the matrix3D != null the image looks like hell even with smoothing = true.
I returned the image's rotationY to 0 and still loo
...Copy link to clipboard
Copied
works for me.
take a screenshot of your unsmoothed object and your smoothed object and attach both here.
Copy link to clipboard
Copied
This is the original image before resizing. It has a pattern on it, that's why i dont like the fuzzy look of it.

This is the image loaded by code and smoothed ( the smoothing property is true at trace).

And this is the image loaded in flash authoring enviroment also smoothed, but by library panel. It clearly looks smoother than the image above.

I'll remove the pattern on the site before i do the screenshot so i won't have this pattern problem, but still the images look different even though the smoothing is applied.
By the way, i assume there isn't any workaround for the artifacts produced by the pattern on the image, is there?
Thanks.
Copy link to clipboard
Copied
i see those differences between smoothing applied to a library bitmap and a loaded bitmap. i don't know any work-around.
Copy link to clipboard
Copied
How are you smoothing it when loading? I tried your image and it clearly looks better when smoothed. I did like so:
var a:Loader = new Loader();
a.load(new URLRequest("sampleImage.jpg"));
a.contentLoaderInfo.addEventListener(Event.COMPLETE, smoothIt);
function smoothIt(e:Event):void
{
var bm:Bitmap = Bitmap(e.target.content);
bm.smoothing = true;
}
Sample below. Image on bottom has the addEventListener line commented out.

Copy link to clipboard
Copied
(my test environment is quirky. sometimes the image is smoothed and sometimes, not.)
Copy link to clipboard
Copied
I do that dmennenoh, on contentLoaderInfo COMPLETE EVENT i smooth the bitmap in the same way, it even says trace(bitmap.smoothing) true.
I kind've nailed down the problem. It comes from the good old AS3 3D API. You know how when an object has 3d propertis applied to it it creates a matrix3D for it. Well on a picture like this one, that has small 1pixel patterns on it, when the matrix3D != null the image looks like hell even with smoothing = true.
I returned the image's rotationY to 0 and still look fuzzy. Than i also made matrix3D = null. And now the image look fine. So the problem is from the matrix3D or the 3D API itself. There's not much of a solution to this problem.
The image is also scaled down from a big image. You know that if you scale down an image that has patterns on it without smoothing applied to it, it look much like my image. Thus when it's a 3D object the smoothing property isn't taken into account. So every time you use an image with patterns and rotate it or move it on Z it will look much like my image.
I found a solution though. If the image is almost or the size of the desired dimension it will not look fuzzy. My image is a 1680x1050 reduced down to 610x380. And it looks fuzzy even with smoothing=true if it's a 3d object. After I resized my image to 610x380 in Irfanview it looks cool.
Hope I didn't bored you to death with my long explanation.
Cheers.
Copy link to clipboard
Copied
Good sleuthing Venian. Actually I was going to mention you should try scaling the graphic so you can use it at 100% in your app. Only when I scaled it down to 50% did I see the pattern emerge... Also, while it is easier to just use roationY for things like this - using Away3D or similar would allow you to smooth the texture properly.
Copy link to clipboard
Copied
Nice use of the word, you dont get to see that kind of vocabulary much lately. Ya i used away3d in other projects but this is a simple 3d rotation on 1 axis, i didn't want to import all those classes just for this kind of a project.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more