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
-----------------------------------------------------------
|