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

Home » Public Forums » archive » Re: Drawing axes for volumetric data
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 axes for volumetric data [message #7074] Fri, 20 September 1996 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Michael Whimpey writes:

> I am using idl version 4 on a SG indigo2 work station.
> I'm wondering how I can draw axes displaying an isosurface
> of data using SCALE3, SHADE_VOLUME & POLYSHADE.
>
> I don't seem to be getting anywhere with AXIS procedure.

The AXIS procedure has always confused me. Sometimes I get
what I want, but only after fooling around for 15-20 minutes.

What I do if I want axes in a 3D space is always use the
SURFACE command to draw them. (I *do* understand the
SURFACE command!)

The purpose of the SURFACE command is to: (1) set up the 3D
coordinate space for me (usually in data coordinates) and, (2)
to draw the axes with annotations, etc. Most of the time, this
means issuing the SURFACE command twice: once to set up
the 3D space and (because I don't want my graphics to "flash")
once to draw the axes.

Normally, I want exact axes ranges and I don't want to see the
axes at first, so I set the [XYZ]STYLE keywords to 5 (i.e, 4+1).
Be sure to set the SAVE keyword or the 3D transformation will
be thrown away after the surface is drawn and not stored in !P.T
for the subsequent POLYSHADE command to use. The
NODATA keyword, of course, prevents data from being
displayed.

If I had a 3D data set and I wanted to see its isosurface with
axes around it, I would do something like this. (In this example
I use the "head.dat" data set that comes with the IDL demo
data).

data = GETIMAGE('head.dat', xs=80, ys=100, frame=57)

; Set up the 3D transformation space in !P.T. Don't
; draw the axes yet.

SURFACE, Dist(10,10), XRANGE=[0,80], YRANGE=[0,100], $
ZRANGE=[0,255], /SAVE, /NODATA, XSTYLE=5, YSTYLE=5, $
ZSTYLE=5

; Obtain the isosurface.

SHADE_VOLUME, data, 10, vertices, polygons, /LOW

; Display the isosurface in the 3D space.

TVSCL, POLYSHADE(vertices, polygons, /T3D)

; Redraw the axes.

SURFACE, Dist(10,10), XRANGE=[0,80], YRANGE=[0,100], $
ZRANGE=[0,255], /SAVE, /NODATA, XSTYLE=1, YSTYLE=1, $
ZSTYLE=1, XTITLE='X Dimension', YTITLE='Y Dimension', $
ZTITLE='Data Dimension', /NOERASE

END

Hope this helps.

Yours,

David

--
David Fanning, Ph.D.
Phone: 970-221-0438
Fax: 970-221-4728
E-Mail: davidf@fortnet.org
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: How to know a window id is valid
Next Topic: [Q] Canonical correlation analysis

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

Current Time: Wed Oct 08 19:53:43 PDT 2025

Total time taken to generate the page: 0.00500 seconds