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

Home » Public Forums » archive » Re: Origin of 3D-plots(SURFACE)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Origin of 3D-plots(SURFACE) [message #7875] Mon, 20 January 1997 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Remco Schoenmakers <remschoe@astro.rug.nl> writes:

> I am visualising 3D-data using surface in all different
> viewing angles. The problem is that I want the origin (0,0,0)
> always in the middle of the plotwindow, which is not standard.
> Does anyone know how to do this?

I am going to presume that your data is pretty much symetrically
located about the origin, and that what you really want here is
for the plot *axes* to go through the origin. (If this is not
what you mean, let me know.)

The basic solution to this problem is to draw the surface of
the data without the axes, and then use the AXIS command
to draw plot axes through the origin. Be sure to save the 3D
transformation matrix created by the surface, so you can place
the new axes correctly.

Here is an example:

; Create some data.

data = DIST(40,40)
x = FINDGEN(40) - 20.0
y = FINDGEN(40) - 20.0

; Draw the surface without axes.
; Save the 3D transformation matrix.

SURFACE, data, x, y, XSTYLE=4, YSTYLE=4, ZSTYLE=4, /SAVE

; Draw the new axes through the origin.

AXIS, /XAXIS, 0, 0, 0, /T3D
AXIS, /YAXIS, 0, 0, 0, /T3D
AXIS, /ZAXIS, 0, 0, 0, /T3D

This will draw the axes on top of the surface, which may not be
what you want. You could try setting up the transformation matrix
first, drawing the axes, then drawing the surface. Something like this:

SURFACE, data, x, y, XSTYLE=4, YSTYLE=4, ZSTYLE=4, /SAVE , /NODATA
AXIS, /XAXIS, 0, 0, 0, /T3D
AXIS, /YAXIS, 0, 0, 0, /T3D
AXIS, /ZAXIS, 0, 0, 0, /T3D
SURFACE, data, x, y, XSTYLE=4, YSTYLE=4, ZSTYLE=4, /NOERASE

If this still didn't give satisfactory results, you could try it in
the Z-buffer, where you are sure to get satisfactory hidden
line removal.

Hope this is what you had in mind.

Yours,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
[Message index]
 
Read Message
Previous Topic: IDL FAQ
Next Topic: processing interferograms

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

Current Time: Fri Oct 10 22:08:24 PDT 2025

Total time taken to generate the page: 0.95997 seconds