using mesh_obj,4 [message #66759] |
Tue, 09 June 2009 13:02 |
astroboy2k
Messages: 34 Registered: July 2007
|
Member |
|
|
Hello all.
I'm trying to generate visualizations of spherical harmonics and have
a question about using mesh_obj to do this. This is the basic code:
data=spher_harm(theta,phi,L,M) ;theta and phi are 32x32 arrays,
located at constant increments of latitude and longitude
oModel = OBJ_NEW('IDLgrModel')
MESH_OBJ, 4, vertices, connectivity, data, /CLOSED
sphericalCoordinates = CV_COORD(FROM_RECT = vertices, /TO_SPHERE)
elevation = REFORM(sphericalCoordinates[2, *], N_ELEMENTS
(sphericalCoordinates[2, *]))
oPalette = OBJ_NEW('IDLgrPalette',r,g,b)
oPolygon = OBJ_NEW('IDLgrPolygon', vertices, POLYGONS = connectivity,
SHADING = 1, $
PALETTE = oPalette)
oModel -> Add, oPolygon
mylight1 = OBJ_NEW('IDLgrLight', TYPE=0, COLOR=[255,255,255]) ;
Ambient white
mymodel = OBJ_NEW('IDLgrModel')
mymodel->Add, mylight1
xsize=400
ysize=xsize
XOBJVIEW, oModel, SCALE = .8, $
TITLE =titl, background=[210,210,210], $
/
just_reg,xsize=xsize,ysize=ysize,xoffset=2200,yoffset=0,stat ionary=mymodel,tlb=tlb
Of course, with most values of L and M the corresponding spherical
harmonic has both positive and negative values. From the
experimentation I've done, it seems like mesh_obj just won't deal with
negative values of "data". Can anyone tell me if I'm correct in
concluding this?
Thanks,
Mark
|
|
|