VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time ]
Subject: (1)Create Graphic Objects - 1


Author:
R.D.
[ Next Thread | Previous Thread | Next Message | Previous Message ]
Date Posted: 05:46:18 03/18/02 Mon
In reply to: R.D. 's message, "Graphic Object 建立" on 05:31:06 03/18/02 Mon

以下為IDL程式碼
-----------------------------------------------------------
;[part I]
myView = OBJ_NEW('IDLgrView', $
VIEWPLANE_RECT=[-125, -125, 250, 250], $
ZCLIP=[250,-250] )

;[part II]
myModel = OBJ_NEW('IDLgrModel')

;[part III]
dd = 50
myShape = OBJ_NEW('IDLgrPolygon', $
Data=[[-dd,-dd],[+dd,-dd],[+dd,+dd],[-dd,+dd]])

;[part IV]
tt = READ_JPEG, 'miho.jpg'
myImage = OBJ_NEW('IDLgrImage', tt)

;;[part V]
myTrackball = OBJ_NEW('Trackball', [125, 125], 125);
-----------------------------------------------------------
以上為IDL程式碼

以上程式碼共分成五個部分
[part I]
透過「OBJ_NEW」函式建立一個'IDLgrView'物件,作為繪圖物件的容器(container),其中包含兩個參數,一為'VIEWPLANE_RECT',其值設為[-125,-125,250,250],表示該視埠(viewport)在左下角的座標為(-125,-125),分別在X、Y方向往右上角延伸250個像素(pixels),構成一個250x250 pixels大小的區域作為視埠。而ZCLIP=[125,-125],則表示該視埠在Z方向(沿著眼睛到螢幕的方向為Z方向,進入電腦為負)為從近處125,遠處-125的空間作為裁切的範圍。

[ Next Thread | Previous Thread | Next Message | Previous Message ]

Replies:
Subject Author Date
(1)Create Graphic Objects - 2R.D.02:08:20 03/26/02 Tue


Post a message:
This forum requires an account to post.
[ Create Account ]
[ Login ]
[ Contact Forum Admin ]


Forum timezone: GMT-8
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.