フィルターのクリア

How do I use texture map on a patch object ?

16 ビュー (過去 30 日間)
martin nguyen
martin nguyen 2023 年 5 月 22 日
回答済み: Voss 2023 年 8 月 23 日
Hello everybody,
I would like to know if I can use an image as a texturemap for a patch object. I know that it works with a surface but I can't find an equivalent for a patch object.
Exemple of an image with texturemap on a surface :
load topo topo topomap1 % load data
[x,y,z] = sphere(50); % create a sphere
s = surface(x,y,z); % plot spherical surface
s.FaceColor = 'texturemap'; % use texture mapping
s.CData = topo; % set color data to topographic data
s.EdgeColor = 'none'; % remove edges
s.FaceLighting = 'gouraud'; % preferred lighting for curved surfaces
s.SpecularStrength = 0.4; % change the strength of the reflected light
light('Position',[-1 0 1]) % add a light
axis square off % set axis to square and remove axis
view([-30,30]) % set the viewing angle
Regards
Martin Nguyen

採用された回答

Voss
Voss 2023 年 8 月 23 日
No.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by