pro t3d_oblique, matrixIn, matrix=matrixOut, oblique=oblique, reset=reset @compile_opt.pro ; On error, return to caller ;+ ; NAME: ; t3d_oblique ; PURPOSE: ; Implements 3D transformation matrix for oblique projections ; CATEGORY: ; gen/idl/math ; CALLING SEQUENCE: ; t3d_oblique, Array, /reset, oblique=oblique ; INPUTS: ; Array array[4,4]; type: any ; Matrix used as the starting transformation. ; If omitted !P.T is used; not used if /reset is set. ; OPTIONAL INPUTS: ; /reset if set start out with the identity matrix ; matrix=matrix ; if set to a named variable, the result is returned in this ; parameter and !P.T is not modified. ; oblique=oblique ; A two-element vector of oblique projection parameters. ; Points are projected onto the XY plane at Z=0 as follows: ; x' = x + z(d COS(a)), and y' = y + z(d SIN(a)). ; where oblique[0] = d, and oblique[1] = a. ; OUTPUTS: ; !P.T unless the keyword MATRIX is supplied, in which case the result ; is returned in MATRIX and !P.T is not affected. ; SIDE EFFECTS: ; !P.T is changed if the keyword MATRIX is not set. ; PROCEDURE: ; Modidifies the oblique projection in IDL t3d.pro by settinr ; r[2,2] = 1.0 instead of 0.0 ; This preserves the z-component in an oblique projection. ; MODIFICATION HISTORY: ; JUN-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- id = dblarr(4,4) ;Make identity matrix for i=0,3 do id[i,i]= 1.0d array = keyword_set(reset) ? id : (n_elements(matrixIn) eq 16) ? matrixIn : !P.T r = id r[2,2] = 1.0 ; Is 0.0 in t3d.pro r[2,0] = oblique[0] * cos(oblique[1]/ !radeg) r[2,1] = oblique[0] * sin(oblique[1]/ !radeg) array = array # r if arg_present(matrixOut) then matrixOut = array else !p.t = array return & end