Thread Subject: light & transparency problem

Subject: light & transparency problem

From: Per Sundqvist

Date: 20 Aug, 2008 13:14:02

Message: 1 of 2

Hi, I have a problem to get some surfaces transparent, but
not shine with light, combined with objects that gets light
but have no transparency. Below is my code:

figure(1), clf reset;
[XX,YY,ZZ]=sphere(15);
surf(3+1*XX,4.5+1*YY,1*ZZ);shading interp;hold on;
surf(6+1*XX,4.5+1*YY,1*ZZ-1);shading interp
lighting phong;light;

[X,Y]=meshgrid([0 9],[0 9]);Z=0*X;
hnd=surf(X,Y,Z);shading interp
alpha(hnd,0.7)
axis equal;axis tight;

This looks awful, everything turns white more or less. Is
there some kind of handle to light, or how should I do?

I want the spheres with light & non transparent. The plane
should be transparent and have no light on it. Any idea? Any
help appreciated.

Per

Subject: light & transparency problem

From: Adam

Date: 20 Aug, 2008 13:23:02

Message: 2 of 2

"Per Sundqvist" <sunkan@fy.chalmers.se> wrote in message
<g8h5aq$par$1@fred.mathworks.com>...
> Hi, I have a problem to get some surfaces transparent, but
> not shine with light, combined with objects that gets light
> but have no transparency. Below is my code:
>
> figure(1), clf reset;
> [XX,YY,ZZ]=sphere(15);
> surf(3+1*XX,4.5+1*YY,1*ZZ);shading interp;hold on;
> surf(6+1*XX,4.5+1*YY,1*ZZ-1);shading interp
> lighting phong;light;
>
> [X,Y]=meshgrid([0 9],[0 9]);Z=0*X;
> hnd=surf(X,Y,Z);shading interp
> alpha(hnd,0.7)
> axis equal;axis tight;
>
> This looks awful, everything turns white more or less. Is
> there some kind of handle to light, or how should I do?
>
> I want the spheres with light & non transparent. The plane
> should be transparent and have no light on it. Any idea? Any
> help appreciated.
>
> Per
>

I don't see every thing turn to white.

hLight = light; % returns handle to light object

This turns off lighting on the surface:
set(hnd, 'Facelighting', 'none')

~Adam

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com