地學(xué)信息三維可視化實(shí)習(xí)報(bào)告_第1頁
地學(xué)信息三維可視化實(shí)習(xí)報(bào)告_第2頁
地學(xué)信息三維可視化實(shí)習(xí)報(bào)告_第3頁
地學(xué)信息三維可視化實(shí)習(xí)報(bào)告_第4頁
地學(xué)信息三維可視化實(shí)習(xí)報(bào)告_第5頁
已閱讀5頁,還剩4頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、地學(xué)信息三維可視化實(shí)習(xí)報(bào)告班級(jí):姓名:學(xué)號(hào):上交日期:2016.11.16實(shí)習(xí)一1. 利用對(duì)象圖形法創(chuàng)建一個(gè)三維立方體,并將各頂點(diǎn)設(shè)置為不同的顏色對(duì)象法是 IDL5.0引入面向?qū)ο缶幊谈拍詈蟪霈F(xiàn)的,面向?qū)ο蟮幕A(chǔ)也就是對(duì)象類的使用。對(duì)象類允許編程者將數(shù)據(jù)和方法封裝成一個(gè)包,稱之為對(duì)象。一個(gè)對(duì)象類可以重復(fù)利用生成多個(gè)對(duì)象。IDL 的三維坐標(biāo)系使用的是右手笛卡爾坐標(biāo)系,與 Microsoft Direct3D 的左手坐標(biāo)系相區(qū)別,示意圖如下。程序:PRO triangularprism oWindow = OBJ_NEW('IDLgrWindow',dimension =400,4

2、00,retain = 2) oView = OBJ_NEW('IDLgrView',viewPlane_Rect =-1,-1,3,3,zClip = 2,-1,eye = 10) oModel = OBJ_NEW('IDLgrModel') ;創(chuàng)建多邊形 oPoly = OBJ_NEW('IDLgrPolygon') ;設(shè)置對(duì)象層次體系結(jié)構(gòu) oView->add,oModel oModel->add,oPoly ;頂點(diǎn)坐標(biāo) verts = 0,0,0,1,0,0,0,1,0,0,0,1 ;頂點(diǎn)鏈接順序 connect =3,0,1

3、,2,3,0,2,3,3,0,1,3,3,1,2,3 ;設(shè)置多邊形頂點(diǎn)與鏈接關(guān)系,類型顯示為線 oPoly->setproperty,data =verts, polygons = connect,style =1 ;選擇45° oModel->rotate ,-1,0,-1,45 ;繪制顯示 oWindow->draw,oView ;設(shè)置立方體頂點(diǎn)顏色 vertscolor = fix(randomu(undefinevar,3,4)*255) oPoly->setproperty, vert_color = vertsColor oWindow->d

4、raw,oView ;設(shè)置立方體面顯示,并渲染顯示顏色 oPoly->setproperty, shading = 1,style=2 oWindow->draw,oViewEND2. 讀取head.dat中的數(shù)據(jù),進(jìn)行體數(shù)據(jù)的顯示,并實(shí)現(xiàn)切片提取操作iTools 是 IDL6.0 以后版本提供的功能強(qiáng)大的交互式分析工具。IDL 初學(xué)者可以利用這套智能工具快捷輕松地實(shí)現(xiàn)數(shù)據(jù)讀入,數(shù)據(jù)分析和數(shù)據(jù)可視化,并且可以輸出制作令人眩目的精美圖形圖像。有經(jīng)驗(yàn)的 IDL 程序員使用它,可以減少程序開發(fā)工作量,甚至可以在 iTools框架的基礎(chǔ)上創(chuàng)建全新的可視化應(yīng)用環(huán)境。打開iVolume,在 O

5、perations Volume Image Plane中可以選擇切片pro head file = 'C:UserssiyuanDesktopIDL實(shí)習(xí)題第一次課數(shù)據(jù)head.dat' data = READ_BINARY(file, DATA_DIMS = 80, 100, 57) IVOLUME, dataend3.讀取elev_t.jpg圖像以及elevbin.dat中的DEM數(shù)據(jù):l 利用直接圖形法顯示DEM曲面l 利用對(duì)象圖形法創(chuàng)建曲面對(duì)象和紋理對(duì)象并進(jìn)行疊加顯示程序:pro test demfile = 'C:UserssiyuanDesktopIDL實(shí)習(xí)

