Why can't I generate a sphere with a material?
1 view (last 30 days)
Show older comments
Hi!
The following is my code. I intended to generate a sphere with a material shiny but I could't make it. Can anyone to tell me what lines I need to put in or modify?
Thank you.
[X,Y,Z]= sphere;
x2 = X.*50;
y2 = Y.*50;
z2 = Z.*50;
h = surf(x2,y2,z2);
material shiny;
axis vis3d off
set(h,'LineWidth',1.5);
This is what I want. Shiny. But I can't make it.
sphere(50); shading flat;
light('Position',[1 3 2]);
light('Position',[-3 -1 3]);
material shiny;
axis vis3d off;
0 Comments
Accepted Answer
DGM
on 30 Jan 2022
Edited: DGM
on 30 Jan 2022
Set up the lights.
[X,Y,Z]= sphere(20);
x2 = X.*50;
y2 = Y.*50;
z2 = Z.*50;
h = surf(x2,y2,z2);
light('Position',[1 3 2]);
light('Position',[-3 -1 3]);
material shiny;
axis vis3d off
FWIW, the default material is pretty shiny already, but you can always tweak the constants individually if you want.
0 Comments
More Answers (0)
See Also
Categories
Find more on Assembly in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!