资源简介
基于八叉树的网格简化算法实现 能正常的运行和对网格进行简化
代码片段和文件信息
/*
* Polygon Reduction Demo by Stan Melax (c) 1998
* Permission to use any of this code wherever you want is granted..
* Although please do acknowledge authorship if appropriate.
*
* This module initializes the bunny model data and calls
* the polygon reduction routine. At each frame the RenderModel()
* routine is called to draw the model. This module also
* animates the parameters (such as number of vertices to
* use) to show the model at various levels of detail.
*/
#include
#include
#include
#include
#include
#include
#include
//#include
#pragma warning(disable : 4244)
#include “vector.h“
#include “font.h“
#include
#include // malloc()等
#include // INT_MAX等
#include // EOF(=^Z或F6)NULL
#include // atoi()
#include // eof()
#include // exit()
#include // coutcin
#include “list.h“
#include “progmesh.h“
extern float DeltaT; // change in time since last frame
int render_num; // number of vertices to draw with
float bigpoint = 0.1f;
List vert; // global list of vertices
List tri; // global list of triangles
#define MAX_TRIANGLE_NUM 3000//12000//5804//1704
#define INFINITY 6963// 用整型最大值代替∞
#define MAXSTR 500
#define ELEMENTVERTEX “element vertex“//14 8
#define THOUSAND 1000
Vector model_position; // position of bunny
Quaternion model_orientation; // orientation of bunny
//Vector nrmls[MAX_TRIANGLE_NUM];
typedef int Boolean; // Boolean是布尔类型其值是TRUE或FALSE
int vexs[MAX_TRIANGLE_NUM]; // 顶点向量
int arcs[MAX_TRIANGLE_NUM][MAX_TRIANGLE_NUM]; // 邻接矩阵
int vexnum=902; // 图的当前顶点数
//int DistancMatrix[MAX_TRIANGLE_NUM][MAX_TRIANGLE_NUM];
//int final[MAX_TRIANGLE_NUM];
//int D[MAX_TRIANGLE_NUM];
int maxclassnum = 200;
int renderpolycount=0; // polygons rendered in the current frame
unsigned int vertexnum =0facenum = 0;
GLfloat light_position[] = {0.03.06.00.0};
GLfloat no_mat[] = {0.00.00.01.0};
GLfloat mat_grey_ambient[] = {0.50.50.51.0};
GLfloat mat_red_ambient[] = {0.00.01.01.0};
GLfloat mat_diffuse[] = {0.80.20.51.0};
GLfloat mat_specular[] = {1.01.01.01.0};
GLfloat no_shininess[] = {0.0};
GLfloat low_shininess[] = {5.0};
GLfloat high_shininess[] = {100.0};
GLfloat mat_emission[] = {0.30.20.20.0};
typedef struct OcTreeNode
{
List NodeTri;
List NodeVert;
int arcs[MAX_TRIANGLE_NUM][MAX_TRIANGLE_NUM]; // 邻接矩阵
int D[MAX_TRIANGLE_NUM]; //根节点到其它顶点的距离
int vexs[MAX_TRIANGLE_NUM]; //每个节点属于哪一类
// int ** arcs;
// int *D;
// int *vexs;
int NumOfTriangle;
int facenum;
int vertexnum;
struct OcTreeNode *pChild[8];
}OCTREENODE;
OCTREENODE g_RootNode;
//g_pRootNode = new OcTreeNode;
//g_RootNode.NodeTri = tri;
//g_RootNode.NodeVert = vert;
float biggerfloat(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 83874 2000-09-20 16:06 meshsimplification\meshsimplification\ansitbbot1.ply
文件 58767 2000-09-20 16:14 meshsimplification\meshsimplification\ANT31850.PLY
文件 50262 1998-09-08 22:26 meshsimplification\meshsimplification\apple.ply
文件 379 2006-05-22 22:46 meshsimplification\meshsimplification\b.ply
文件 151251 1998-09-08 22:26 meshsimplification\meshsimplification\beethoven.ply
文件 323275 1998-09-08 22:26 meshsimplification\meshsimplification\big_porsche.ply
文件 50961 2000-09-20 16:49 meshsimplification\meshsimplification\big_spider1850.ply
文件 57249 2000-09-20 17:23 meshsimplification\meshsimplification\boeing1850.ply
文件 409454 2000-09-20 16:40 meshsimplification\meshsimplification\BOTTLE.PLY
文件 2519554 2000-09-20 17:23 meshsimplification\meshsimplification\brain-gear.ply
文件 52084 2000-09-20 18:05 meshsimplification\meshsimplification\bunny1850.ply
文件 16517 2008-11-19 09:45 meshsimplification\meshsimplification\Bunnygut.cpp
文件 4012 1998-08-22 17:26 meshsimplification\meshsimplification\BUNNYLOD.001
文件 576 2006-04-08 17:06 meshsimplification\meshsimplification\BUNNYLOD.DEP
文件 4182 2006-04-04 20:14 meshsimplification\meshsimplification\BUNNYLOD.DSP
文件 541 2006-02-28 20:38 meshsimplification\meshsimplification\BUNNYLOD.DSW
文件 7540 2006-04-08 17:06 meshsimplification\meshsimplification\BUNNYLOD.MAK
文件 115712 2008-11-21 18:06 meshsimplification\meshsimplification\BUNNYLOD.ncb
文件 112640 2008-11-21 18:06 meshsimplification\meshsimplification\BUNNYLOD.OPT
文件 924 2008-11-19 09:46 meshsimplification\meshsimplification\BUNNYLOD.PLG
文件 572 2007-04-29 20:15 meshsimplification\meshsimplification\BUNNYLOD.sln
..A..H. 8704 2007-04-29 20:15 meshsimplification\meshsimplification\BUNNYLOD.suo
文件 6607 2006-06-15 11:34 meshsimplification\meshsimplification\bunnylod.vcproj
文件 3599 2000-09-20 20:05 meshsimplification\meshsimplification\BUNO.PLY
文件 16668 1998-09-08 22:53 meshsimplification\meshsimplification\cat.ply
文件 28803 2000-09-20 17:57 meshsimplification\meshsimplification\CHABOT.PLY
文件 54954 2000-09-20 18:31 meshsimplification\meshsimplification\chair51850.ply
文件 265 2000-09-20 18:05 meshsimplification\meshsimplification\CORNER.PLY
文件 177472 1998-09-08 22:53 meshsimplification\meshsimplification\COW.PLY
文件 52735 2000-09-20 18:57 meshsimplification\meshsimplification\COW1850.PLY
............此处省略58个文件信息
- 上一篇:ros2中文指南.pdf256738
- 下一篇:响应式表白网页手机/电脑版
相关资源
- 电子科大UESTC_OPENGL三维图形程序设计
- 八叉树算法
- 差速器三维模型
- 深度相机、Kinect及其应用
- 城市三维地下管线规划管理信息系统
- KinectFusion 和 ElasticFusion 三维重建方法
- 基于结构网格二维Euler方程的Jameson求
- 光线追踪demo
- opengl实现太阳系动态模型,地球,月
- OpenNI获取三维点云并用OpenGL显示可旋
- COMSOL高级网格划分
- 虚拟显示头盔显示器pdf论文
- 变网格步长声波方程有限差分数值模
- Trimble RealWorks 三维处理软件
- 三维模型网格简化源码
- 基于双目视觉的图像三维重建
- 浙江大学 三维CAD建模 作业
- OpenGL三维图形系统开发与实用技术.
- 基于VTK的地质体真三维可视化原理和
- 知名的斯坦福兔子的三维点云数据,
- OpenGL 超酷三维动画DEMO
- ANSYS+Workbench中网格化分和材料参数对
- 网格模型简化算法
- 三维迷宫,支持替身通过一定交互手
- 计算机图形学三维变换课程设计
- 三维激光扫描点云边界检测和孔洞修
- openGL完成雪花飞舞源码
- 叶片泵数模
- OpenGL 立体房子模拟
- 三角网格法画等值线
评论
共有 条评论