help-octave
[Top][All Lists]
Advanced

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

Re: transparent colors?


From: Michael Goffioul
Subject: Re: transparent colors?
Date: Tue, 26 Jul 2011 17:20:05 +0100

Transparency is not supported yet in the OpenGL renderer code.
It was in its JHandles ancestor, but I didn't that part of the code.
The main problem with transparency is that you have to sort fragments
from back to front when rendering, to have the correct blending with
opaque fragments.

Michael.


On Tue, Jul 26, 2011 at 3:44 PM, Uwe Brauer <address@hidden> wrote:
> Hello
>
> I finally solved the problem of my plot.
> The situation is as follows, there are 4 different
> surfaces. I can either plot the surfaces in 4 different
> subplots or together. However when I do the latter then two
> of the surfaces are hidden inside on (the are distorted
> balls).
> In matlab they can be seen since one can specify transperent
> colors. Is there anything similar in octave?
>
>
> Code in question.
> ,----
> | graphics_toolkit fltk
> | [x,y,z]=meshgrid(-20:0.5:20);
> | function Psi=FdOn320(x,y,z)
> | r=sqrt(x.^2+y.^2+z.^2);
> | Psi=exp(-r./3).*(3*z.^2-r.^2).*2*sqrt(15/(120*pi))/81;
> | end
> | Psi=FdOn320(x,y,z);
> | m=min(Psi(:));
> | M=max(Psi(:));
> | color=[1 1 0;1 0 1; 0 1 1;0 1 0;1 0 0; 0 0 1; 0 0 0];
> | n=5;
> | for i=1:n-1
> |     isovalue=m+i*(M-m)/n;
> |     fv = isosurface(x,y,z,Psi,isovalue);
> |     hpatch = patch(fv)
> |     isonormals(x,y,z,Psi,hpatch);
> |     Alphalevel=0.2+0.8*i/n;
> | %    
> set(hpatch,'FaceAlpha',Alphalevel,'FaceColor',color(i,:),'EdgeColor','none')
> |      set(hpatch,'FaceColor',color(i,:),'EdgeColor','black')
> | %    title(strcat('orbital-', num2str(n-i)))
> |      daspect([1,1,1])
> |      view(3);
> |      axis tight
> | end
> |
> `----
>
> Here is the matlab plot, the octave plot is similar but the
> two interior balls cannot be seen.
>
> Uwe Brauer
>
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>
>


reply via email to

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