Esempio n. 1
0
void DrawCube (float fSize)
{
  glPushMatrix();
  DrawCubeFace (fSize);
  glRotatef (90, 1, 0, 0);
  DrawCubeFace (fSize);
  glRotatef (90, 1, 0, 0);
  DrawCubeFace (fSize);
  glRotatef (90, 1, 0, 0);
  DrawCubeFace (fSize);
  glRotatef (90, 0, 1, 0);
  DrawCubeFace (fSize);
  glRotatef (180, 0, 1, 0);
  DrawCubeFace (fSize);
  glPopMatrix();
}
Esempio n. 2
0
void DrawCubeWithTextureCoords (float fSize)
{
  glPushMatrix();
  DrawCubeFace (fSize);
  glRotatef (90, 1, 0, 0);
  DrawCubeFace (fSize);
  glRotatef (90, 1, 0, 0);
  DrawCubeFace (fSize);
  glRotatef (90, 1, 0, 0);
  DrawCubeFace (fSize);
  glRotatef (90, 0, 1, 0);
  DrawCubeFace (fSize);
  glRotatef (180, 0, 1, 0);
  DrawCubeFace (fSize);
  glPopMatrix();
}
	void DrawCube( const Vector3& position, const Vector3 color, const Vector3 scale )
	{
		CommonGLDisables();

		// PUSH
		//
		glPushMatrix();

		glColor3f( color.x, color.y, color.z ); // Setting the color
		glTranslatef( position.x, position.y, position.z );
		glScalef( scale.x, scale.y, scale.z );

		forEachDirection( []( int axis, int sign, const Vector3& normal ) 
		{
			DrawCubeFace( axis, sign, normal );
		});

		// POP
		//
		glPopMatrix();

		CommonGLEnables();
		ResetColor();
	}