Discussion:
Changing blend mode for Lines3D
Ruben Gerlach
2010-03-26 16:55:09 UTC
Permalink
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Seb Lee-Delisle
2010-03-27 22:33:18 UTC
Permalink
Hi Ruben,

the issue is that the container property of a DisplayObject3D is not set
until the object has been rendered at least once.

Try this instead :

_lineMaterial = new LineMaterial(0xFFFFFF, 1);
_lines = new Lines3D(_lineMaterial);

_node = new DisplayObject3D();
_node.addChild(_lines);

var vpl : ViewportLayer = _node.createViewportLayer(viewport);
vpl.layerIndex = -1;
vpl.alpha = 0.5;

this worked for me just now when I tried it.

Good luck!

Seb

sebleedelisle.com
twitter.com/seb_ly

On Fri, Mar 26, 2010 at 4:55 PM, Ruben Gerlach <ruben-gerlach-S0/***@public.gmane.org> wrote:

> Hello everyone,
>
>
>
> I am having a hard time setting an alpha value for a Lines3D object. I am
> using it to visualize a curve in 3d space and I want it to have an alpha
> value of 0.5. As I use a size round about 15 for the lines, they overlap
> each other leading to differences in the opacity of the curve. Normally I
> would be able to avoid this behavior by setting the blend mode of the
> including container to BlendMode.LAYER but in this case this does not work.
>
>
>
> This is the code I currently use to create the scene:
>
>
>
> _lineMaterial = new LineMaterial(0xFFFFFF, 1);
> _lines = new Lines3D(_lineMaterial);
>
> _node = new DisplayObject3D();
> _node.addChild(_lines);
>
> _node.createViewportLayer(viewport).layerIndex = -1;
> _node.container.alpha = 0.5;
>
>
>
> As you can see I create a viewport layer to sort my objects manually. I
> have tried all combinations of setting the blend mode or the alpha value at
> different layers, objects or groups, but the effect is always the same. I
> also have tried using useOwnContainer, also with no difference. Of course I
> tried to set the alpha value in the LineMaterial as well. Actually I tried
> everything that came to my head for several hours without any success, so
> this post is my last hope. Is there a way to achieve a blending without any
> overlapping traces? As there are other objects in my scene, setting the
> alpha and blend mode for the whole viewport is not an option (allthough it
> works beside the fact that all objects have alpha then)
>
>
>
> Thanks a lot,
>
> Ruben
>
>
>
>
>
>
> GRATIS fÃŒr alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://movieflat.web.de
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D-***@public.gmane.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
Ruben Gerlach
2010-03-29 09:00:15 UTC
Permalink
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Seb Lee-Delisle
2010-03-29 09:13:48 UTC
Permalink
Loading...