jPCT - a 3d engine for Java > Support

Polylines transparency issue

(1/1)

Jakes:
Hello, I've been working around with Polylines and it seems that the method Polyline.setPercentage(float) is not working properly or might be something I am missing. For any value other than 1 the line turns fully invisible.

Is this an issue?

EgonOlsen:
I don't think so. setPercentage(<float>) isn't about transparency, it's about how much (in terms of length) is visible of the polyline. But because it can't cut a line segment in half, it can only make full segments visible or invisible. That means that a Polyline that consists of a single line segment, will only be visible at 100%.

For transparency, there's actually the setTransparencyMode() method to enable it and the color attribute of a Polyline to set the desired value.

EgonOlsen:
Like so:


--- Code: ---Polyline pl=new Polyline(line, new Color(255,255,255,100));
pl.setWidth(10);
pl.setTransparencyMode(Object3D.TRANSPARENCY_MODE_DEFAULT);

--- End code ---

Jakes:
Ah ok, so it uses the alpha channel of the color for the transparency. Thanks

Navigation

[0] Message Index

Go to full version