Example #1
0
void Cilindro::forma()
{
  glPushMatrix();
  tapa(-1.0);
  cuerpo();
  glTranslatef(0.0, 0.0, altura);
  tapa(1.0);
  glPopMatrix();
}
Example #2
0
//Constructor con parámetros
Quesito::Quesito(int nQ, float z, float x) {
	this->cortes = nQ; //capas
	this->x = z; //radio
	this->y = x; //altura
	this->idxVertice = 0;
	this->idxCara = 0;
	this->idxNormal = 0;
	this->pPerfil = 2; //nº puntos del perfil

	this->numVertices = (cortes * pPerfil) + 2; // cortes * puntosPerfil + 2 vertices especiales
	this->numCaras = cortes + 2; //(cortes - 1) + 3 (dos caras y una tapa) 
	this->numNormales = numCaras;

	//creación de los arrays
	this->vertice = new PV3D*[numVertices];
	this->normal = new PV3D*[numNormales];
	this->cara = new Cara*[numCaras];

	caraRedonda();

	//Vértices especiales en el eje Y
	vertice[idxVertice] = new PV3D(0, 0, 0, 1);
	idxVertice++;
	vertice[idxVertice] = new PV3D(0, y, 0, 1);

	caraDelantera();
	caraTrasera();
	tapa();

}