David Fanning wrote:
>
> Terje Fredvik (tfredvik@astro.uio.no) writes:
>
>> The error occurs when I try to create the 3D image by using
>> polyshade(v,p,/t3d). Why? When I'm in x-mode the resulting
>> array is 450 by 650, so why does IDL want to make an array
>> too big to handle when writing to file?
>
> The PolyShade command actually creates an image. While
> this image is 450 by 650 on your display it can be at
> least a factor of 25 or so bigger than that in the PostScript
> device, since the pixel size is a least 25 times smaller.
Ok, now I see why IDL is grumpy.
> Simply execute the PolyShade command before you Set_Plot
> to PostScript and scale the image with the usual XSize
> and YSize keywords to the TV command.
I'm not sure how to do that, and still keep the coordinate
system. The way I'm doing it now is like this:
-----<IDL code>---------
; Produce a list of vertices and
; polygons describing the contour
; surface.
shade_volume,a,fac,v,p,/low
; Set up transformation and scaling
; parameters for 3D viewing
s=size(a)
scale3,xr=[0,s(1)],yr=[0,s(2)],zr=[0,s(3)], ax=ax, az=az
; Plot a coordinate system, save the 3D
; transformation
dum = fltarr(60,71)
surface,dum,xr=[0,59],yr=[0,70],zr=[0,3],/xst,/yst,/zst,/nod ata,$
/noerase, ax=ax,az=az,charsize=cs,/save,zticks=1, $
xticks=5, yticks=5,ztickname=[' ', ' ', ' '
; Create a shaded volume, use the 3D
; transformation obtained when SURFACEing.
im3D = polyshade(v,p,/t3d)
; Display the image on the screen. (This
; erases the coordinate
system)
tvscl, im3D,/t3d,ysize=15, xsize=15
; Overplot the coordinate system, using the
; 3D transformation obtained when SURFACEing
; the first time.
surface,dum,xr=[0,59],yr=[0,70],zr=[0,3],zticks=1,$
ztickname=[' ', ' ', ' '],/xst, /yst,/zst,/nodata,$
/noerase, ax=ax, az=az, charsize=cs,/t3d,xtitle='Arcsec',$
ytitle='Arcsec'
-----</IDL code>---------
I put this in after im = polyshade(v,p,/t3d) but before tvscl,
im3D,/t3d,ysize=15, xsize=15:
IF KEYWORD_SET(ps) THEN BEGIN
set_plot,'ps'
device, bits=8,/color,ysize=15, xsize=15
ENDIF
This is not very useful: the only thing that pops up on the ps file
is the coordinate system, no 3D image.
If I remove ",ysize=15, xsize=15" from the tvscl command the
result is different, but still not good at all. The ps file shows
the 3D figure on black background, with the coordinate system totally
out of scale.
I have also tried to do another SCALE3 right after I set_plot,'ps',
but that doesn't help either.
What am I doing wrong?
--
Terje Fredvik
{ http://www.uio.no/~tfredvik/ }
|