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

Home » Public Forums » archive » Re: TV, AXIS, T3D, Coordinate Systems
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: TV, AXIS, T3D, Coordinate Systems [message #33878] Wed, 05 February 2003 05:44
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Tobias Umblia (bias@planet-interkom.de) writes:

> First thank you, but i must admit that i still have problems with
> understanding.
>
> I actually thought i had set up the transformation when i called
> SCALE3 and used it by setting the T3D keyword with AXIS.
> The TV command doesn't seem to have any influence to !P.T and so
> i thought i could draw the axis right away.
>
> The problem is, as you pointed out, that !X.S, !Y.S and !Z.S have
> to be generated in the correct manner. The SURFACE procedure does
> that but SURFR and SCALE3 seem not to, although the help says that
> SURFR 'duplicates ... the features of the SURFACE routine'.
>
> So my question is what would you suggest to correctly calculating
> !X.S etc. before calling AXIS?
>
> the according piece of program looks like this:
>
> S = SIZE( x )
> SCALE3, XRANGE=[0,S[1]], YRANGE=[0,S[2]], ZRANGE=[0,S[3]]
> SHADE_VOLUME, x, level, v, p
> TV, POLYSHADE( v, p, /T3D )
> ;SURFACE, x[*,*,0], /NODATA, /NOERASE, /T3D ; <--- this does work
> ;SURFR... ;<--- these do
> ;SCALE3... ;<--- not
> AXIS, ZAXIS = 0, /NOERASE, /T3D

This is probably not entirely your fault. The way SCALE3
works, the optional XRANGE, YRANGE, and ZRANGE keywords
are *required*. (Don't ask me why.) If you leave them off,
then axis scaling is unchanged, which is exactly what
you are trying to avoid. :-)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: TV, AXIS, T3D, Coordinate Systems [message #33879 is a reply to message #33878] Wed, 05 February 2003 05:26 Go to previous message
bias is currently offline  bias
Messages: 7
Registered: February 2003
Junior Member
David Fanning <david@dfanning.com> wrote in message news:<MPG.18a98de2d2c2fb11989ac2@news.frii.com>...
>
> What happens is that the SURFACE command establishes
> a data coordinate system and sets up scaling parameters
> in the !X.S, !Y.S, and !Z.S system variables. These
> scaling parameters tell IDL how to take a point in data
> space and place it in the display window in pixel space.
> As system variables, of course, these persist until you
> exit IDL and start over.
>
> The AXIS command can generate its own data space, of course,
> if you use the SAVE keyword, but its normal behavior is to use
> the data space that was previously established. Had you not
> done some kind of graphics command before issuing the AXIS
> command,the default coordinate system would have the z-axis coming
> out of the display screen directly toward you. So you need some
> way to make the Z axis point in the right direction. The SURFACE
> command is doing this rotation for you, but you could do it
> yourself with the T3D command, for example. (I would probably
> use SURFR or SCALE3 to do this in your case.)
>
> In any case, whatever data system you had in place when you
> first issued the AXIS command resulted in a very short Z axis.
> I think your best bet would be to set up a 3D coordinate system
> with the correct axis ranges with SCALE3, then use this coordinate
> system (set the T3D keyword) when calling your graphics commands.
>
> Cheers,
>
> David

First thank you, but i must admit that i still have problems with
understanding.

I actually thought i had set up the transformation when i called
SCALE3 and used it by setting the T3D keyword with AXIS.
The TV command doesn't seem to have any influence to !P.T and so
i thought i could draw the axis right away.

The problem is, as you pointed out, that !X.S, !Y.S and !Z.S have
to be generated in the correct manner. The SURFACE procedure does
that but SURFR and SCALE3 seem not to, although the help says that
SURFR 'duplicates ... the features of the SURFACE routine'.

So my question is what would you suggest to correctly calculating
!X.S etc. before calling AXIS?

the according piece of program looks like this:

S = SIZE( x )
SCALE3, XRANGE=[0,S[1]], YRANGE=[0,S[2]], ZRANGE=[0,S[3]]
SHADE_VOLUME, x, level, v, p
TV, POLYSHADE( v, p, /T3D )
;SURFACE, x[*,*,0], /NODATA, /NOERASE, /T3D ; <--- this does work
;SURFR... ;<--- these do
;SCALE3... ;<--- not
AXIS, ZAXIS = 0, /NOERASE, /T3D
Re: TV, AXIS, T3D, Coordinate Systems [message #33906 is a reply to message #33879] Tue, 04 February 2003 07:44 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Tobias Umblia (bias@planet-interkom.de) writes:

> I'm an idl beginner and new to this newsgroup.
> And here is my little problem:
>
> I wanted to add a z-axis to my isosurface display using the
> AXIS procedure. But all i saw were some white spots at the lower
> left corner of the graphics window.
> So i thought this may be due to using different coordinate systems,
> as i read something in David Fanning's book about 'positioning
> images with normalized coordinates'. There i saw x- and y-axis
> surrounding an image by simply calling PLOT with /NODATA.
> So i ignored the coord. conversion, called SURFACE with /NODATA
> and the axes were drawn. And when I called AXIS following SURFACE
> i was very suprised to see that the z-axis was also drawn correctly.
> Then i commented out the SURFACE call but the z-axis was drawn just
> the same, i.e correctly, every time i ran my program.
> Only when i exit idl and restart again the AXIS call produces the
> spots unless i call SURFACE before. Now i am a bit confused and
> hope that someone has an explanation for this strange behaviour.

What happens is that the SURFACE command establishes
a data coordinate system and sets up scaling parameters
in the !X.S, !Y.S, and !Z.S system variables. These
scaling parameters tell IDL how to take a point in data
space and place it in the display window in pixel space.
As system variables, of course, these persist until you
exit IDL and start over.

The AXIS command can generate its own data space, of course,
if you use the SAVE keyword, but its normal behavior is to use
the data space that was previously established. Had you not
done some kind of graphics command before issuing the AXIS
command,the default coordinate system would have the z-axis coming
out of the display screen directly toward you. So you need some
way to make the Z axis point in the right direction. The SURFACE
command is doing this rotation for you, but you could do it
yourself with the T3D command, for example. (I would probably
use SURFR or SCALE3 to do this in your case.)

In any case, whatever data system you had in place when you
first issued the AXIS command resulted in a very short Z axis.
I think your best bet would be to set up a 3D coordinate system
with the correct axis ranges with SCALE3, then use this coordinate
system (set the T3D keyword) when calling your graphics commands.

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Expert information needed
Next Topic: strmatch in idl versions earlier than 5.3

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

Current Time: Fri Oct 10 16:28:53 PDT 2025

Total time taken to generate the page: 0.39917 seconds