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


C++ GLFrame::SetUpVector方法代码示例

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


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

示例1: SetUpFrame

void SetUpFrame(GLFrame &frame,const M3DVector3f origin, const M3DVector3f forward, const M3DVector3f up) {
	frame.SetOrigin(origin);
	frame.SetForwardVector(forward);
	M3DVector3f side,oUp;
	m3dCrossProduct3(side,forward,up);
	m3dCrossProduct3(oUp,side,forward);
	frame.SetUpVector(oUp);
	frame.Normalize();
}
开发者ID:mateuszbartczak,项目名称:PPG1,代码行数:9,代码来源:triangle.cpp

示例2: SetUpFrame

void SetUpFrame(GLFrame &cameraFrame,const M3DVector3f origin,
				const M3DVector3f forward,
				const M3DVector3f cameraUpDirection) {
					cameraFrame.SetOrigin(origin);
					cameraFrame.SetForwardVector(forward);
	M3DVector3f side,oUp;
	m3dCrossProduct3(side,forward,cameraUpDirection);
	m3dCrossProduct3(oUp,side,forward);
	cameraFrame.SetUpVector(oUp);
	cameraFrame.Normalize();
};
开发者ID:tbprojects,项目名称:pkg,代码行数:11,代码来源:excercise4.cpp

示例3: renderScene

void renderScene()
{
	//Colours:
	static GLfloat vDarkRed[] = {0.0f, 0.396f, 0.702f, 1.0f};
	static GLfloat vDarkGrey[] = {0.2f, 0.2f, 0.2f, 1.0f};

	static CStopWatch inputTimer;

	//Clear buffers
	glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
	
	//Beginning push:
	modelViewStack.PushMatrix();

	//Camera matrix:
	M3DMatrix44f mCamera;
	cameraFrame.GetCameraMatrix(mCamera);
	modelViewStack.PushMatrix(mCamera);

	modelViewStack.Rotate(-15.0f, 1.0f, 0.0f, 0.0f);

	if (screenshot)
	{
		cameraFrame.SetForwardVector(0, 0, -1);
		cameraFrame.SetUpVector(0, 1, 0);

		cameraFrame.GetCameraMatrix(mCamera);
		modelViewStack.PushMatrix(mCamera);
	}

	//Light source:
	static M3DVector4f vAmbient = {0.1f, 0.1f, 0.1f, 1.0f};
	static M3DVector4f vLightPos = {4.0f, -6.5f, 10.0f, 1.0f};
	static M3DVector4f vLightEyePos;
	m3dTransformVector4(vLightEyePos, vLightPos, mCamera);
		
	//Draw floor and grid:
	glEnable(GL_MULTISAMPLE);
	cRoom.draw(shaderManager, tPipeline, modelViewStack);

	// Highlight grid
	hlGrid.draw(shaderManager, tPipeline, modelViewStack);

	//Draw desks:
	stuDesks.drawAll(shaderManager, tPipeline, vLightEyePos, modelViewStack, vAmbient);						//Draw polygon version of desks
	glDisable(GL_MULTISAMPLE);																				//Disable multisampling (to use AA)
	
	glEnable(GL_BLEND);																						//Enable blending
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	glPolygonOffset(-1.0f, -1.0f);
	glEnable(GL_POLYGON_OFFSET_LINE);																		//Render wireframe in front of polygon
	glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);																//Wireframe mode
	glEnable(GL_LINE_SMOOTH);																				//Enable AA
	stuDesks.drawAll(shaderManager, tPipeline, vLightEyePos, modelViewStack, vAmbient, vDarkGrey);			//Draw wireframe version of desks
	
	//Reset stuff as they were before:
	glDisable(GL_LINE_SMOOTH);
	glDisable(GL_POLYGON_OFFSET_LINE);
	glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
	glDisable(GL_BLEND);

	//End cam push:
	modelViewStack.PopMatrix();

	//End pop:
	modelViewStack.PopMatrix();

	if (!screenshot)
	{
		newDeskButton.draw(W_WIDTH, W_HEIGHT);
		removeDeskButton.draw(W_WIDTH, W_HEIGHT);
		exportButton.draw(W_WIDTH, W_HEIGHT);
	}


	glutSwapBuffers();
	if (screenshot)
	{
		char name[38];
		sprintf(name, "Exports/screenshot%d.tga", expCounter); 
		gltWriteTGA(name);
		counterSaver();

		modelViewStack.PopMatrix();
		screenshot = false;
	}
	glutPostRedisplay();

	handleInput(inputTimer);
}
开发者ID:Errim,项目名称:Datorsalsplaneraren,代码行数:90,代码来源:main.cpp


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