On Tue, 08 Nov 2005 18:16:12 +0000, Dick Jackson wrote:
> Now, this gives the images rendered nicely at first but has the odd
> behaviour of IDLgrImages if you rotate the view. They don't rotate, they
> stretch and squish. If you really want images that can rotate, you'll need
> to make a polygon that contains each, something like this:
>
> im1=Obj_New('IDLgrImage', BytScl(BIndGen(3, 10, 10)))
> im2=Obj_New('IDLgrImage', BytScl(RandomU(seed, 3, 10, 10)))
> im3=Obj_New('IDLgrImage', 255B-BytScl(BIndGen(3, 10, 10)))
> poly1=Obj_New('IDLgrPolygon', [[-10,10],[0,10],[0,20],[-10,20]], $
> Color=[255,255,255], Texture_Map=im1, $
> Texture_Coord=[[0,0],[1,0],[1,1],[0,1]])
> poly2=Obj_New('IDLgrPolygon', [[0,0],[10,0],[10,10],[0,10]], $
> Color=[255,255,255], Texture_Map=im2, $
> Texture_Coord=[[0,0],[1,0],[1,1],[0,1]])
> poly3=Obj_New('IDLgrPolygon', [[10,10],[20,10],[20,20],[10,20]], $
> Color=[255,255,255], Texture_Map=im3, $
> Texture_Coord=[[0,0],[1,0],[1,1],[0,1]])
> myModel = Obj_New('IDLgrModel')
> myModel->Add, [poly1, poly2, poly3]
> XObjView, myModel
I should point out that starting with IDL 6.2, IDL renders images using
texture-mapped polygons, doing some of the steps above for you. Further,
there is a new TRANSFORM_MODE property that will treat the image as a
polygon during transforms, instead of just transforming the opposite
corners and making a new 2D box from the new corner locations.
|