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


C++ Billboard::Draw方法代码示例

本文整理汇总了C++中Billboard::Draw方法的典型用法代码示例。如果您正苦于以下问题:C++ Billboard::Draw方法的具体用法?C++ Billboard::Draw怎么用?C++ Billboard::Draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Billboard的用法示例。


在下文中一共展示了Billboard::Draw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Draw

void DemoState::Draw()
{

	Game::iterator it = Game::iterator("Camera");
	if (!it.seekName("DemoCam"))
	{
		assert(0);
	}
	GameObject* GO = it;
	((Camera*)GO)->Use();
	Game::instance()->DrawObjects();
	timer += DisplayManager::instance()->getDtSecs();
	if (timer < 0)
	{
		glDisable(GL_DEPTH_TEST);
		glDepthMask(GL_FALSE);
		glMatrixMode(GL_PROJECTION);
		GLfloat f[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
		glGetFloatv(GL_PROJECTION_MATRIX,f);
		glLoadIdentity();
		glMatrixMode(GL_MODELVIEW);
		glLoadIdentity();

		Splash->UseThisTexture();
		Billboard b;
		b.Draw();
		Splash->UseNoTexture();
		glEnable(GL_DEPTH_TEST);
		glDepthMask(GL_TRUE);
		glMatrixMode(GL_PROJECTION);
		glLoadMatrixf(f);

	}
	if (timer > 1)
	{
		timer = -1;
	}



}
开发者ID:VileLasagna,项目名称:WarpDrive,代码行数:41,代码来源:DemoState.cpp

示例2: drawScene

void drawScene()
{// covert speed to string
	string speedword = to_string(speed);

	string SpeedPhrase = "Speed: ";
	SpeedPhrase.append(speedword);
	string Direction = "Direction: ";
	Direction.append(carHeading);
	glColor3f(1, 0, 0);
	//print words
	glWindowPos2i((winWidth / 2) -125, winHeight - (sHeight*1.2));
	printString(SpeedPhrase);
	glWindowPos2i((winWidth / 2) + 75, winHeight - (sHeight*1.2));
	printString(Direction);


	// Draw terrain
	glCallList(terrainID);

	glEnable(GL_LIGHTING);
	trafficLight.setMaterials();
	
	/*vector<string> test;
	test=trafficLight.GetMaterialNames();
	for (int i = 0; i < test.size(); i++)
		cout << "name: " << test[i] << endl;*/
	// North-East (NS_Signal)
	glPushMatrix();
	glTranslatef(10, 0, -10.5);
	glScalef(1/3.28/12, 1/3.28/12, 1/3.28/12);
	trafficLight.setSignal(NS_Signal);
	trafficLight.Draw();
	glPopMatrix();
	
	
	glPushMatrix();
	glTranslatef(10, 0, -10);
	glRotatef(-45, 0, 1, 0);
	glCallList(surveillanceCameraID);
	glPopMatrix();

	// North-West (WE_Signal)
///board 1
	//glColor3f(1, 1, 0);
	glPushMatrix();
	board.Draw();
	glPopMatrix();
// board 2
	glPushMatrix();
	board2.Draw();
	glPopMatrix();

	glPushMatrix();
	glTranslatef(-10, 0, -10.5);
	glScalef(1 / 3.28 / 12, 1 / 3.28 / 12, 1 / 3.28 / 12);
	glRotatef(90, 0, 1, 0);
	trafficLight2.setSignal(WE_Signal);
	trafficLight2.Draw();
	glPopMatrix();

	glPushMatrix();
	glTranslatef(-10, 0, -10);
	glRotatef(45, 0, 1, 0);
	glCallList(surveillanceCameraID);
	glPopMatrix();
	
	// South-East (WE_Signal)
	glPushMatrix();
	glTranslatef(10, 0, 10);
	glScalef(1 / 3.28 / 12, 1 / 3.28 / 12, 1 / 3.28 / 12);
	glRotatef(-90, 0, 1, 0);
	trafficLight3.setSignal(WE_Signal);
	trafficLight3.Draw();
	glPopMatrix();

	glPushMatrix();
	glTranslatef(10, 0, 10.5);
	glRotatef(-135, 0, 1, 0);
	glCallList(surveillanceCameraID);
	glPopMatrix();

	// South West(SN_Signal)
	glPushMatrix();
	glTranslatef(-10, 0, 10);
	glScalef(1 / 3.28 / 12, 1 / 3.28 / 12, 1 / 3.28 / 12);
	glRotatef(180, 0, 1, 0);
	trafficLight4.setSignal(NS_Signal);
	trafficLight4.Draw();
	glPopMatrix();

	glPushMatrix();
	glTranslatef(-10, 0, 10.5);
	glRotatef(135, 0, 1, 0);
	glCallList(surveillanceCameraID);
	glPopMatrix();

	// Draw the car.
	glPushMatrix();
	glTranslatef(carPosition.x, carPosition.y, carPosition.z);
	glRotatef(carDirection, 0, 1, 0);
//.........这里部分代码省略.........
开发者ID:rhaye012,项目名称:Reginald-Hayes-Code-sample,代码行数:101,代码来源:main.cpp


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