本文整理汇总了C++中Viewport::fillOrientationMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewport::fillOrientationMatrix方法的具体用法?C++ Viewport::fillOrientationMatrix怎么用?C++ Viewport::fillOrientationMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewport
的用法示例。
在下文中一共展示了Viewport::fillOrientationMatrix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: display
void display(void)
{
double orimat[16] = {0};
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
// The Scene begins
win.mode3D();
// Apply our orientation
win.fillOrientationMatrix(orimat);
glMultMatrixd(orimat);
// Translate - in world space
glTranslated(win.pos().x(), win.pos().y(), win.pos().z());
// Some randomly colored cubes
glColor3f(cubeCol[0], cubeCol[1], cubeCol[2]);
glPushMatrix();
glTranslated(2.0, 0.0, 0.0);
glutSolidCube(0.5);
glPopMatrix();
glPushMatrix();
glColor3f(cubeCol[3], cubeCol[4], cubeCol[5]);
glTranslated(-2.0, 0.0, 0.0);
glutSolidCube(0.5);
glPopMatrix();
glPushMatrix();
glColor3f(cubeCol[6], cubeCol[7], cubeCol[8]);
glTranslated(0.0, 0.0, 2.0);
glutSolidCube(0.5);
glPopMatrix();
glPushMatrix();
glColor3f(cubeCol[9], cubeCol[10], cubeCol[11]);
glTranslated(0.0, 0.0, -2.0);
glutSolidCube(0.5);
glPopMatrix();
// A big wiresphere
glColor3f(1.0, 1.0, 1.0);
glutWireSphere(32.0, 16, 16);
// Simple 2D crosshair
win.mode2D();
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_LINES);
glVertex2f(0.5 * win.w() - 5, 0.5 * win.h());
glVertex2f(0.5 * win.w() + 5, 0.5 * win.h());
glVertex2f(0.5 * win.w(), 0.5 * win.h() - 5);
glVertex2f(0.5 * win.w(), 0.5 * win.h() + 5);
glEnd();
glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
// We're done.
glutSwapBuffers();
glPopMatrix();
}