资源简介
from:
http://people.sc.fsu.edu/~jburkardt/data/obj/obj.html
代码片段和文件信息
function obj_display ( input_file_name )
%*****************************************************************************80
%
%% OBJ_DISPLAY displays the faces of a shape defined by an OBJ file.
%
% Usage:
%
% obj_display ( ‘file.obj‘ )
%
% Licensing:
%
% This code is distributed under the GNU LGPL license.
%
% Modified:
%
% 27 September 2008
%
% Author:
%
% John Burkardt
%
timestamp ( );
fprintf ( 1 ‘\n‘ );
fprintf ( 1 ‘OBJ_DISPLAY\n‘ );
fprintf ( 1 ‘ MATLAB version\n‘ );
fprintf ( 1 ‘\n‘ );
fprintf ( 1 ‘ Reads an object in an ASCII OBJ file.\n‘ );
fprintf ( 1 ‘ Display it as a MATLAB shape.\n‘ );
%
% If at least one command line argument it‘s the input file name.
%
if ( nargin < 1 )
fprintf ( 1 ‘\n‘ );
fprintf ( 1 ‘OBJ_DISPLAY:\n‘ );
input_file_name = input ( ‘Enter the name of the input file:‘ );
end
%
% Get sizes.
%
[ node_num face_num normal_num order_max ] = obj_size ( input_file_name );
%
% Print the sizes.
%
obj_size_print ( input_file_name node_num face_num normal_num order_max );
%
% Get the data.
%
[ node_xyz face_order face_node ] = ...
obj_read ( input_file_name node_num face_num normal_num order_max );
%
% FACE_NODE may contain polygons of different orders.
% To make the call to PATCH we will assume all the polygons are the same order.
% To do so we‘ll simply “stutter“ the first node in each face list.
%
for face = 1 : face_num
face_node(face_order(face)+1:order_maxface) = face_node(1face);
end
%
% If any node index is still less than 1 set the whole face to 1‘s.
% We‘re giving up on this presumably meaningless face but we need to
% do it in a way that keeps MATLAB happy!
%
for face = 1 : face_num
for i = 1 : order_max
face_node(iface) = max ( face_node(iface) 1 );
end
end
%
% Display the shape.
%
handle = patch ( ‘Vertices‘ node_xyz‘ ‘Faces‘ face_node‘ );
set ( handle ‘FaceColor‘ [0.5 0.6 0.8] ‘EdgeColor‘ ‘Black‘ );
axis equal;
grid on;
xlabel ( ‘--X axis--‘ )
ylabel ( ‘--Y axis--‘ )
zlabel ( ‘--Z axis--‘ )
%
% The title function will interpret underscores in the title.
% We need to unescape such escape sequences!
%
title_string = s_escape_tex ( input_file_name );
title ( title_string )
%
% Terminate.
%
fprintf ( 1 ‘\n‘ );
fprintf ( 1 ‘OBJ_DISPLAY:\n‘ );
fprintf ( 1 ‘ Normal end of execution.\n‘ );
fprintf ( 1 ‘\n‘ );
timestamp ( );
return
end
function c = ch_cap ( c )
%*****************************************************************************80
%
%% CH_CAP capitalizes a single character.
%
% Licensing:
%
% This code is distributed under the GNU LGPL license.
%
% Modified:
%
% 22 November 2003
%
% Author:
%
% John Burkardt
%
% Parameters:
%
% Input character C the character to capitalize.
%
% Output char
相关资源
- three.js+objLoader.js源码包,内含测试3
- 基于MATLAB的人脸识别系统86092
- Matlab程序小波分析时间序列数据
- matlab2014中文帮助离线版
- 《MATLAB GUI设计学习手记第2版》源代码
- MATLAB有限元分析工具箱
- Matlab 机器人工具箱RoboticsToolBox rvct
- 脑电信号特征频段预处理MATLAB代码.
- 人工神经网络算法毕业论文中的matl
- MatLab强化学习_倒立摆控制_深度Q学习
- Matlab强化学习_网格迷宫问题_Sarsa算法
- Matlab强化学习_网格迷宫问题_QLearnin
- MATLAB 随机产生和为定值的n个整数
- 分布估计算法matlab工具箱
- matlab的findpeaks的源码,绝对正确。用
- 使用Matlab调用摄像头及保存视频
- 二进制矩阵求逆MATLAB函数
- 谱减法语音增强的matlab程序
- 基于MATLAB的通信系统仿真平台设计-基
-
HTML页面访问ActiveXob
ject对象的方法和 - MatLab强化学习_深度Q学习_神经网络_网
- 原创EMD和EEMD变换在信号去噪中的应用
- magnify用于matlab的放大插件.zip
-
在MatlabGUI里面启动或者暂停Simuli
n - matlab实现最小二乘法拟合椭圆方程
- MATLAB笔记合集整理.zip
- matlab GUI设置表格中单元格的背景颜色
- matlab实现基于项目的协同过滤算法
-
GUI控制Simuli
nk
评论
共有 条评论