资源简介
用opengl和VS Mfc做的读取和绘制bvh文件的程序
代码片段和文件信息
#include
#include
#include “BVH.h“
#include
using namespace std;
double camera_y = 0.0f;
double camera_x = -10.0f;
double camera_d = 5.0f;
double camera_xt = 0.0f;
//parameter for mouse draging
int d_mouse_r = 0;
int d_mouse_l = 0;
int d_mouse_m = 0;
int p_mouse_x p_mouse_y;
float animation_time = 0.0f;
int frame_no = 0;
float animation_time2 = 0.0f;
int frame_no2 = 0;
bool on_animation = true;
bool five_animation = false;
//window size
static int win_w win_h;
BVH* bvh = NULL;
BVH* bvh2 = NULL;
/*********************************/
vector bvh_stack;
vector A_T;
vector F_Num;
vector rand_flag;
vector rand_x;
vector rand_z;
static int bvh_num = -1;
const char* filename[] = {“02_01.bvh“ “02_02.bvh“ “02_03.bvh“ “02_04.bvh“ “02_05.bvh“ “02_06.bvh“ “02_07.bvh“ “02_08.bvh“ “02_09.bvh“ “02_10.bvh“};
bool rand_flag1 = true;
bool rand_flag2 = true;
double rand_x0 = 0.0;
double rand_x1 = 0.0;
double rand_z0 = 0.0;
double rand_z1 = 0.0;
void initialize()
{
for(int i=0; i {
bvh_stack.push_back(NULL);
A_T.push_back(0.0);
F_Num.push_back(0);
rand_flag.push_back(true);
rand_x.push_back(0.0);
rand_z.push_back(0.0);
}
cout< cout<<“enter in“< }
/********************************/
void drawMessage(const char* message)
{
int i;
if(message == NULL) return;
//initialize projection matrix
glMatrixMode( GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0.0 win_w 0.0 win_h);
//initialize model veiwpoint
glMatrixMode( GL_MODELVIEW );
glPushMatrix();
glLoadIdentity();
glDisable( GL_DEPTH_TEST );
//literature
glColor3f( 1.0 0.0 0.0 );
glRasterPos2i( 20 20 );
for ( i=0; message[i]!=‘\0‘; i++ )
glutBitmapCharacter( GLUT_BITMAP_HELVETICA_18 message[i] );
glEnable( GL_DEPTH_TEST );
glEnable(GL_BLEND);
glMatrixMode( GL_PROJECTION );
glPopMatrix();
glMatrixMode( GL_MODELVIEW );
glPopMatrix();
}
void display()
{
//clean the screen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT |GL_STENCIL_BUFFER_BIT );
//set the model coordinate -> camera coordinate transformation matrix
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef(0.0 0.0 -camera_d);
glRotatef( - camera_x 1.0 0.0 0.0 );
glRotatef( - camera_y 0.0 1.0 0.0 );
glTranslatef( camera_xt 0.0 0.0 );
glTranslatef( 0.0 -1.0 0.0 );
//render a floor
float size = 1.0f;
int num_x = 20 num_z = 20;
double ox oz;
double floor_size_x0 = 0.0 floor_size_z0 = 0.0 floor_size_x1 = 0.0 floor_size_z1 = 0.0;
// glNormal3d( 0.0 1.0 0.0 );
ox = -(num_x * size) / 2;//center
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 33554432 2014-05-04 08:47 BVH_Project\BVH_Project.sdf
文件 900 2013-07-04 00:06 BVH_Project\BVH_Project.sln
..A..H. 15360 2013-08-02 06:58 BVH_Project\BVH_Project.suo
..A..H. 39424 2014-05-04 08:47 BVH_Project\BVH_Project.v12.suo
文件 15182 2013-07-10 22:44 BVH_Project\main_backup.cpp
文件 19 2013-07-15 18:39 BVH_Project\readme.txt
文件 13460 2014-04-17 04:11 BVH_Project\verb.cpp
文件 12166 2013-07-19 10:15 BVH_Project\vern_net.cpp
文件 5797042 2010-07-27 00:11 BVH_Project\BVH_Project\01_03.bvh
文件 448810 2010-07-27 00:16 BVH_Project\BVH_Project\02_01.bvh
文件 390719 2010-07-27 00:16 BVH_Project\BVH_Project\02_02.bvh
文件 230432 2010-07-27 00:16 BVH_Project\BVH_Project\02_03.bvh
文件 628865 2010-07-27 00:16 BVH_Project\BVH_Project\02_04.bvh
文件 2386935 2010-07-27 00:16 BVH_Project\BVH_Project\02_05.bvh
文件 2874148 2010-07-27 00:16 BVH_Project\BVH_Project\02_06.bvh
文件 2890269 2010-07-27 00:16 BVH_Project\BVH_Project\02_07.bvh
文件 1930449 2010-07-27 00:16 BVH_Project\BVH_Project\02_08.bvh
文件 1334632 2010-07-27 00:16 BVH_Project\BVH_Project\02_09.bvh
文件 3395025 2010-07-27 00:16 BVH_Project\BVH_Project\02_10.bvh
文件 630166 2010-07-27 00:13 BVH_Project\BVH_Project\08_04.bvh
文件 5636491 2010-07-26 23:48 BVH_Project\BVH_Project\13_05.bvh
文件 3894513 2010-07-26 23:47 BVH_Project\BVH_Project\13_26.bvh
文件 299645 2010-07-26 23:33 BVH_Project\BVH_Project\22_08.bvh
文件 724843 2010-07-26 23:22 BVH_Project\BVH_Project\36_01.bvh
文件 517374 2010-07-26 23:19 BVH_Project\BVH_Project\74_03.bvh
文件 1277667 2010-07-26 23:45 BVH_Project\BVH_Project\77_14.bvh
文件 799907 2010-07-26 23:38 BVH_Project\BVH_Project\87_01.bvh
文件 6151 2013-06-19 17:02 BVH_Project\BVH_Project\accept-77.txt
文件 4628 2013-06-19 17:16 BVH_Project\BVH_Project\accompany-51.7.txt
文件 4465 2013-06-19 17:21 BVH_Project\BVH_Project\acquiesce-95.txt
............此处省略351个文件信息
- 上一篇:MFC将exe完美嵌套到static内
- 下一篇:C++程序设计实践指导
相关资源
- qtOpenGLDemo2.rar
- opengl圆柱贴图程序,可以直接运行
- opengl绘制坐标
- openGL_c++复刻我的世界游戏
- CAD应用程序开发详解 Visual C++与Open
- OpenGL+MFC三维绘图
- opengl绘制一个单位立方体正平行投影
- VTK图形图像开发进阶_高清完整版
- Step by Step Skeletal Animation in C++ and Ope
- opengl游戏
- glut.3.7.6+.DevPak
- opengl绘制简单小动物
- kinect+openGL+openNI+opencv实现三维重建
- openGL和C++实现光线跟踪作业
- Timer时钟.zip
- OpenGL3D
- Dialog下创建 MFC OpenGL子窗口
- 仿雷电游戏OpenGL源码C++版
- DDA画线算法
- 模拟卫星旋转和地球自转
- OpenGL纹理贴图源程序.rar
- 计算机图形学实验二 opengl
- OpenGL载入3ds模型并在MFC视图窗口显示
- 计算机图形学OpenGL画机器人
- openGL通过点线方式画出立方体并移动
- OPENGL 画颜色渐变六角星+旋转
- opengl头文件
- opengl五角星绘制
- OpenGL火焰
- OpenGL纹理茶壶
评论
共有 条评论