Normal Map Displayed As RGB Values

3 次查看(过去 30 天)
Gilles
Gilles 2013-11-19
编辑: Debanga 2014-1-11
I would like to build a normal map displayed as RGB Values like this example Normal Maps. How can I create Normal Maps with Matlab ?
Thanks.
Kind regards.
Gilles
  1 个评论
Debanga
Debanga 2014-1-11
编辑:Debanga 2014-1-11
% Try this example
[X,Y] = meshgrid(1:.1:100,1:.1:100);
R = sin(Y/1) + eps;
Z = R;
[nx,ny,nz] = surfnorm(X,Y,Z);
b = reshape([nx ny nz], size(nx,1), size(nx,2),3);
b = ((b+1)./2).*255;
imshow(uint8(b));
-DRN

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by