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

Home » Public Forums » archive » Re: drawing a shaded sphere
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
Re: drawing a shaded sphere [message #11417] Tue, 07 April 1998 00:00
dlhopols is currently offline  dlhopols
Messages: 10
Registered: April 1998
Junior Member
In article <MPG.f92a4527ce8dc2b989776@news.frii.com>,
davidf@dfanning.com (David Fanning) wrote:
>
> John Boccio (boccio@swarthmore.edu) writes:
>
>> The IDL code at the end of this message when saved as a file cosmic.pro
>> will plot the trajectory of a cosmic ray in the earth's magnetic field in
>> 3 dimensions. It plots the trajectory as it is happening(not at the end),
>> which is the way one should do during a simulation.
>>
>> I would like to draw a shaded sphere (even better a sphere with earth map
>> on its surface) of radius rearth so that the subsequent cosmic ray
trajectory
>> in the earth's magnetic field appears properly in relation to that sphere.
>
> I couldn't get John's code to run (missing some functions),
> but here is an example with simulated data and XInterAnimate
> that I coded up in about 5 minutes. Loading the animation
> pixmaps takes awhile, but the animation is very fast. You
> can, of course, load the pixmaps out of sight if you like.
>
> Cheers,
>
> David
> -----------------------------------------------------------
>

I tried both codes, John Boccio's works on my machine (SGI).
(Don't forget the function definitions at the beginning).
I just had trouble getting it to stop.
David's is pretty interesting, except watching the loading is a bit
hard on the eyes. It might be useful for a satellite orbit simulation.

Good Luck, John.

Rose



-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
Re: drawing a shaded sphere [message #11424 is a reply to message #11417] Mon, 06 April 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
John Boccio (boccio@swarthmore.edu) writes:

> The IDL code at the end of this message when saved as a file cosmic.pro
> will plot the trajectory of a cosmic ray in the earth's magnetic field in
> 3 dimensions. It plots the trajectory as it is happening(not at the end),
> which is the way one should do during a simulation.
>
> I would like to draw a shaded sphere (even better a sphere with earth map
> on its surface) of radius rearth so that the subsequent cosmic ray trajectory
> in the earth's magnetic field appears properly in relation to that sphere.

I couldn't get John's code to run (missing some functions),
but here is an example with simulated data and XInterAnimate
that I coded up in about 5 minutes. Loading the animation
pixmaps takes awhile, but the animation is very fast. You
can, of course, load the pixmaps out of sight if you like.

Cheers,

David
-----------------------------------------------------------

PRO Particle_Track

; Fake latitude and longitude data of simulated particle.

x = Findgen(100)* 2 - 100
y = Findgen(100) * (50/99.)
TVLCT, 255, 255, 0, 1

; Run the animation in XInterAnimate

XInterAnimate, Set=[300,300, 50], /Showload

xx = [x[0]]
yy = [y[0]]
count = 0
FOR j=1, 99, 2 DO BEGIN

; Draw map projection with particle track overlayed.

Map_Set, /Orthographic, /Continents, /Grid, y[j], x[j]
xx = [xx, x[j]]
yy = [yy, y[j]]
PlotS, xx, yy, Color=1
PlotS, xx[count+1], yy[count+1], PSym=4, Color=1

; Copy it into XInterAnimate pixmaps.

XInterAnimate, Frame=count, Window=!D.Window
count = count + 1
ENDFOR

; Run the animation.

XInterAnimate, 20
END

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: paradoxon?
Next Topic: New IDL Programming Associate

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

Current Time: Sat Oct 11 13:45:47 PDT 2025

Total time taken to generate the page: 0.95456 seconds