Exemplo n.º 1
0
void FGAPIENTRY      //x						 y						 z
glutWireBoxx(GLfixed Width, GLfixed Depth, GLfixed Height)
{
	GLfixed v[8][3];
	int i;

	v[0][0] = v[1][0] = v[2][0] = v[3][0] = - Width/ 2;
	v[4][0] = v[5][0] = v[6][0] = v[7][0] = Width / 2;
	v[0][1] = v[1][1] = v[4][1] = v[5][1] = -Depth / 2;
	v[2][1] = v[3][1] = v[6][1] = v[7][1] = Depth / 2;
	v[0][2] = v[3][2] = v[4][2] = v[7][2] = -Height / 2;
	v[1][2] = v[2][2] = v[5][2] = v[6][2] = Height / 2;

	glVertexPointer(3, GL_FIXED, 0, v);
	glEnableClientState (GL_VERTEX_ARRAY);

	for ( i = 0; i < 6; i++)
	{
		glNormal3x(boxvec[i][0], boxvec[i][1], boxvec[i][2]);
		glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_SHORT, wireboxndex[i]);
	}
	glDisableClientState (GL_VERTEX_ARRAY);
}
void glNormal3xLogged(GLfixed nx, GLfixed ny, GLfixed nz) {
	printf("glNormal3x(%i, %i, %i)\n", nx, ny, nz);
	glNormal3x(nx, ny, nz);
}