资源简介
这是一个网格模型的简化算法,使用了二次误差技术。
代码片段和文件信息
/*
The interface routines for reading and writing PLY polygon files.
Greg Turk February 1994
---------------------------------------------------------------
A PLY file contains a single polygonal _object_.
An object is composed of lists of _elements_. Typical elements are
vertices faces edges and materials.
Each type of element for a given object has one or more _properties_
associated with the element type. For instance a vertex element may
have as properties the floating-point values xyz and the three unsigned
chars representing red green and blue.
---------------------------------------------------------------
Copyright (c) 1994 The Board of Trustees of The Leland Stanford
Junior University. All rights reserved.
Permission to use copy modify and distribute this software and its
documentation for any purpose is hereby granted without fee provided
that the above copyright notice and this permission notice appear in
all copies of this software and that you do not sell the software.
THE SOFTWARE IS PROVIDED “AS IS“ AND WITHOUT WARRANTY OF ANY KIND
EXPRESS IMPLIED OR OTHERWISE INCLUDING WITHOUT LIMITATION ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*/
#include
#include
#include
#include
#include “ply.h“
char *type_names[] = {
“invalid“
“char“ “short“ “int“
“uchar“ “ushort“ “uint“
“float“ “double“
};
int ply_type_size[] = {
0 1 2 4 1 2 4 4 8
};
#define NO_OTHER_PROPS -1
#define DONT_STORE_PROP 0
#define STORE_PROP 1
#define OTHER_PROP 0
#define NAMED_PROP 1
/* returns 1 if strings are equal 0 if not */
int equal_strings(char * char *);
/* find an element in a plyfile‘s list */
PlyElement *find_element(PlyFile * char *);
/* find a property in an element‘s list */
PlyProperty *find_property(PlyElement * char * int *);
/* write to a file the word describing a PLY file data type */
void write_scalar_type (FILE * int);
/* read a line from a file and break it up into separate words */
char **get_words(FILE * int * char **);
char **old_get_words(FILE * int *);
/* write an item to a file */
void write_binary_item(FILE * int unsigned int double int);
void write_ascii_item(FILE * int unsigned int double int);
double old_write_ascii_item(FILE * char * int);
/* add information to a PLY file descriptor */
void add_element(PlyFile * char ** int);
void add_property(PlyFile * char ** int);
void add_comment(PlyFile * char *);
void add_obj_info(PlyFile * char *);
/* copy a property */
void copy_property(PlyProperty * PlyProperty *);
/* store a value into where a pointer and a type specify */
void store_item(char * int int unsigned int double);
/* return the value of a stored item */
void get_stored_item( void * int int * unsigned int * double *);
/* return the value stored in an item given ptr to it and its type */
double get_item_value(char * int);
/* ge
- 上一篇:网络安全基础应用与标准第4版课件
- 下一篇:Laya Wechat Demo
相关资源
- 共振双光子现象学简化
- 第一美国银行采用NetApp统一存储简化
- 借助NetApp虚拟化解决方案简化VMware环
- HP StorageWroks MSA入门SAN方案简化存储
- 惠普模块化智能阵列MSA家族全面简化
- 简化三心圆拱巷道施工开挖轮廓线的
- 重新探讨简化模型中暗物质的直接检
- 《剑指offer》思路汇总---简化版的原书
- 论文研究-一种简化的HEVC率失真优化技
- D2Admin简化版项目起始模板
- 《复杂配电网简化分析与优化》刘健
- 基于八叉树的网格简化算法实现
- 三维模型网格简化源码
- SWAT-CUP2012手册简化版
- 基于adams软件的挖掘机简化模型的仿真
- 简化进销存系统
- ZXing竖屏简化版
- 简化版zxing导入自己项目直接使用
- 基于SIMPACK软件的客车简化整车模型的
- 用winsock设计简化的ping应用程序
- 土石坝稳定分析系统(简化版)
- 海康威视实时视频预览+opencv实时处理
- 日文简化CAD ROOT PRO CAD
- 保密检查工具简化版.iso
- SD-UHS-II简化规范中文完整翻译.pdf
- 32位jdk精简版 从原来的360多M简化为现
- 简化stata中倍差法的估计
- 简化的极化码译码算法
- opengl显示网格模型
- 道格拉斯普客算法的R语言实现
评论
共有 条评论