MATLAB Answers

Lighting only certain surfaces

15 views (last 30 days)
Theo
Theo on 12 Oct 2011
I'd like to create a lit sphere, to be placed on an unlit surface. For example,
membrane;
[x,y,z] = sphere(40);
hold on;
surf(0.1*x,0.1*y,0.1*z+1);
light % lights everything!
The last command lights everything, but I just want to light the sphere. How would I do that?

  0 Comments

Sign in to comment.

Accepted Answer

Sean de Wolski
Sean de Wolski on 12 Oct 2011
Manually set the facelighting property of each object:
Z = membrane;
H(1) = surf(Z);
[x,y,z] = sphere(40);
hold on;
H(2) = surf(0.1*x,0.1*y,0.1*z+1);
set(H(1),'facelighting','none');
set(H(2),'facelighting','phong');
light % lights everything!

  1 Comment

Theo
Theo on 12 Oct 2011
Brilliant! Thanks

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags