Home > matGeom > geom3d > drawAxisCube.m

drawAxisCube

PURPOSE ^

DRAWAXISCUBE Draw a colored cube representing axis orientation.

SYNOPSIS ^

function p = drawAxisCube(varargin)

DESCRIPTION ^

DRAWAXISCUBE Draw a colored cube representing axis orientation.

   output = drawAxisCube(input)

   Example
   drawAxisCube

   See also
     drawAxis3d, createCube, patch

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function p = drawAxisCube(varargin)
0002 %DRAWAXISCUBE Draw a colored cube representing axis orientation.
0003 %
0004 %   output = drawAxisCube(input)
0005 %
0006 %   Example
0007 %   drawAxisCube
0008 %
0009 %   See also
0010 %     drawAxis3d, createCube, patch
0011 
0012 % ------
0013 % Author: David Legland
0014 % e-mail: david.legland@grignon.inra.fr
0015 % Created: 2010-07-22,    using Matlab 7.9.0.529 (R2009b)
0016 % Copyright 2010 INRA - Cepia Software Platform.
0017 
0018 [n, e, f] = createCube; %#ok<ASGLU>
0019 
0020 faceColors = [ ...
0021     1 1 0; ...
0022     0 0 1; ...
0023     1 0 0; ...
0024     0 1 1; ...
0025     1 0 1; ...
0026     0 1 0; ...
0027     ];
0028 
0029 p = patch('vertices', n, 'faces', f, ...
0030     'facecolor', 'flat', 'FaceVertexCData', faceColors);
0031

Generated on Wed 16-Feb-2022 15:10:47 by m2html © 2003-2019