你的問題沒有得到很好的所有定義。例如,你的輸出有什麼不好?
而且我甚至不問你想要的3D模型的定義。在可以切割橫截面的完整3D模型和適用於3D可視化的3D外表面之間,我想你是在談論後者(對於第一種選擇,方法會完全不同)。
關於最終輸出渲染,我可以給出一些關於如何使用紋理映射的指針 ...這些類型的項目非常有用的功能。與第一紋理
簡單的紋理貼圖,我能找到對谷歌可以給你這種結果:
下面的代碼(請注意,我定義我的領域稍有不同你但是這只是個人的選擇):
%% // generate unit sphere and prepare figure
[x,y,z] = sphere();
hf=figure('Color','w') ;
axis equal, grid off , axis off , hold on
%% // Define the main globe coordinate and generate surface
rMain = 5;
xm = x*rMain ;
ym = y*rMain ;
zm = z*rMain ;
mainGlobe = surf(xm, ym, zm, 'edgecolor', 'none' ,'FaceAlpha',0.5) ;
%% // Define the Iris sphere and generate surface
rIris = 2.5 ;
cutoff = ceil(size(x,1)/2) ; %// calculated to get a half sphere (better result for later texture mapping)
xi = x(:,cutoff:end) * rIris ;
yi = y(:,cutoff:end) * rIris /3 + (rMain-rIris)*1.7 ;
zi = z(:,cutoff:end) * rIris ;
irisGlobe = surf(xi, yi, zi , 'edgecolor', 'none');
注意的鳶尾,我開始用半球體,然後我將其壓縮到Y
方向(並將其翻譯爲將其定位在主球體的外表面上)。這可以更好地渲染紋理映射。
你有兩個表面,現在應用紋理映射可以是非常簡單的任何東西(我會舉一個簡單的例子),相當乏味...取決於所需的結果和你必須使用的圖像。
對於第一個示例,我將使用2個圖像,一個用於眼球,另一個用於虹膜。圖像將在帖子末尾提供。
%% Apply texture mappings
imgIris = imread('Iris03.jpg') ; %// read Iris texture image
imgGlobe = imread('globe02.jpg') ; %// read Globe texture image
%// (optional) mirror globe image to repeat pattern (and increase definition)
CDglobe = [imgGlobe flipdim(imgGlobe,2)] ;
%// apply mapping
set(mainGlobe,'FaceColor','Texturemap','Cdata',CDglobe,'FaceAlpha',0.5)
set(irisGlobe,'FaceColor','Texturemap','Cdata',imgIris,'edgecolor', 'none')
%// texture mapping in default direction produce blood vessel in `Z`
%// direction mainly, so to have them departing from the Iris, we just
%// rotate the main globe by 90 degree (or we could also rotate the
%// image beforehand ...)
rotate(mainGlobe,[1 0 0],-90)
由於具有相同的形狀(表面),但紋理不同,所以可以獲得相當不同的結果。例如:
imgIris = imread('Iris01.jpg') ; %// read Iris texture image
imgGlobe = imread('globe01.jpg') ; %// read Globe texture image
%// mirror globe image to repeat pattern (and increase definition)
nrep = 3 ;
CDglobe = repmat([imgGlobe flipdim(imgGlobe,2)], [1 nrep 1]) ;
%// apply mapping
set(mainGlobe,'FaceColor','Texturemap','Cdata',CDglobe,'FaceAlpha',0.5)
set(irisGlobe,'FaceColor','Texturemap','Cdata',imgIris,'edgecolor', 'none')
將爲您帶來上述第二組眼圖示例。注意我是如何在應用它們之前複製紋理數據的,它允許在眼睛周圍重複圖案,而不是隻有一次。您可以使用nrep
重複因子來獲得不同的結果。
如果你想要一個更凸出的光圈,您可以使用其中yi
定義線的變化(這就是球被壓縮和offseted)。例如,具有另一質感和這一行:
yi = y(:,cutoff:end) * rIris + (rMain-rIris)*1.7 - 1.1 ;
所得鳶尾稍微突出:
用於紋理的圖像被這裏給出。在互聯網上有一個gazillion圖像可以提供更好的結果。無論是合成圖像(純計算機圖形)或真實之眼/虹膜圖像,只是要注意,許多圖像可能具有版權,你將不得不尊重......
雙方合作諒解備忘錄se,人體模型和惰性氣體是人類的好模型。您需要哪一個取決於應用程序以及您想要建模的內容。那麼你以後是什麼樣的模特? (不管怎麼說,你的問題可能是非常關注的話題) –
無論如何,你可能需要[一個大的球體和一個突出的小球體](https://www.google.hu/search?q=3d +眼+模型&客戶= ubuntu的&HS = CZ3&信道= FS&源= LNMS&TBM = isch)。 –
@AndrasDeak,感謝您的回覆,我編輯了我的問題,並上傳了迄今爲止完成的圖像,現在可以幫助我更好地實現更好的模型。 –