6257
|
1 ## Copyright (C) 2007 John W. Eaton |
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
7016
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
6257
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
7016
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
6257
|
18 |
|
19 ## -*- texinfo -*- |
|
20 ## @deftypefn {Function File} {} view (@var{azimuth}, @var{elevation}) |
|
21 ## @deftypefnx {Function File} {} view (@var{dims}) |
|
22 ## @deftypefnx {Function File} {[@var{azimuth}, @var{elevation}] =} view () |
|
23 ## Set or get the viewpoint for the current axes. |
|
24 ## @end deftypefn |
|
25 |
|
26 ## Author: jwe |
|
27 |
|
28 function [azimuth, elevation] = view (x, y, z) |
|
29 |
|
30 if (nargin < 4) |
|
31 if (nargin == 1) |
|
32 if (x == 2) |
|
33 az = 0; |
|
34 el = 90; |
|
35 elseif (x == 3) |
|
36 az = -37.5; |
|
37 el = 30; |
|
38 else |
|
39 error ("view: expecting single argument to be 2 or 3"); |
|
40 endif |
|
41 elseif (nargin == 2) |
|
42 az = x; |
|
43 el = y; |
|
44 elseif (nargin == 3) |
|
45 error ("view: view (x, y, z) not implemented"); |
|
46 endif |
|
47 |
|
48 if (nargin > 0) |
|
49 set (gca (), "view", [az, el]); |
|
50 endif |
|
51 |
|
52 if (nargout == 1) |
|
53 error ("view: T = view () not implemented"); |
|
54 endif |
|
55 |
|
56 if (nargout == 2) |
|
57 azimuth = az; |
|
58 elevation = el; |
|
59 endif |
|
60 else |
|
61 print_usage (); |
|
62 endif |
|
63 |
|
64 endfunction |