Exemplo n.º 1
0
void
configFace(int i)
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	glRotatef(faceInfo[i].angle,
		faceInfo[i].x, faceInfo[i].y, faceInfo[i].z);
	gluLookAt(obj[0], obj[1], obj[2],  /* "eye" at object */
		      eye[0], eye[1], eye[2],  /* looking at eye */
			  up[0], up[1], up[2]);
	positionLights();
}
Exemplo n.º 2
0
	LightMeter::LightMeter( 
		Sprite* regularPointImg, 
		Sprite* pointFromPartnerImg, 
		Sprite* overTrickImg, 
		Sprite* notAPointImg,
		Sprite* contractPointImg,
		Sprite* orbCap,
		Sprite* orbRedCap,
		int numLights, int playerNum, const std::string& nilStr )
		: m_currentCount(0),m_inverted(playerNum == 1 || playerNum == 2),m_totalCount(0),
		m_lights(numLights,Light(Vec2(0,0),NOT_A_POINT)),
		m_regularPointImg(regularPointImg),m_pointFromPartnerImg(pointFromPartnerImg),
		m_overTrickImg(overTrickImg),m_notAPointImg(notAPointImg), m_orbCap(orbCap),
		m_contractPointImg(contractPointImg),
		m_playerNum(playerNum),
		m_baseSize(32.0f),m_hasBid(false), m_useLights(true),
		m_nilFailedOpacity(0.0f),m_nilFailIncreasing(true),m_nilFailMode(false),
		m_font(NULL),m_orbRedCap(orbRedCap),m_nilStr(nilStr)
	{
		positionLights();
	}
Exemplo n.º 3
0
void
display(void)
{
	glDisable(GL_TEXTURE_2D);
	glEnable(GL_DEPTH_TEST);
       	glEnable(GL_CULL_FACE);

        if (dynamicSmap) {
	  smapGenSphereMap(smap);
        }

	/* smapGenSphereMap leaves scissor enabled, disable it. */
	glDisable(GL_SCISSOR_TEST);

	glViewport(0, 0, W, H);

	if (showSphereMap) {
		glClear(GL_COLOR_BUFFER_BIT);

		glMatrixMode(GL_PROJECTION);
		glLoadIdentity();
		gluOrtho2D(0, 1, 0, 1);
		glMatrixMode(GL_MODELVIEW);
		glLoadIdentity();

		glEnable(GL_TEXTURE_2D);
		glDisable(GL_DEPTH_TEST);
		glBindTexture(GL_TEXTURE_2D, 7);
		glBegin(GL_QUADS);
			glTexCoord2f(0,0);
			glVertex2f(0,0);
			glTexCoord2f(1,0);
			glVertex2f(1,0);
			glTexCoord2f(1,1);
			glVertex2f(1,1);
			glTexCoord2f(0,1);
			glVertex2f(0,1);
		glEnd();
	} else {
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

		glDisable(GL_TEXTURE_2D);
		glEnable(GL_DEPTH_TEST);

		glMatrixMode(GL_PROJECTION);
		glLoadIdentity();
		gluPerspective(60.0, 1.0, 0.5, 40.0);

		glMatrixMode(GL_MODELVIEW);
		glLoadIdentity();
		gluLookAt(eye[0], eye[1], eye[2],  /* eye at eye */
				  obj[0], obj[1], obj[2],  /* looking at object */
				  up[0], up[1], up[2]);

		positionLights(-1, NULL);
		drawView(-1, NULL);
                if (multipass) {
                  doSphereMap = 1;
                }
		drawObject(NULL);
                if (multipass) {
                  doSphereMap = 0;
                  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
                  glDepthFunc(GL_EQUAL);
                  glEnable(GL_BLEND);
		  drawObject(NULL);
                  glDisable(GL_BLEND);
                  glDepthFunc(GL_LESS);
                }
	}

	if (doubleBuffer) {
		glutSwapBuffers();
	}
}