Esempio n. 1
0
void InitGL()
{
	// Setting Camera Moving Sensitivity..
	hCamera.SetMouseSensitivity(0.1f, 0.02f, 0.1f);

	// Generating bottom plate...
	GLfloat gray[4] = {0.5f, 0.5f, 0.5f, 1.0f};
	GLfloat black[4] = {0.0f, 0.0f, 0.0f, 1.0f};
	btmPlate = hCamera.makeBottomPlate(gray, black, 80.0f, 80.0f, 10.0f, 0.0f);	

	// Generate an axis
	g_glLtAxis = GenerateAxis(5.0f);
}
Esempio n. 2
0
//===================
void Initialize()
//===================
{
	/*if (glewInit() != GLEW_OK)
	{
		printf("GLEW initialization failed\n");
		return;
	}*/

	GLfloat ambientLight[4] = {0.2f, 0.2f, 0.2f, 1.0f};
	GLfloat diffuseLight[4] = {0.9f, 0.9f, 0.9f, 1.0f};
	GLfloat diffuseLight1[4] = {0.2f, 0.2f, 0.2f, 1.0f};
	GLfloat specularLight[4] = {0.8f, 0.8f, 0.8f, 1.0f};
	GLfloat lightPosition[4] = {30.0f, 30.0f, 30.0f, 0.0f};
	GLfloat lightPosition1[4] = {-30.0f, 30.0f, -30.0f, 0.0f};

	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);  
	glShadeModel(GL_SMOOTH);
	glEnable(GL_DEPTH_TEST);
	glEnable(GL_CULL_FACE);
	glFrontFace(GL_CCW);
	
	glEnable(GL_LIGHTING);
	glLightfv(GL_LIGHT0, GL_AMBIENT, ambientLight);
	glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuseLight);
	//glLightfv(GL_LIGHT0, GL_SPECULAR, specularLight);	
	glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
	glEnable(GL_LIGHT0);

	glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuseLight1);
	glLightfv(GL_LIGHT1, GL_POSITION, lightPosition1);
	glEnable(GL_LIGHT1);

	// Setting Camera Moving Sensitivity..
	hCamera.SetMouseSensitivity(0.05f, 0.3f, 0.3f);
	
	// Generating bottom plate...
	btmPlate = hCamera.makeBottomPlate(gray, black, 200.0f, 200.0f, 10.0f, 0.0f);

	// Generate an axis
	g_glLtAxis = GenerateAxis(5.0f);

	// Create a rigidbody simulation
	g_BulletSim.Create();
}