資源簡介
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?????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???????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???????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插件
- 下一篇:高仿墨跡天氣
評論
共有 條評論