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 |
|
7 ## the Free Software Foundation; either version 2, or (at your option) |
|
8 ## any later version. |
|
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 |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301, USA. |
|
19 |
|
20 ## -*- texinfo -*- |
|
21 ## @deftypefn {Function File} {} view (@var{azimuth}, @var{elevation}) |
|
22 ## @deftypefnx {Function File} {} view (@var{dims}) |
|
23 ## @deftypefnx {Function File} {[@var{azimuth}, @var{elevation}] =} view () |
|
24 ## Set or get the viewpoint for the current axes. |
|
25 ## @end deftypefn |
|
26 |
|
27 ## Author: jwe |
|
28 |
|
29 function [azimuth, elevation] = view (x, y, z) |
|
30 |
|
31 if (nargin < 4) |
|
32 if (nargin == 1) |
|
33 if (x == 2) |
|
34 az = 0; |
|
35 el = 90; |
|
36 elseif (x == 3) |
|
37 az = -37.5; |
|
38 el = 30; |
|
39 else |
|
40 error ("view: expecting single argument to be 2 or 3"); |
|
41 endif |
|
42 elseif (nargin == 2) |
|
43 az = x; |
|
44 el = y; |
|
45 elseif (nargin == 3) |
|
46 error ("view: view (x, y, z) not implemented"); |
|
47 endif |
|
48 |
|
49 if (nargin > 0) |
|
50 set (gca (), "view", [az, el]); |
|
51 endif |
|
52 |
|
53 if (nargout == 1) |
|
54 error ("view: T = view () not implemented"); |
|
55 endif |
|
56 |
|
57 if (nargout == 2) |
|
58 azimuth = az; |
|
59 elevation = el; |
|
60 endif |
|
61 else |
|
62 print_usage (); |
|
63 endif |
|
64 |
|
65 endfunction |