6、題第一次課數(shù)據(jù)elevbin.dat' dem = read_binary(demfile,data_dims = 64,64) imagefile = 'C:UserssiyuanDesktopIDL實(shí)習(xí)題第一次課數(shù)據(jù)elev_t.jpg' read_jpeg,imagefile,image dem = congrid(dem,128,128,/interp) device,decomposed = 0,retain = 2 window,0,title = 'dem',xsize = 800,ysize = 600 shade_surf,dem om

7、odel = obj_new('idlgrmodel') oview = obj_new('idlgrview') osurface = obj_new('idlgrsurface',dem,style = 2) oimage = obj_new('idlgrimage',image,interleave = 0,/interpolate) ;計(jì)算歸一化顯示比例,并在各個(gè)方向平移-0.5,從而使圖像居中 osurface.getproperty,xrange = xr,yrange = yr,zrange = zr xs = no

8、rm_coord(xr) xs0 = xs0 - 0.5 ys = norm_coord(yr) ys0 = ys0 - 0.5 zs = norm_coord(zr) zs0 = zs0 - 0.5 osurface.setproperty,xcoord_conv = xs,ycoord_conv = ys,zcoord_conv = zs ;曲面上添加紋理對(duì)象 osurface.setproperty,texture_map = oimage,color = 255,255,255 ;構(gòu)建對(duì)象體系 omodel.add,osurface opolygons = OBJ_NEW('i

9、dlgrpolygon', shading = 1, $ data = vertices, polygons = polygons, color = 255,255,255, $ texture_coord=texure_coordinates,texture_map=oimage,/texture_interp) omodel -> add, opolygons & omodel -> ROTATE, 1, 0, 0, -90 omodel -> ROTATE, 0, 1, 0, 30 & xobjview, omodel, /blockend 實(shí)習(xí)

10、二1.繪制函數(shù),其中的網(wǎng)格曲面圖程序:pro surface myvalue=(findgen(100)-50)*0.1 x=rebin(myvalue,100,100,/sample) y=rebin(reform(myvalue,1,100),100,100,/sample) z=-(x2+y2-2)*exp(-(x2+y2)/2) window,title='laplace of gaussian' surface,z,x,yend圖片:2.讀取head.dat中的三維動(dòng)畫數(shù)組,播放該動(dòng)畫,并存儲(chǔ)該動(dòng)畫的像素映射圖程序:pro catoonOPENR,unit,FILEP

11、ATH('head.dat',SUBDIRECTORY='examples','data'),/GET_LUNpro test openr,unit,filepath('C:UserssiyuanDesktopIDL實(shí)習(xí)題第一次課數(shù)據(jù)head.dat'),/get_lun h=bytarr(80,100,57,/nozero) readu,unit,h close,unit xinteranimate,set=80,100,57,/showload for j=0,56 do xinteranimate,frame=j,image

12、=h*,*,j xinteranimate,50,/keep_pixmapsend圖片:3.載入avhrr.png中的數(shù)據(jù),并加以顯示² 將其轉(zhuǎn)換到“Interrupted Goode”投影坐標(biāo)系下,并用iimage命令顯示² 將第一問中得到的地圖轉(zhuǎn)換到“Mollweide”投影坐標(biāo)系下,并用iimage命令顯示pro test file= 'C:UserssiyuanDesktopIDL實(shí)習(xí)題第一次課數(shù)據(jù)avhrr.png' data=read_png(file,r,g,b) red0=rebin(rdata,360,180) green0=rebin(g

13、data,360,180) blue0=rebin(bdata,360,180)iimage,red=red0,green=green0,blue=blue0,dimensions=500,600,view_grid=1,3 smap=map_proj_init('interrupted goode')red1=map_proj_image(red0,map_structure=smap,mask=mask,uvrange=uvrange,xindex=xindex,yindex=yindex) green1=map_proj_image(green0,xindex=xindex,yindex=yindex) blue1=map_proj_image(blue0,xindex=xindex,yindex=yindex)iimage,red=red1,green=green1,blue=blue1,alpha=mask*255b,/view_next mapstruct = map_proj_init( 'mollweide', /gctp ) red2 = map_proj_image( red1, uvrange, image_structure=smap

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論