Map texture to patch

版本 1.1.0.0 (2.3 KB) 作者: Jonas
patchTexture maps a texture onto a patch object
1.6K 次下载
更新时间 2010/6/2

查看许可证

SYNOPSIS: patchTexture(patchHandle,texture)

INPUT
patchHandle: handle to patch object
texture: texture to map onto the surface defined via patch
Texture can be a grayscale or an RGB image

OUTPUT
none - the texture is mapped onto the patch identified by
patchHandle by reading the image at the [x,y] coordinates
of the vertices of the patch. The vertex coordinates are
rescaled so that a maximum of the image can be read.

EXAMPLE
[xx,yy,zz] = ndgrid(-100:100,-100:100,-100:100);
img = xx.^2 + yy.^2 + zz.^2 < 99^2;
img = convn(img,ones(5,5,5)/(5*5*5));
p = isosurface(img,0.5);
ph = patch(p);
set(gca,'visible','off')
axis equal
texture = imread('autumn.tif');
patchTexture(ph,texture)
view(58,82)

SEE ALSO patch, surface

引用格式

Jonas (2024). Map texture to patch (https://www.mathworks.com/matlabcentral/fileexchange/27764-map-texture-to-patch), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Fixed a bug due to a missing function (thanks Ken, for reporting!). Also, updated the function so that one texture can be applied to several patches at once.

1.0.0.0