Re: 3d graphics [message #2840] |
Tue, 27 September 1994 06:59 |
landers
Messages: 45 Registered: May 1993
|
Member |
|
|
In article <366rt8$701@hammer.msfc.nasa.gov>, mallozzi@ssl.msfc.nasa.gov writes:
|> I am trying to make a sphere by drawing a number of great circles.
[snip]
|> t3d, rotate=[90, 0, 0]
It does work, but not as you're expecting. T3D doesn't rotate
the transform matrix in your data coordinates - it's in device
coordinates or something like that. You can check this by creating
your 3-D box with SURFACE, then printing !P.T. Then, change [XYZ]Range,
re-do the SURFACE, and note that !P.T doesn't change.
If you want to use !P.T to do data transforms, you'll have to use
T3D, Translate
T3D, Scale ;(maybe)
; then
T3D, Rotate
T3D, Scale ; put it back
T3D, Translate
Note that I havn't given any details. That's `cause it's been a while
since I've done this.
If you have PV-WAVE, check the CENTER_VIEW procedure (and it's friends).
If all you're trying to do is plot great circles or things like that -
you might try putting the 'transform' in your equations rather than in
the plot space. Something like this would work for the example you posted:
surface, fltarr(2,2), /NoData, xrange=[-1,1], yrange=[-1,1], zrange=[-1,1]
theta = findgen( 360 )
for psi = 0, 135, 45 do begin
x = sin(theta * !dtor)
y = cos(theta * !dtor)*cos(psi *!dtor)
z = cos(theta * !dtor)*sin(psi *!dtor)
plots, x, y, z, /t3d
endfor
... Your mileage may vary....
Later,
;Dave
|
|
|