Image texture on face vertice 3D Model
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'd like to texture a 3D model described by faces and vertices with an image.
Therefore I tried with the MATLAB method surface like this:
% definition of faces and vertices above
n = length(vertices)/3;
X = reshape(vertices(:,1),3,n);
Y = reshape(vertices(:,2),3,n);
Z = reshape(vertices(:,3),3,n);
img = imread('image.png'); % mandrill image
surface(X,Y,Z,...
'Cdata', img,...
'FaceColor','texturemap',...
'EdgeColor','none',...
'FaceLighting','gouraud')
But this doesn't really work as my 3D Model has lots of 'empty' faces:
Same happens using the method warp like this:
warp (X,Y,Z,img)
Is this a MATLAB bug or am I doing something wrong?
0 comentarios
Respuestas (1)
Walter Roberson
el 14 de En. de 2021
If you have empty faces, then nothing can be drawn there.
Perhaps you should use boundary() https://www.mathworks.com/help/matlab/ref/boundary.html with a shrink factor, in order to get the outside layer connections (like a tight-fitting bounding box) and texture on top of that.
0 comentarios
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!