Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Lighting help!
Date: Sun, 16 Aug 2009 08:05:20 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 26
Message-ID: <h68ek0$1ce$1@fred.mathworks.com>
References: <h68caa$knd$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1250409920 1422 172.30.248.37 (16 Aug 2009 08:05:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 16 Aug 2009 08:05:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1477385
Xref: news.mathworks.com comp.soft-sys.matlab:563675


I did something but it's half-baked. Any suggestions?

a = [       0            0            0
	0.75            0            0
	0.75          0.2            0
	0          0.2            0
	0            0         0.15
	0.75            0         0.15
	0.75          0.2         0.15
	0          0.2         0.15].*10;

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

lp=patch('vertices',a,'faces',b,'edgecolor','k','facecolor',[.24 .24 .24]+.1,'linewidth',2);

hold on

for k=-.5:.1/2:.5
	
	r = [.75/2+k .1 .195].*10;
	light('Position',r,'style','local')
	
end
axis([-1 1 -1 1 -.5 .5].*10)

lighting phong