octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39535] FaceAlpha property not working for Ope


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #39535] FaceAlpha property not working for OpenGL backend
Date: Sun, 12 Mar 2017 13:13:21 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0

Update of bug #39535 (project octave):

                  Status:               Confirmed => Patch Submitted        
        Operating System:               GNU/Linux => Any                    

    _______________________________________________________

Follow-up Comment #5:

Attached is a patch that adds some very primitive support for alpha on faces
of patch objects. It does not include any sorting primitives. However, it
might give better results than the current implementation (which hides patches
with alpha != 0) in very simple cases as the ones from bug #50520:

graphics_toolkit("qt")
figure
rectangle("position", [0.2 0.2 0.5 0.4], "facecolor", "g", "FaceAlpha",.3)
rectangle("position", [0.3 0.1 0.3 0.6], "facecolor", "y", "FaceAlpha",.3)
axis([0 1 0 1])


or bug #46538:

T =[
1 2 4
2 3 5
4 5 7
5 6 8
5 4 2
6 5 3
8 7 5
9 8 6];

P = [
0.00000 0.00000 0.00000 0.50000 0.50000 0.50000 1.00000 1.00000 1.00000
0.00000 0.50000 1.00000 0.00000 0.50000 1.00000 0.00000 0.50000 1.00000];

x = P(1,:); y = P(2,:);
z = 1 - (x-0.5).^2 - (y-0.5).^2;
i=1:length(T);

a1 = [ x(T(i,1)) ; y(T(i,1)) ; z(T(i,1)) ];
a2 = [ x(T(i,2)) ; y(T(i,2)) ; z(T(i,2)) ];
a3 = [ x(T(i,3)) ; y(T(i,3)) ; z(T(i,3)) ];

s = ( a1(1:2,i) + a2(1:2,i) + a3(1:2,i) )./3;

r1 = a3(:,i) - a1(:,i);
r2 = a2(:,i) - a1(:,i);
n = cross(r1,r2);

dx = n(1,:)./n(3,:);
%dy = n(2,:)./n(3,:);

patch('Faces',T,'Vertices',P','FaceVertexCData',dx','FaceColor','flat','FaceAlpha',.8);


or the one in comment #0.

Since no sorting primitives are included, it fails with more complex layouts
as in:

[x,y,z] = meshgrid (-2:0.2:2, -2:0.2:2, -2:0.2:2);
val = x.^2 + y.^2 + z.^2;
fv1 = isosurface (x, y, z, val, .6);
patch (fv1, "FaceAlpha", .3, "FaceColor", "r", "EdgeColor", "none");
fv2 = isosurface (x, y, z, val, 1);
patch (fv2, "FaceAlpha", .3, "FaceColor", "g", "EdgeColor", "none");


It also only adds support for double valued "FaceAlpha". "flat" or "interp"
skip rendering the faces (like without the patch).

Even if this is by far no complete implementation of transparency, this very
limited support might be helpful in some use cases.

(file #39977)
    _______________________________________________________

Additional Item Attachment:

File name: bug39535_patch_facealpha.patch Size:2 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39535>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]