资源简介
人体骨骼运动FORWARD KINEMATICS,利用opengl,c++实现,visual studio 平台

代码片段和文件信息
#include
#include
#include
#include “display.h“
#include “transform.h“
#include
#include
using namespace std;
Display::Display()
{
m_Skeleton = NULL;
m_Motion = NULL;
boneIndex = 0;
scaleBone = 0;
}
Display::~Display()
{
if(m_Skeleton != NULL) delete m_Skeleton;
if(m_Motion != NULL) delete m_Motion;
}
void Display::computeLocal2GlobalT()//从根节点层层计算TRANSLATION达到每个点
{
for(int i=0;i<3;i++)
m_Local2GlobalT[0].l2gt[i] = 0;//for root joint
for(int i=1;i {
float vec[3] = {000};
//cout< int self=i;
while(self!=0)
{
int parent=m_Skeleton->m_pBoneList[self].parent_idx;
v3_add(m_Skeleton->m_pBoneList[parent].tranvecvec);
self = parent;
}
v3_assign(vecm_Local2GlobalT[i].l2gt);
//cout<
}
}
void Display::computeChild2Parent()
{
computeLocal2GlobalT();//??用处
float idenM[4][4]={{1000}{0100}{0010}{0001}};
matrix_assign(idenMm_Child2Parent[0].c2p);
float temp1[4][4]temp4[3];
for(int i=1;i {
int parent = m_Skeleton->m_pBoneList[i].parent_idx;
matrix_mult(m_Skeleton->m_pBoneList[parent].rot_global_localm_Skeleton->m_pBoneList[i].rot_local_globaltemp1);
//v3_minus(m_Local2GlobalT[i].l2gtm_Local2GlobalT[parent].l2gttemp3);
matrix_transform_affine(m_Skeleton->m_pBoneList[parent].rot_global_localm_Skeleton->m_pBoneList[parent].trantemp4);
temp1[0][3] = temp4[0];
temp1[1][3] = temp4[1];
temp1[2][3] = temp4[2];
matrix_assign(temp1m_Child2Parent[i].c2p);
}
}
void Display::computeLocalRot(Motionframe * p_Motion)
{
p_MotionRot = new MotionRot;
for(int i=0;i<3;i++)
rootPos[i]=p_Motion->frame[i];
float rxryrz;
int count = 3;
for(int i=0;i {
rx=0;
ry=0;
rz=0;
if(m_Skeleton->m_pBoneList[i].dofx==1)
{
rx = p_Motion->frame[count];//frame[62]
count++;
}
if(m_Skeleton->m_pBoneList[i].dofy==1)
{
ry = p_Motion->frame[count];
count++;
}
if(m_Skeleton->m_pBoneList[i].dofz==1)
{
rz = p_Motion->frame[count];
count++;
}
rotationZYX(p_MotionRot->bRotList[i].bRot rz ry rx);
}
}
void Display::CGlobalPos(int numframe)
{
computeChild2Parent();
m_Pos[numframe] = new Pos;
float glPos[3]temp[3];
computeLocalRot(m_Motion->m_pMotion[numframe]);
for(int i=0;i<3;i++)
m_Pos[numframe]->globalPos[0][i] = rootPos[i];
for(int i=1;i {
int self = i;
v3_assign(m_Skeleton->m_pBoneList[self].loc_posglPos);
while(self!=0)
{
int parent = m_Skeleton->m_pBoneList[self].parent_idx;
//v3_assign(glPostemp);
matrix_transform_affine(p_MotionRot->bRotList[self].bRotglPostemp);
matrix_transform_affine(m_Child2Parent[self].c2ptemp
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 81408 2009-10-26 22:27 Human Motion_FK\debug\Human Motion_FK.exe
文件 557972 2009-10-26 22:27 Human Motion_FK\debug\Human Motion_FK.ilk
文件 633856 2009-10-26 22:27 Human Motion_FK\debug\Human Motion_FK.pdb
文件 7270 2008-01-11 19:49 Human Motion_FK\debug\male.ASF
文件 163436 2005-01-08 04:26 Human Motion_FK\debug\male2.running.AMC
文件 515347 2008-01-11 21:35 Human Motion_FK\debug\male_walk10.AMC
文件 235 2008-11-24 19:03 Human Motion_FK\Human Motion_FK\constant.h
文件 6694 2009-10-26 22:27 Human Motion_FK\Human Motion_FK\Debug\BuildLog.htm
文件 56575 2009-10-26 20:37 Human Motion_FK\Human Motion_FK\Debug\display.obj
文件 621 2009-10-26 22:27 Human Motion_FK\Human Motion_FK\Debug\Human Motion_FK.exe.intermediate.manifest
文件 53475 2009-10-26 22:27 Human Motion_FK\Human Motion_FK\Debug\main.obj
文件 47381 2009-10-25 21:03 Human Motion_FK\Human Motion_FK\Debug\motion.obj
文件 67 2009-10-26 22:27 Human Motion_FK\Human Motion_FK\Debug\mt.dep
文件 68973 2009-10-25 21:03 Human Motion_FK\Human Motion_FK\Debug\skeleton.obj
文件 45323 2009-10-25 21:03 Human Motion_FK\Human Motion_FK\Debug\transform.obj
文件 265216 2008-12-04 16:30 Human Motion_FK\Human Motion_FK\Debug\vc80.idb
文件 208896 2008-12-04 16:30 Human Motion_FK\Human Motion_FK\Debug\vc80.pdb
文件 265216 2009-10-26 22:27 Human Motion_FK\Human Motion_FK\Debug\vc90.idb
文件 233472 2009-10-26 22:27 Human Motion_FK\Human Motion_FK\Debug\vc90.pdb
文件 10945 2009-10-25 21:24 Human Motion_FK\Human Motion_FK\display.cpp
文件 1497 2009-10-25 14:50 Human Motion_FK\Human Motion_FK\display.h
文件 1084 2008-04-08 11:34 Human Motion_FK\Human Motion_FK\GL\glut.h
文件 4352 2009-10-26 22:23 Human Motion_FK\Human Motion_FK\Human Motion_FK.vcproj
文件 1427 2009-10-26 22:28 Human Motion_FK\Human Motion_FK\Human Motion_FK.vcproj.LENOVO-D01793DE.YveStar.user
文件 8037 2009-10-26 20:45 Human Motion_FK\Human Motion_FK\main.cpp
文件 7270 2008-01-11 19:49 Human Motion_FK\Human Motion_FK\male.ASF
文件 163436 2005-01-08 04:26 Human Motion_FK\Human Motion_FK\male2.running.AMC
文件 515347 2008-01-11 21:35 Human Motion_FK\Human Motion_FK\male_walk10.AMC
文件 2440 2008-11-24 11:10 Human Motion_FK\Human Motion_FK\motion.cpp
文件 982 2008-11-24 02:29 Human Motion_FK\Human Motion_FK\motion.h
............此处省略15个文件信息
相关资源
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
评论
共有 条评论