X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=CreaPhase.git;a=blobdiff_plain;f=octave_packages%2Fvrml-1.0.13%2Fvrml_frame.m;fp=octave_packages%2Fvrml-1.0.13%2Fvrml_frame.m;h=9c6c8c54ee9244f002a2692ce5b96711fa432b69;hp=0000000000000000000000000000000000000000;hb=f5f7a74bd8a4900f0b797da6783be80e11a68d86;hpb=1705066eceaaea976f010f669ce8e972f3734b05 diff --git a/octave_packages/vrml-1.0.13/vrml_frame.m b/octave_packages/vrml-1.0.13/vrml_frame.m new file mode 100644 index 0000000..9c6c8c5 --- /dev/null +++ b/octave_packages/vrml-1.0.13/vrml_frame.m @@ -0,0 +1,148 @@ +## Copyright (C) 2002-2012 Etienne Grossmann +## +## This program is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free Software +## Foundation; either version 3 of the License, or (at your option) any later +## version. +## +## This program is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +## details. +## +## You should have received a copy of the GNU General Public License along with +## this program; if not, see . + +## v = vrml_frame (t, r, ...) +## +## t : 3 Translation Default : [0,0,0] +## r : 3x3 Matrix, or Default : eye(3) +## 3 Argument for rotv +## OPTIONS +## name : size : function : default +## "scale" : 3 or 1 : Length of frame's branches (including cone) <1> +## "diam" : 3 or 1 : Diameter of cone's base +## "col" : 3 or 3x3 : Color of branches (may be stacked vertically) <[3 4 9]/10> +## "hcol" : 3 or 3x3 : Color of head (may be stacked vertically) +## + +function v = vrml_frame (varargin) + +### Test with : frame with R,G,B vectors of len 3,2,1 and cone's diam are .2, +### .4, .6. +## +### vrml_browse (vrml_frame ("scale",[3,2,1],"diam",0.2*[1,2,3],"col",eye(3))); + +t = zeros (3,1); +r = eye(3); + +scale = ones (1,3); +diam = [nan,nan,nan]; +col = [0.3 0.4 0.9]; +hcol = []; + +dc = nan(1,3); +dr = nan(1,3); + +###################################################################### +## Read options +numeric_args = 0; +args = nargin; # nargin is now a function +while args && numeric_args<2 && numeric_args