Ejemplo n.º 1
0
// Display func for sub window 1
void renderScenesw1() {

	glutSetWindow(subWindow1);

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glLoadIdentity();
	gluLookAt(x, y, z,
		      x + lx,y + ly,z + lz,
			  0.0f,1.0f,0.0f);

	renderScene2();

	// display fps in the top window
 	frame++;

	time=glutGet(GLUT_ELAPSED_TIME);
	if (time - timebase > 1000) {
		sprintf(s,"Lighthouse3D - FPS:%4.2f",
			frame*1000.0/(time-timebase));
		timebase = time;
		frame = 0;
	}

	setOrthographicProjection();

	glPushMatrix();
	glLoadIdentity();
	renderBitmapString(5,30,0,GLUT_BITMAP_HELVETICA_12,s);
	glPopMatrix();
	restorePerspectiveProjection();

	glutSwapBuffers();
}
Ejemplo n.º 2
0
static void display(void)
{
    const double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
    const double a = t*2000.0;

    const double scene1Fog = 0.1;
    const double scene2Fog = 0.03;

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    GLfloat fogColor[] = {1.f, 1.f, 1.f, 1};
    glFogfv(GL_FOG_COLOR, fogColor);
    glFogi(GL_FOG_MODE, GL_EXP2);
    glFogf(GL_FOG_DENSITY, scene2Fog + (sin(10*t) + 1) * scene2Fog);
    glHint (GL_FOG_HINT, GL_NICEST);
    glPushMatrix();
        glTranslated(0,0,-8);
     //   glScaled(0.3,0.3,0.3);

        glPushMatrix();
        glRotated(-a/100,0,1,0);

        glBegin(GL_TRIANGLES);

        renderScene2();

        glEnd();
        glPopMatrix();
    glPopMatrix();

    glutSwapBuffers();
}
Ejemplo n.º 3
0
void GpuRaytraceScene::renderScene()
{
	
	renderScene2();
	return;
	//m_raytraceData->m_renderToTexture->enable();
	m_instancingRenderer->renderScene();
	//m_raytraceData->m_renderToTexture->disable();
}
Ejemplo n.º 4
0
void renderScenesw3(void)
{
	glutSetWindow(subWindow3);
	glLoadIdentity();
	gluLookAt(x - lz * 10, y, z + lx * 10,
		x, y, z,
		0.0f, 1.0f, 0.0f);
	renderScene2(subWindow3);
}
Ejemplo n.º 5
0
void renderScenesw2(void)
{
	glutSetWindow(subWindow2);
	glLoadIdentity();
	gluLookAt(x, y + 15, z,
		x, y - 1, z,
		lx, 0, lz);
	renderScene2(subWindow2);
}
Ejemplo n.º 6
0
void renderScenesw1(void)
{
	glutSetWindow(subWindow1);
	glLoadIdentity();
	gluLookAt(x, y, z,
		x + lx, y + ly, z + lz,
		0.0f, 1.0f, 0.0f);
	renderScene2(subWindow1);
}
Ejemplo n.º 7
0
// Display func for sub window 3
void renderScenesw3() {

	glutSetWindow(subWindow3);

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glLoadIdentity();
	gluLookAt(x-lz*10 , y, z+lx*10,
		      x ,y ,z ,
			  0.0f,1.0f,0.0f);

	// Draw red cone at the location of the main camera
	glPushMatrix();
	glColor3f(1.0,0.0,0.0);
	glTranslatef(x,y,z);
	glRotatef(180-(angle+deltaAngle)*180.0/3.14,0.0,1.0,0.0);
	glutSolidCone(0.2,0.8f,4,4);
	glPopMatrix();

	renderScene2();

	glutSwapBuffers();
}