On May 2, 6:52 pm, David Fanning <n...@dfanning.com> wrote:
> Mrunmayee writes:
>> I have been trying to create a spherical surface plot and have
>> partially succeeded. Here is what I did to create a surface:
>> theta3 = findgen(361)/2. * !pi/180. ; 0<= theta <= !pi
>> phi3 = findgen(361) * !pi/180. ; 0<= phi <= 2*!pi
>> x3 = sin(theta3) # cos(phi3)
>> y3 = sin(theta3) # sin(phi3)
>> sph = sqrt( (1. - x3^2 - y3^2) > 0.) ; This is to avoid
>> "floating illegal operand" error.
>> sph1 = sph ; Just for comparison
>> with sph, to be modified as follows
>> sph2 = sph[181:360,*] ; Array containing
>> elements for !pi/2 < theta <= !pi i.e. southern hemisphere
>> sph1[181:360,*] = -sph2 ; Since sqrt will just take
>> +ve root, this inverts and creates southern hemisphere.
>
>> Success: fsc_surface, sph1, x3, y3 ; Glorious spherical surface
>> surface, sph1, x3, y3 ; Rather pathetic
>> rendering of surface but still a spherical surface
>> Failure: shade_surf, sph1, x3, y3 ; Nothing viewd. NOTHING AT
>> ALL. Whether device, decomposed=0/1 doesn't matter.
>
>> Anyone knows what's happening?
>
> I don't know what is happening, but the result doesn't
> surprise me much. SURFACE and SHADE_SURF use what is
> technically referred to as a "two and a half D" surface
> rendering engine. All direct graphics commands use this
> 2.5D way of rendering 3D objects. Object graphics, which
> is what FSC_SURFACE is using, uses a true 3D rendering
> engine. I would have expected it to be better at rendering
> this surface.
>
> I think the bottom line is that if you *really* want to
> do 3D things, you will have to do them in object graphics
> if you want "modern" (as opposed to state of the art in the
> 1970s) 3D results.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Oh man... I have never ventured into objects in IDL. Not much idea
about 2.5D and 3D rendering. So, when you use OBJ_NEW("IDLGrSurface"),
it uses 3D rendering?
But as to what is happening here. See if doing following shines any
new light.
;Continuing variables from above:
;----------------------------------------------
sphn = sph[0:180, *] & xn = x3[0:180, *] & yn = y3[0:180, *] ;North
hemisphere and coordinates
sphs = -sph[181:360, *] & xs = x3[181:360, *] & ys = [181:360, * ] ;
South hemisphere and coords
surface, sph1, x3, y3, ax=0, az=0 ; This projection is uber-
horrible. In this, whole eastern hemisphere is missing.
surface, sphn, xn, yn, ax=0, az=0 ; Nothing of the sort.
surface, sphs, xs, ys, ax=0, az=0 ; Again, nothing missing!
Thanks for replying.
Gauri.
---------
|