-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodelado.c
84 lines (60 loc) · 3.09 KB
/
modelado.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*************************************************************************/
/* */
/* modelado.c */
/* Rev. 2.0 01/01/2002 AUTORES: O. Belmonte, M. Chover, J. Ribelles */
/* */
/*************************************************************************/
#include <stdio.h>
#include "glig.h"
#include "modelado.h"
/******************************************************************************************/
/* Crea las distintas display lists */
/* Parametros: Ninguno */
/* Salida: Ninguna */
/******************************************************************************************/
void IniciaDisplayLists (void)
{
CreaEscena ();
}
/******************************************************************************************/
/* Dibuja la escena */
/* Parametros: Ninguno */
/* Salida: Ninguna */
/******************************************************************************************/
void DibujaEscena (void)
{
glCallList (escena);
}
/******************************************************************************************/
/* Crea una display list para toda la escena */
/* Parametros: Ninguno */
/* Salida: Ninguna */
/******************************************************************************************/
void CreaEscena(void)
{
escena = glGenLists (1);
if (escena != 0)
{
glNewList (escena, GL_COMPILE);
// TODO 06: COMMENT SPHERE DRAWING AND DRAW A CUBE USING "igSolidCubo" FROM glig
// TODO 09: CALL THE FUNCTION THAT DRAWS THE NEW CUBE AND SCALE IT (5.f, 5.f, 5.f)
// TODO 10: COMMENT THE CUBE AND UNCOMMENT THE SOLID SPHERE DRAWING
// TODO 14: DEFINE MATERIAL PROPERTIES FOR THE SOLID SPHERE
/*
NOTE: When a object is illuminated, its reaction depends on its material. Each material could have these properties:
+ AMBIENT color. Most common: NNatural color of the object
+ DIFFUSE color. Most common: Natural color of the object
+ SPECULAR color. Color of highlight. Most common: white
+ SHININESS: Specular exponent. Low -> spread hightlight. High -> concentrated highlight
+ EMISSION: Simulare material light emission
*/
// 14.1. RED AMBIENT COLOR
// 14.2. RED DIFFUSE COLOR
// 14.3. WHITE SPECULAR COLOR
// 14.4 SHININESS OF 20
// 14.5 LOW EMISSION
glutSolidSphere(5.f, 20, 16);
glEndList ();
}
else puts ("Se ha producido un error creando la display list de la escena.");
}