资源简介
opengl 实现的机器人行走
opengl 实现的机器人行走
opengl 实现的机器人行走

代码片段和文件信息
#include “walker.h“
GLuint HorizontalList AxesList /* Display lists */
CurveLists ControlPtsLists; /* Firsts of groups of display lists */
int CurveAsPoints = 0 /* Display curve as points? */
DrawHorizontals = 1 /* Draw horizontal lines? */
EditingCurve = -1; /* Editing what curve -1 means none */
int CurveWWidthCurveWHeightCurveWindowVisibleEditingCurve;
int CurveLastXCurveLastYCurvePickedPointCurveDownBtn;
void CurveReshape(int w int h)
{
glViewport(00wh);
CurveWWidth = w;
CurveWHeight = h;
glFlush();
}
void CurveVisible(int v)
{
if (v == GLUT_VISIBLE)
CurveWindowVisible = 1;
else
CurveWindowVisible = 0;
}
void CurveDisplay(void)
{
int joint otherlegstep;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glTranslatef(0 0.5 0);
for (joint = NUM_JOINTS-1; joint >= 0; joint--) {
glBegin(GL_LINE_STRIP);
glCallList(CurveLists+joint);
glEnd();
glPointSize(5.0);
glCallList(ControlPtsLists+joint);
glPointSize(1.0);
glTranslatef(0 1.0 0);
}
glPopMatrix();
otherlegstep = (Step+50) % CYCLE_SIZE;
/* draw vertical line */
glColor3f(1 1 1);
glBegin(GL_LINES);
glVertex3f((GLfloat)Step/CYCLE_SIZE 0 0);
glVertex3f((GLfloat)Step/CYCLE_SIZE NUM_JOINTS 0);
if (!MirrorLegs) {
glVertex3f((GLfloat)otherlegstep/CYCLE_SIZE 0 0);
glVertex3f((GLfloat)otherlegstep/CYCLE_SIZE NUM_JOINTS 0);
}
glEnd();
glFlush();
glutSwapBuffers();
}
void CurveGLInit(void)
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(010NUM_JOINTS1-1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glLineStipple(1 0x00FF);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
ComputeCSetAndMakeListsCurve();
glFlush();
}
void MakeCurveList(int joint)
{
int i;
glNewList(CurveLists+joint GL_COMPILE);
glColor3f(1 1 1);
for (i = 0; i < CYCLE_SIZE; i++) {
glVertex3f((GLfloat)i/CYCLE_SIZE Walk_cycle[0][joint][i]/180 0);
}
glEndList();
}
void MakeCPointList(int joint)
{
int point;
glNewList(ControlPtsLists+joint GL_COMPILE);
glColor3f(0 0.4 0);
glBegin(GL_LINE_STRIP);
for (point = 0; point < RotCurve[joint].numpoints; point++) {
if (!((point-2) % 3)) {
glEnd();
glBegin(GL_LINE_STRIP);
}
glVertex3f(RotCurve[joint].xcoords[point]
(RotCurve[joint].angles[point])/180.0 0.0);
}
glEnd();
glBegin(GL_POINTS);
for (point = 0; point < RotCurve[joint].numpoints; point++) {
if (point % 3)
glColor3f(0 0.7 0);
else
glColor3f(0.7 0.0 0);
glVertex3f(RotCurve[joint].xcoords[point]
(RotCurve[joint].angles[point])/180 0);
}
glEnd();
glEndList();
}
void RedisplayBoth(void)
{
glutPostWindowRedisp
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 779 2009-07-19 14:41 dw6\bound.cset
文件 21970 2009-08-05 15:58 dw6\Debug\edit.obj
文件 15287 2009-08-05 15:58 dw6\Debug\models.obj
文件 0 2009-07-17 12:57 dw6\Debug\models.sbr
文件 50176 2009-08-05 16:07 dw6\Debug\vc60.idb
文件 69632 2009-08-05 16:07 dw6\Debug\vc60.pdb
文件 3236864 2009-07-17 15:08 dw6\Debug\walker.bsc
文件 44691 2009-08-05 16:07 dw6\Debug\walker.obj
文件 336764 2009-08-05 16:07 dw6\Debug\walker.pch
文件 599040 2009-08-05 15:58 dw6\Debug\walker.pdb
文件 0 2009-07-17 15:08 dw6\Debug\walker.sbr
文件 28260 2009-08-05 15:58 dw6\Debug\walkviewer.obj
文件 0 2009-07-17 15:08 dw6\Debug\walkviewer.sbr
文件 1211 1999-02-08 13:14 dw6\dunk.cset
文件 1530 2009-08-03 14:31 dw6\dw\ChildFrm.cpp
文件 1397 2009-08-03 14:31 dw6\dw\ChildFrm.h
文件 16471 2009-08-03 14:31 dw6\dw\Debug\ChildFrm.obj
文件 0 2009-08-03 11:23 dw6\dw\Debug\ChildFrm.sbr
文件 5030912 2009-08-03 12:54 dw6\dw\Debug\dw.bsc
文件 139264 2009-08-05 09:13 dw6\dw\Debug\dw.exe
文件 381528 2009-08-03 14:34 dw6\dw\Debug\dw.ilk
文件 23334 2009-08-03 14:34 dw6\dw\Debug\dw.obj
文件 5643100 2009-08-03 14:27 dw6\dw\Debug\dw.pch
文件 476160 2009-08-03 14:34 dw6\dw\Debug\dw.pdb
文件 7884 2009-08-03 14:27 dw6\dw\Debug\dw.res
文件 0 2009-08-03 12:54 dw6\dw\Debug\dw.sbr
文件 14750 2009-08-03 14:31 dw6\dw\Debug\dwDoc.obj
文件 0 2009-08-03 11:23 dw6\dw\Debug\dwDoc.sbr
文件 22592 2009-08-03 14:27 dw6\dw\Debug\dwView.obj
文件 0 2009-08-03 11:23 dw6\dw\Debug\dwView.sbr
............此处省略137个文件信息
- 上一篇:myeclipse UML插件
- 下一篇:高仿墨迹天气
相关资源
- OpenGL参考手册
- VC 获得文件属性 获取文件的创建时
- 读者写者问题(读者优先,写者优先
- 用VC 编写的仿QQ聊天室程序源代码
- Qt Creator opengl实现四元数鼠标控制轨迹
- OpenGL文档,api大全,可直接查询函数
- opengl轮廓字体源代码
- MFC读三维模型obj文件
- VC 游戏编程—附源代码
- IpHlpApi.h&IpHlpApi.lib
- 利用OpenGL写毛笔字算法
- vc 6.0开发的流程图编辑器
- MFC中OpenGL面和体的绘制以及动画效果
- VC 天空盒(skyBox)实现(附源代码)
- c MFC 画多边形
- VC 围棋源代码
- 用VC 编写的基于SNMP的路由器拓扑程序
- 基于OPENGL的光线跟踪源代码368758
- 清华大学郑莉C 语言程序设计课件
- VC 实现三维旋转(源码)
- ping 程序 C语言
- 自编用openGL实现3D分形树,分形山
- OpenGL球形贴图自旋程序
- 操作系统实验综合设计【附代码】
- VC 编程实现活动主机扫描源代码
- OpenGL导入贴图的Texture类
- 计算机图形学(openGL)代码
- vc 编写的基于TCP协议的客户/服务器
- 用OpenGL开发的机械臂运动仿真程序(
- OpenGL-3D坦克模拟
评论
共有 条评论