comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Displaying three images simultaneously (using Object Graphics)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Displaying three images simultaneously (using Object Graphics) [message #46227 is a reply to message #46226] Tue, 08 November 2005 10:16 Go to previous messageGo to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Hi Victor,

"Victor" <vmiscellaneous@yahoo.com> wrote in message
news:1131412065.067552.155280@g49g2000cwa.googlegroups.com.. .
> I have 3 images (im1,im2,im3) which I need to display on XObjView (or
> any alternate object graphics viewer). When I tried to add more than 1
> image to the same graphics object as follows:
>> myModel = Obj_New('IDLgrModel')
>> myModel->Add, im1
>> myModel->Add, im2
>
> IDL complains:
> "IDLGRMODEL::ADD: Objects can only have one parent at a time:
> <ObjHeapVar9869(IDLGRCOLORBAR)>"
>
> Huh!

Huh, indeed! I don't see any reason this should happen from what you've said
above. (there are no colorbars mentioned up there)

I see that Antonio and Karl have covered the Position/Location issue, here's
another example that should work fine:

im1=Obj_New('IDLgrImage', BytScl(BIndGen(3, 10, 10)), Location=[-10,10])
im2=Obj_New('IDLgrImage', BytScl(RandomU(seed, 3, 10, 10)))
im3=Obj_New('IDLgrImage', 255B-BytScl(BIndGen(3, 10, 10)), Location=[10,10])
myModel = Obj_New('IDLgrModel')
myModel->Add, [im1, im2, im3]
XObjView, myModel

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

Cheers,
--
-Dick

Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Overlay multiple filled contour plots?
Next Topic: the strange case of readcol.pro in idl 5.6

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 06:21:39 PDT 2025

Total time taken to generate the page: 1.68009 seconds