当前位置: 首页>>代码示例>>C++>>正文


C++ Viewport::fillOrientationMatrix方法代码示例

本文整理汇总了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();
}
开发者ID:vain,项目名称:SpaceSim,代码行数:71,代码来源:SpaceSim.cpp


注:本文中的Viewport::fillOrientationMatrix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。