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

Home » Public Forums » archive » Re: Displaying Cartesian coordinate data on a sphere
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 Cartesian coordinate data on a sphere [message #82412] Wed, 12 December 2012 01:53 Go to previous message
dplatten is currently offline  dplatten
Messages: 32
Registered: December 2007
Member
I have found the following solution to be more reliable. It uses the /GRID, XOUT and YOUT switches to ensure that the resulting grid covers the whole sphere. I've realised that the coordinates of the resulting grid are in terms of longitude and latitude. To ensure that I finished up with a grid that covers the entire surface of a sphere I set XOUT to cover a range of +/- PI radians, and YOUT to cover +/- PI/2 radians.

x = [0, 0, 1, -1, 0, 0]
y = [0, 0, 0, 0, 1, -1]
z = [1, -1, 0, 0, 0, 0]
values = [255, 0, 100, 50, 0, 150]
maxOut = 2.0*!pi
xout = FINDGEN(31) * 2.0*!pi / 30.0 - (2.0*!pi / 2.0)
yout = FINDGEN(31) * !pi / 30.0 - (!pi / 2.0)
grid = GRIDDATA(x, y, z, values, /GRID, XOUT=xout, YOUT=yout, /SPHERE)
cgLoadCT, 33
cgWindow, 'cgImage', grid, /KEEP_ASPECT

image = BYTSCL(grid)
MESH_OBJ, 4, vertices, polygons, REPLICATE(0.25, 101, 101)
oModel = OBJ_NEW('IDLgrModel')
oPalette = OBJ_NEW('IDLgrPalette')
oPalette -> LOADCT, 33
oPalette -> SetRGB, 255, 255, 255, 255
oImage = OBJ_NEW('IDLgrImage', image, PALETTE = oPalette)
vector = FINDGEN(101)/100.
texure_coordinates = FLTARR(2, 101, 101)
texure_coordinates[0, *, *] = vector # REPLICATE(1., 101)
texure_coordinates[1, *, *] = REPLICATE(1., 101) # vector
oPolygons = OBJ_NEW('IDLgrPolygon', $
DATA = vertices, POLYGONS = polygons, $
COLOR = [255, 255, 255], $
TEXTURE_COORD = texure_coordinates, $
TEXTURE_MAP = oImage, /TEXTURE_INTERP)
oModel -> ADD, oPolygons
oModel -> ROTATE, [1, 0, 0], -90
oModel -> ROTATE, [0, 1, 0], -90
XOBJVIEW, oModel


Regards,

David
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: italic greek?
Next Topic: I have a problem!

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

Current Time: Wed Oct 08 19:11:59 PDT 2025

Total time taken to generate the page: 0.00494 seconds