本文整理汇总了C++中YsAtt3::GetMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ YsAtt3::GetMatrix方法的具体用法?C++ YsAtt3::GetMatrix怎么用?C++ YsAtt3::GetMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YsAtt3
的用法示例。
在下文中一共展示了YsAtt3::GetMatrix方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Motion
void YsClassSample::Motion(int x,int y)
{
double dx,dy;
YsVec3 vec;
dx=double(x-lastX);
dy=double(lastY-y);
switch(mouseMode)
{
case 0:
eyeAtt.NoseUp(dy/300.0);
eyeAtt.YawLeft(-dx/300.0);
break;
case 1:
vec.Set(-dx/30.0,-dy/30.0,0.0);
vec=eyeAtt.GetMatrix()*vec;
eyeLookAt=eyeLookAt+vec;
break;
case 2:
RotatePolygon(dy/300.0,-dx/300.0);
break;
case 3:
vec.Set(dx/30.0,dy/30.0,0.0);
vec=eyeAtt.GetMatrix()*vec;
pointOfInterest=pointOfInterest+vec;
break;
}
lastX=x;
lastY=y;
}
示例2: Motion
void Motion(int x,int y)
{
if(button==GLUT_DOWN)
{
double dx,dy;
YsVec3 vec;
dx=double(x-lastX);
dy=double(lastY-y);
switch(mouseMode)
{
case 0:
eyeAtt.NoseUp(dy/300.0);
eyeAtt.YawLeft(-dx/300.0);
break;
case 1:
vec.Set(-dx/30.0,-dy/30.0,0.0);
vec=eyeAtt.GetMatrix()*vec;
eyeLookAt=eyeLookAt+vec;
break;
}
glutPostRedisplay();
}
lastX=x;
lastY=y;
}
示例3: Display
void YsClassSample::Display(void)
{
BIPOSATT biEyePos;
BIPOINT cursor;
eyePos.Set(0.0,0.0,-eyeDistance);
eyePos=eyeAtt.GetMatrix()*eyePos;
eyePos=eyeLookAt+eyePos;
BiSetPoint(&biEyePos.p,eyePos.x(),eyePos.y(),eyePos.z());
BiSetAngleDeg(&biEyePos.a,
YsRadToDeg(eyeAtt.h()),
YsRadToDeg(eyeAtt.p()),
YsRadToDeg(eyeAtt.b()));
BiClearScreen();
BiStartBuffer(&biEyePos);
BiSetPoint(&cursor,
pointOfInterest.x(),
pointOfInterest.y(),
pointOfInterest.z());
BiInsMarker(&cursor,&BiWhite,BIMK_CROSS);
DrawSlashedPolygon();
DrawPolygon(4,q,blu,YSFALSE);
DrawPolygon(4,r,blu,YSFALSE);
DrawAxis(5.0);
BiFlushBuffer();
BiSwapBuffers();
}
示例4: Display
void Display(void)
{
double matBuf[4*4];
YsVec3 eyePos;
YsMatrix4x4 eyeTfm;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
eyePos.Set(0.0,0.0,eyeDistance);
eyePos=eyeAtt.GetMatrix()*eyePos;
eyeTfm.Initialize();
eyeTfm.Translate(eyePos);
eyeTfm.Rotate(eyeAtt);
eyeTfm.Invert();
eyeTfm.Translate(-eyeLookAt);
eyeTfm.GetArray(matBuf);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMultMatrixd(matBuf);
DrawSeparatablePair(nVtx,vtx);
glFlush();
glutSwapBuffers();
}
示例5: Display
void Display(void)
{
double matBuf[4*4];
YsVec3 eyePos;
YsMatrix4x4 eyeTfm;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
eyePos.Set(0.0,0.0,eyeDistance);
eyePos=eyeAtt.GetMatrix()*eyePos;
eyeTfm.Initialize();
eyeTfm.Translate(eyePos);
eyeTfm.Rotate(eyeAtt);
eyeTfm.Invert();
eyeTfm.Translate(-eyeLookAt);
eyeTfm.GetArray(matBuf);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMultMatrixd(matBuf);
DrawShell(sh1,blu,drawInPolygon);
DrawShell(sh2,grn,drawInPolygon);
DrawAxis(5.0);
glFlush();
glutSwapBuffers();
}
示例6: MoveShell
void MoveShell(YsShell &sh,YsVec3 &mov)
{
YsMatrix4x4 mat,trn,viw,iViw;
sh.GetMatrix(mat);
viw=eyeAtt.GetMatrix();
iViw=viw;
iViw.Invert();
trn.Initialize();
trn.Translate(mov);
mat=viw*trn*iViw*mat;
sh.SetMatrix(mat);
}
示例7: RotateShell
void RotateShell(YsShell &sh,double pitch,double yaw)
{
YsMatrix4x4 mat,rot,viw,iViw;
sh.GetMatrix(mat);
viw=eyeAtt.GetMatrix();
iViw=viw;
iViw.Invert();
rot.Initialize();
rot.RotateZY(pitch);
rot.RotateXZ(yaw);
mat=viw*rot*iViw*mat;
sh.SetMatrix(mat);
}
示例8: Display
void Display(void)
{
double matBuf[4*4];
YsVec3 eyePos;
YsMatrix4x4 eyeTfm;
YsVec3 p;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
eyePos.Set(0.0,0.0,eyeDistance);
eyePos=eyeAtt.GetMatrix()*eyePos;
eyeTfm.Initialize();
eyeTfm.Translate(eyePos);
eyeTfm.Rotate(eyeAtt);
eyeTfm.Invert();
eyeTfm.Translate(-eyeLookAt);
eyeTfm.GetArray(matBuf);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMultMatrixd(matBuf);
DrawAxis(5.0);
glDisable(GL_LIGHTING);
glColor3d(1.0,1.0,1.0);
glBegin(GL_LINES);
glVertex3d(0.0,0.0,0.0);
glVertex3d(axisOfOrbit.x()*5.0,axisOfOrbit.y()*5.0,axisOfOrbit.z()*5.0);
glEnd();
rot.RotatePositive(p,orbiter);
glPushMatrix();
glTranslatef(p.x()*5.0,p.y()*5.0,p.z()*5.0);
DrawCursor();
glPopMatrix();
glFlush();
glutSwapBuffers();
}