void InitGL ( void )     // Inicializamos parametros
{

    glShadeModel(GL_SMOOTH);							// Habilitamos Smooth Shading
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);				// Negro de fondo
    glClearDepth(1.0f);									// Configuramos Depth Buffer
    glEnable(GL_DEPTH_TEST);							// Habilitamos Depth Testing

    //Configuracion luz
    glLightfv(GL_LIGHT0, GL_POSITION, Position);
    glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, Position2);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);


    glDepthFunc(GL_LEQUAL);								// Tipo de Depth Testing a realizar
    glEnable ( GL_COLOR_MATERIAL );
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

    glEnable(GL_TEXTURE_2D);
    /*****************************
    * DefiniciOn de texturas
    *****************************/
    pared.LoadTGA("pared.tga");
    pared.BuildGLTexture();
    pared.ReleaseImage();

    piso.LoadTGA("piso.tga");
    piso.BuildGLTexture();
    piso.ReleaseImage();

    ventana.LoadTGA("ventana.tga");
    ventana.BuildGLTexture();
    ventana.ReleaseImage();

    puerta.LoadTGA("puerta.tga");
    puerta.BuildGLTexture();
    puerta.ReleaseImage();
}
Exemple #2
0
void InitGL()     // Inicializamos parametros
{
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);				// Negro de fondo	

	glEnable(GL_TEXTURE_2D);

	glShadeModel(GL_SMOOTH);
	//Para construir la figura comentar esto
	glLightfv(GL_LIGHT1, GL_POSITION, Position);
	glLightfv(GL_LIGHT1, GL_DIFFUSE, Diffuse);
	//glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, Position2);
	glEnable(GL_LIGHTING);
	glEnable(GL_LIGHT0);
	//glEnable(GL_LIGHT1);

	glEnable(GL_COLOR_MATERIAL);					//Habilitar GlColor3f
	//glEnable(GL_CULL_FACE);
	//glCullFace(GL_BACK);
	//glPolygonMode(GL_BACK, GL_LINE);

	glClearDepth(1.0f);									// Configuramos Depth Buffer
	glEnable(GL_DEPTH_TEST);							// Habilitamos Depth Testing
	glDepthFunc(GL_LEQUAL);								// Tipo de Depth Testing a realizar
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

	glEnable(GL_AUTO_NORMAL);
	glEnable(GL_NORMALIZE);

	/* setup blending */
	//glBlendFunc(GL_SRC_ALPHA,GL_ONE);			// Set The Blending Function For Translucency
	//glColor4f(1.0f, 1.0f, 1.0f, 0.5); 

	rectoria._3dsLoad("rectoria/rectoria.3ds");
	rectoria.LoadTextureImages();
	rectoria.GLIniTextures();
	rectoria.ReleaseTextureImages();

	biblioteca._3dsLoad("biblioteca/biblioteca.3ds");
	biblioteca.LoadTextureImages();
	biblioteca.GLIniTextures();
	biblioteca.ReleaseTextureImages();

	//islas._3dsLoad("islas/islas.3ds");
	//islas.LoadTextureImages();
	//islas.GLIniTextures();
	//islas.ReleaseTextureImages();

	texturaPasto.LoadTGA("city/pasto01.tga");
	texturaPasto.BuildGLTexture();
	texturaPasto.ReleaseImage();

	facultadD._3dsLoad("derecho3DS/derecho.3ds");
	facultadD.LoadTextureImages();
	facultadD.GLIniTextures();
	facultadD.ReleaseTextureImages();

	t_placasRectoria.LoadTGA("city/pasto01.tga");
	t_placasRectoria.BuildGLTexture();
	t_placasRectoria.ReleaseImage();

	t_escalerasIslas.LoadTGA("cuadrosrectoria/texturaEsc.tga");
	t_escalerasIslas.BuildGLTexture();
	t_escalerasIslas.ReleaseImage();

	quadratic = gluNewQuadric();			// Create A Pointer To The Quadric Object ( NEW )
	gluQuadricNormals(quadratic, GLU_SMOOTH);	// Create Smooth Normals ( NEW )
	gluQuadricTexture(quadratic, GL_TRUE);		// Create Texture Coords ( NEW )


	objCamera.Position_Camera(0, 2.5f, 3, 0, 2.5f, 0, 0, 1, 0);



}