How to smooth a 3D object..?

3 ビュー (過去 30 日間)
Lalit Patil
Lalit Patil 2012 年 12 月 3 日
I have This text file..
fileID = fopen('data.txt');
C = textscan(fileID, '%f %f %f');
fclose(fileID);
X=cell2mat(C(:,1));
Y=cell2mat(C(:,2));
Z=cell2mat(C(:,3));
patch(X,Y,Z,'R')
view(3)
axis equal off tight vis3d; camzoom(1.2)
colormap(spring)
rotate3d on
From this code i am creating a 3D of an object, now i want to fill the image surface so that it looks like a real smooth object.
So, how to do it..?

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 12 月 3 日
I looked at your data, and I think patch() is really giving the wrong idea of it. If you scatter3() it, then you get a fairly different 3D view, more like a 3D T shape whereas patch fills in part of the T angle giving you large triangles defined completely by their edges (with no interior points defined.)
It should be obvious by examining the data and seeing it jump from 752 back to 1 on the X coordinate that using a single patch is not appropriate. Perhaps using one patch per cycle of X coordinates.
The method for creating a smooth surface is going to depend on which representation is correct. Is it like a T with a door-latch type opening on the crossbar, or are those triangles really there even though they have no interior points?
  1 件のコメント
Lalit Patil
Lalit Patil 2012 年 12 月 3 日
plot3() and scatter3() both are giving a wrong result to me.. Patch gives satisfactory result..
My object is of this kind..

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by