⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demoarrow3d.html

📁 在matlab中绘制3d箭头
💻 HTML
字号:
<html xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">   <head>      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">         <!--This HTML is auto-generated from an M-file.To make changes, update the M-file and republish this document.      -->      <title>arrow3D - creates a single volumized arrow based on a cylinder/cone combination</title>      <meta name="generator" content="MATLAB 7.0.1">      <meta name="date" content="2006-09-18">      <meta name="m-file" content="demoArrow3D"><style>body {  background-color: white;  margin:10px;}h1 {  color: #990000;   font-size: x-large;}h2 {  color: #990000;  font-size: medium;}p.footer {  text-align: right;  font-size: xx-small;  font-weight: lighter;  font-style: italic;  color: gray;}pre.codeinput {  margin-left: 30px;}span.keyword {color: #0000FF}span.comment {color: #228B22}span.string {color: #A020F0}span.untermstring {color: #B20000}span.syscmd {color: #B28C00}pre.showbuttons {  margin-left: 30px;  border: solid black 2px;  padding: 4px;  background: #EBEFF3;}pre.codeoutput {  color: gray;  font-style: italic;}pre.error {  color: red;}/* Make the text shrink to fit narrow windows, but not stretch too far in wide windows.  On Gecko-based browsers, the shrink-to-fit doesn't work. */ p,h1,h2,div {  /* for MATLAB's browser */  width: 600px;  /* for Mozilla, but the "width" tag overrides it anyway */  max-width: 600px;  /* for IE */  width:expression(document.body.clientWidth > 620 ? "600px": "auto" );}    </style></head>   <body>      <h1>arrow3D - creates a single volumized arrow based on a cylinder/cone combination</h1>      <introduction></introduction>      <h2>Contents</h2>      <div>         <ul>            <li><a href="#1">Basic Setup</a></li>            <li><a href="#2">Enhancing Visual Appearance</a></li>            <li><a href="#3">Stem Ratio Options</a></li>            <li><a href="#4">arrow3D handle Options</a></li>            <li><a href="#5">Credits</a></li>         </ul>      </div>      <h2>Basic Setup<a name="1"></a></h2><pre class="codeinput">    arrow3D([0,0,0] ,[1,2,3]);    hold <span class="string">on</span>;   axis <span class="string">equal</span>;   xlabel(<span class="string">'X'</span>); ylabel(<span class="string">'Y'</span>); zlabel(<span class="string">'Z'</span>);    title(<span class="string">'Basic arrow3D call'</span>);</pre><img vspace="5" hspace="5" src="demoArrow3D_01.png"> <h2>Enhancing Visual Appearance<a name="2"></a></h2><pre class="codeinput">    lighting <span class="string">phong</span>;    camlight <span class="string">right</span>;    title(<span class="string">''</span>);</pre><img vspace="5" hspace="5" src="demoArrow3D_02.png"> <h2>Stem Ratio Options<a name="3"></a></h2><pre class="codeinput">    subplot(131);    arrow3D([0,0,0], [0,0,3] , <span class="string">'r'</span>, 0.25);    hold <span class="string">on</span>;   axis <span class="string">equal</span>;   xlabel(<span class="string">'X'</span>); ylabel(<span class="string">'Y'</span>); zlabel(<span class="string">'Z'</span>);    lighting <span class="string">phong</span>;    camlight <span class="string">right</span>;    title(<span class="string">'Stem Ratio = 0.25'</span>);    subplot(132);    arrow3D([0,0,0], [0,0,3], <span class="string">'g'</span>, 0.5);    hold <span class="string">on</span>;   axis <span class="string">equal</span>;   xlabel(<span class="string">'X'</span>); ylabel(<span class="string">'Y'</span>); zlabel(<span class="string">'Z'</span>);    lighting <span class="string">phong</span>;    camlight <span class="string">right</span>;    title(<span class="string">'Stem Ratio = 0.5'</span>);    subplot(133);    arrow3D([0,0,0], [0,0,3], <span class="string">'b'</span>, 0.75);    hold <span class="string">on</span>;   axis <span class="string">equal</span>;   xlabel(<span class="string">'X'</span>); ylabel(<span class="string">'Y'</span>); zlabel(<span class="string">'Z'</span>);    lighting <span class="string">phong</span>;    camlight <span class="string">right</span>;    title(<span class="string">'Stem Ratio = 0.75'</span>);</pre><img vspace="5" hspace="5" src="demoArrow3D_03.png"> <h2>arrow3D handle Options<a name="4"></a></h2>      <p>The form of the arrowHandle is the same as 'surf'.  arrowHandle = [arrowStem, arrowHead]</p><pre class="codeinput">    subplot(131);    hold <span class="string">off</span>;    arrow3D([0,0,0], [0,0,3], <span class="string">'r'</span>);    hold <span class="string">on</span>;   axis <span class="string">equal</span>;   xlabel(<span class="string">'X'</span>); ylabel(<span class="string">'Y'</span>); zlabel(<span class="string">'Z'</span>);    lighting <span class="string">phong</span>;    camlight <span class="string">right</span>;    subplot(132);    hold <span class="string">off</span>;    arrowHandle = arrow3D([0,0,0], [0,0,3], <span class="string">'r'</span>);    hold <span class="string">on</span>;   axis <span class="string">equal</span>;   xlabel(<span class="string">'X'</span>); ylabel(<span class="string">'Y'</span>); zlabel(<span class="string">'Z'</span>);    set(arrowHandle(1), <span class="string">'FaceColor'</span>, <span class="string">'c'</span>);    lighting <span class="string">phong</span>;    camlight <span class="string">right</span>;    subplot(133);    hold <span class="string">off</span>;    arrowHandle = arrow3D([0,0,0], [0,0,3], <span class="string">'r'</span>);    hold <span class="string">on</span>;   axis <span class="string">equal</span>;   xlabel(<span class="string">'X'</span>); ylabel(<span class="string">'Y'</span>); zlabel(<span class="string">'Z'</span>);    set(arrowHandle(1), <span class="string">'FaceColor'</span>, <span class="string">'c'</span>);    set(arrowHandle(2), <span class="string">'FaceColor'</span>, <span class="string">'b'</span>);    lighting <span class="string">phong</span>;    camlight <span class="string">right</span>;</pre><img vspace="5" hspace="5" src="demoArrow3D_04.png"> <h2>Credits<a name="5"></a></h2>      <p>Author: Shawn Arseneau</p>      <p>Created: September 14, 2006</p>      <p class="footer"><br>         Published with MATLAB&reg; 7.0.1<br></p>      <!--##### SOURCE BEGIN #####%% arrow3D - creates a single volumized arrow based on a cylinder/cone combination

%% Basic Setup
    arrow3D([0,0,0] ,[1,2,3]);    
    hold on;   axis equal;   xlabel('X'); ylabel('Y'); zlabel('Z');
    title('Basic arrow3D call');
    
%% Enhancing Visual Appearance    
    lighting phong;
    camlight right;
    title('');
    
    
%% Stem Ratio Options
    subplot(131); 
    arrow3D([0,0,0], [0,0,3] , 'r', 0.25);
    hold on;   axis equal;   xlabel('X'); ylabel('Y'); zlabel('Z');
    lighting phong;
    camlight right;
    title('Stem Ratio = 0.25');

    subplot(132); 
    arrow3D([0,0,0], [0,0,3], 'g', 0.5);
    hold on;   axis equal;   xlabel('X'); ylabel('Y'); zlabel('Z');
    lighting phong;
    camlight right;
    title('Stem Ratio = 0.5');
    
    subplot(133); 
    arrow3D([0,0,0], [0,0,3], 'b', 0.75);
    hold on;   axis equal;   xlabel('X'); ylabel('Y'); zlabel('Z');
    lighting phong;
    camlight right;
    title('Stem Ratio = 0.75');

%% arrow3D handle Options
% The form of the arrowHandle is the same as 'surf'.  arrowHandle = [arrowStem, arrowHead]
    subplot(131); 
    hold off;
    arrow3D([0,0,0], [0,0,3], 'r');
    hold on;   axis equal;   xlabel('X'); ylabel('Y'); zlabel('Z');
    lighting phong;
    camlight right;

    subplot(132); 
    hold off;
    arrowHandle = arrow3D([0,0,0], [0,0,3], 'r');
    hold on;   axis equal;   xlabel('X'); ylabel('Y'); zlabel('Z');
    set(arrowHandle(1), 'FaceColor', 'c');
    lighting phong;
    camlight right;
        
    subplot(133); 
    hold off;
    arrowHandle = arrow3D([0,0,0], [0,0,3], 'r');
    hold on;   axis equal;   xlabel('X'); ylabel('Y'); zlabel('Z');
    set(arrowHandle(1), 'FaceColor', 'c');
    set(arrowHandle(2), 'FaceColor', 'b');
    lighting phong;
    camlight right;

    
%% Credits
% Author: Shawn Arseneau
% 
% Created: September 14, 2006


##### SOURCE END #####-->   </body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -