Beispiel #1
0
// this function actually renders the model at place (x, y, z) and then rotated around the y axis by 'angle' degrees
void Model::RenderModel()
{
	//glEnable(GL_CULL_FACE);
	//glCullFace(GL_BACK);
	glShadeModel(GL_SMOOTH);
	
	if(file->lights) //if we have lights in the model
	{
		EnableLights(); //enable all lights
		glCallList(lightListIndex); //set lights.
	}
	///cout << "B";
	Lib3dsNode *nodes;
	for(nodes = file->nodes;nodes != 0;nodes = nodes->next)// Render all nodes
	{	
		renderNode(nodes);
		//cout << "R";
	}
	
	
	if(file->lights)
		DisableLights(); // disable lighting, we don't want it have it enabled longer than necessary
	
	curFrame++;
	if(curFrame > file->frames) //if the next frame doesn't exist, go to frame 0
		curFrame = 0;
	lib3ds_file_eval(file, curFrame); // set current frame
	
	//glDisable(GL_CULL_FACE);
	glShadeModel(GL_FLAT);
}
Beispiel #2
0
 /*************************************************************************************
  Main program
 *************************************************************************************/
int main()
{
    System();                               // setup of microcontroller's peripherals and registers

    while(1)                                // infinity loop
    {
        EnableLights();                     // read pwm state, and lights on or off lights
        PatternLights();                    // repeated light patter
        
    } // end while
} // end main