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

Home » Public Forums » archive » Map grid in object graphics
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Map grid in object graphics [message #39997] Mon, 28 June 2004 13:34
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Hi,
yes, it's me again and I ran into this problem... :-) Ok, I did this fancy
map projection program in direct graphics, but the nicely warped image lies
completely in the shadow of the ugly fonts available in direct graphics (if
you know what I mean). So, I tried to do this in object graphics, and
actually the map image itself looks fine. But this is only because the IDL
image processing guide had the appropriate example in it. Now, I am trying
to overlay the map grid on the object, and I am ready to throw my laptop
across the hallway. But before I do that I want to ask, if someone can help
me instead. The relevant code is shown below and I assume that all I have to
add is an idlgrcontour object. Or do I have to use idlgrpolygon instead. I
would appreciate a simple example. You could save a laptop's life! :-)))

Thanks and Cheers,
Haje

; create mesh
mesh_obj,4,vertices,polygons,replicate(1,xdim,ydim),p1=-180, p2=180,/degree

; creating a model object to contain the display.
omodel=obj_new('idlgrmodel')

; creating image
oimage=obj_new('idlgrimage',wmap)

; deriving texture map coordinates.
xvector=findgen(xdim)/(float(xdim)-1)
yvector=findgen(ydim)/(float(ydim)-1)
texture_coord=fltarr(2,xdim,ydim)
texture_coord[0,*,*]=xvector#replicate(1.,ydim)
texture_coord[1,*,*]=replicate(1.,xdim)#yvector

; creating the polygon object containing the data.
opolygons=obj_new('idlgrpolygon',shading=0, $
data=vertices,polygons=polygons, $
color=[255,255,255], $
texture_coord=texture_coord, $
texture_map=oimage,/texture_interp)

; adding polygon to model container. note: the polygon
; object already contains the texture map image and its
; related palette.
omodel->add,opolygons

; rotating model
omodel->rotate,[0,0,1],-90

; displaying results.
xobjview,omodel,xsize=600,ysize=600,/block

; cleaning up object references.
obj_destroy,[omodel,oimage]

--
Dr. Haje Korth
Space Physics Group
The Johns Hopkins University
Applied Physics Laboratory
MS MP3-E128
11100 Johns Hopkins Road
Laurel, MD 20723-6099
USA
Phone: 240-228-4033 (Washington), 443-778-4033 (Baltimore)
Fax: 240-228-0386 (Washington), 443-778-0386 (Baltimore)
e-mail: haje.korth@jhuapl.edu
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 3d projection of a stack images
Next Topic: Can I use HISTOGRAM to do this?

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

Current Time: Fri Oct 10 05:40:15 PDT 2025

Total time taken to generate the page: 0.63757 seconds