X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11 Aug 2022 01:59 PM by  Ben Castellani
map3d ?
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Ronn Kling



New Member


Posts:5
New Member


--
11 Aug 2022 10:51 AM
    I've looked around and not found anything. The demo has a direct graphics one. I see from the help that plot3d does have a mapForward and mapinverse, so maybe I could use that? Of course, I'm pressed for time and if anyone has a example using plot3d I would appreciate it. I want to put a satellite orbit over the earth.

    -Ronn

    Ben Castellani



    Basic Member


    Posts:130
    Basic Member


    --
    11 Aug 2022 01:59 PM
    This is not directly supported in IDL, but you could use some of the available tools to make it happen with marginal effectiveness.

    For example, define a 3D dataspace and put a spheroid VOLUME in it. Texture the volume with an image of Earth or with a map of Earth. Then use PLOT3D to draw the satellite orbital path.

    If you don't need to have curvature involved (i.e. a 3D Earth representation) and just want the only real 3D aspect to be the orbital path lying "above" the map surface, you can combine PLOT3D and MAP with the ZVALUE parameter etc.

    Not really the same, but here is an example of how to put a CONTOUR above an IMAGE in a 3D space (there is actually a "bug" of sorts that will not allow you to use a MAP instead of IMAGE):

    ;IDL PRO CODE EXAMPLE
    ;Create a blank 3D space using the SURFACE function
    dir = FILEPATH('',SUBDIR=['examples', 'data'])
    z = READ_BINARY(dir+'elevbin.dat', DATA_DIMS=[64,64])
    s = SURFACE(z,xrange=[-180,180],yrange=[-90,90],zrange=[0,200],/nodata)

    ; Display an image.
    file1 = FILEPATH('Night.jpg', $
    SUBDIRECTORY=['examples','data'])
    im1 = IMAGE(file1, $
    IMAGE_DIMENSIONS=[360,180], $
    IMAGE_LOCATION=[-180,-90], $
    DIMENSIONS=[512,512], MARGIN=0,/overplot)

    ; Overplot another image, same dimensions.
    file2 = FILEPATH('Day.jpg', $
    SUBDIRECTORY=['examples','data'])
    im2 = IMAGE(file2, $
    IMAGE_DIMENSIONS=[360,180], $
    IMAGE_LOCATION=[-180,-90],/over,zvalue=70)

    ;Draw a contour above the images
    h = 1 - HANNING(360,360)
    x = FINDGEN(360)-180
    v = [0,0.25,0.5,0.75]

    c1 = CONTOUR(h, x, x, RGB_TABLE=1, /FILL, C_VALUE=v,/over,zvalue=170)
    ; Retrieve the current colors, make the last one transparent
    c = c1.c_color
    c = [c, 255b + BYTARR(1,(c.dim)[1])] ; change to RGBA
    c[3,3] = 0 ; make transparent
    c1.c_color = c
    You are not authorized to post a reply.