Beispiel #1
0
void Initialize() {
	std::cout << "Starting Initialization" << std::endl;
	/* Variable Initialization */
	modelChosen = THIRTEENBOX;
    spotLightChosen = NOSPOTLIGHT;
	planeEnabled = true;

	/* Model Initialization */
    camera = viewglut_create(1.0, 100.0);
    p = plane_create(20);
	box = obj_create("thirteen-box.obj");
	troll = obj_create("trolluvd1.obj");
	
	//glEnable(GL_TEXTURE_2D);
	glEnable(GL_DEPTH_TEST);
	glEnable(GL_LESS);
	createMenuItems();

	boxloader = new ShaderLoader("thirteenBoxVertexShader2.glsl", "thirteenBoxFragmentShader2.glsl");
	boxloader->initializeTextures("thirteen-diffuse.png");
	boxloader->initializeTextures("thirteen-normal.png");
	//boxloader->initializeTextures("thirteen-specular.png");

	spotlight1loader = new ShaderLoader("spotlightVertexShader.glsl", "spotlightFragmentShader.glsl");
	spotlight1loader->initializeTextures("spotlight2.png");

	std::cout << "Initialization Finished" << std::endl;
}
Beispiel #2
0
void startup(void)
{
    last_time   = 0;

    zoom        = 0.5;                                                         \
    rotation_x  = 0.0;
    rotation_y  = 0.0;

    position_x  = 0.0;
    position_y  = 2.0;
    position_z  = 5.0;
    
    keyboard_dx = 0.0;
    keyboard_dy = 0.0;
    keyboard_dz = 0.0;
    
    C =  cube_create();
    P = plane_create(20);

    glEnable(GL_DEPTH_TEST);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);

    glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
}
Beispiel #3
0
void startup(void)
{
    rotation_x =  0.0;
    rotation_y =  0.0;

    position_x =  0.0;
    position_y =  2.0;
    position_z =  5.0;

    C =  cube_create();
    P = plane_create(20);

    glEnable(GL_DEPTH_TEST);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);

    glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
}