1
Computación Gráfica(Algunos Fundamentos)
Universidad de los AndesDemián Gutierrez
Octubre 2011
2
Sist. de Coordenadas
3
Sist. de Coordenadas(mano derecha)
¿Por qué será de la mano derecha?
4
Transformaciones 3D
5
Transformaciones (3D)
6
Transformaciones (3D)
7
Transformaciones (3D)
8
Transformaciones (3D)
alrededor de X
alrededor de Y
alrededor de Z
[xyz1]
9
Transformaciones (3D)
10
¿Qué hay sobre la rotaciónalrededor de un eje arbitrario?
11
Transformaciones (3D)
12
...mucha, mucha matemática
después...
13
Transformaciones (3D)
14
Red Book
15
¿cómo dibujar?
16
Soporte Conceptual / Fundamentos
glBegin(GL_POINTS);
// Pts (GREEN)glColor3f(0, 1, 0);glVertex3f(0, 0, 0);glVertex3f(1, 0, 0);glVertex3f(1, 1, 0);glVertex3f(1, 1, 0);glVertex3f(1, 1, 0);
// Pts (RED)glColor3f(1, 0, 0);glVertex3f(0, 0, 0);glVertex3f(0, 0, 1);glVertex3f(0, 1, 1);glVertex3f(1, 1, 0);glVertex3f(1, 1, 0);
glEnd();
17
Soporte Conceptual / Fundamentos
glBegin(GL_LINES);
// LIN 1 (GREEN)glColor3f(0, 1, 0);glVertex3f(0, 0, 0);glVertex3f(1, 0, 0);
// LIN 2 (GREEN)glVertex3f(1, 1, 0);glVertex3f(1, 1, 0);
// LIN 3 (RED)glColor3f(1, 0, 0);glVertex3f(0, 0, 0);glVertex3f(0, 0, 1);
// LIN 4 (RED)glVertex3f(1, 1, 0);glVertex3f(1, 1, 0);
glEnd();
18
Soporte Conceptual / Fundamentos
glBegin(GL_LINE_STRIP);
// LIN 1 (GREEN)glColor3f(0, 1, 0);glVertex3f(0, 0, 0);glVertex3f(1, 0, 0);
// LIN 2 (GREEN)glVertex3f(1, 1, 0);glVertex3f(1, 1, 0);
// LIN 3 (RED)glColor3f(1, 0, 0);glVertex3f(0, 0, 0);glVertex3f(0, 0, 1);
// LIN 4 (RED)glVertex3f(1, 1, 0);glVertex3f(1, 1, 0);
glEnd();
19
Soporte Conceptual / Fundamentos
glBegin(GL_QUADS);
// QUAD 1glColor3f(0, 1, 0);glVertex3f(0, 0, 0);glVertex3f(1, 0, 0);glVertex3f(1, 1, 0);glVertex3f(1, 0, 0);
// QUAD 2glColor3f(1, 0, 0);glVertex3f(0, 0, 0);glVertex3f(0, 0, 1);glVertex3f(0, 1, 1);glVertex3f(0, 1, 0);
// QUAD n// ...
glEnd();
20
Soporte Conceptual / Fundamentos
glBegin(GL_TRIANGLES);
// TRI 1glColor3f(0, 1, 0);glVertex3f(0, 0, 0);glVertex3f(1, 0, 0);glVertex3f(1, 1, 0);
// TRI 2glColor3f(1, 0, 0);glVertex3f(0, 0, 0);glVertex3f(0, 0, 1);glVertex3f(0, 1, 1);
// TRI n// ...
glEnd();
21
Soporte Conceptual / Fundamentos
22
Soporte Conceptual / Fundamentos
23
Soporte Conceptual / Fundamentos
24
Transformaciones 3D(Ahora en OpenGL...)
25
Transformaciones (3D)
26
Transformaciones (3D)
27
Transformaciones (3D)
28
Las Pilas de Matrices
Matriz de Modelovs
Matriz de Proyección
29
Matrices
30
Matrices
Matriz de Modelomodifica como se transforman las
coordenadas de los modelos
Matriz de Proyecciónmodifica como se
transforman los objetos 3D a la vista
31
Matrices
32
Matrices
33
¿A dónde mira la cámara?
34
¿A donde ve la cámara?
35
¿A donde ve la cámara?
¿?
36
¿A donde ve la cámara?
37
¿Cómo se proyecta el mundo 3D en 2D?
38
Perspective Projection
39
Perspective Projection
40
Perspective Projection
41
Perspective Projection
42
Orthographic Projection
43
Orthographic Projection
44
Orthographic Projection
45
¿El “puerto de vista” o viewport?
46
Viewport
47
¿texturas?¿iluminación / sombreado?
¿material?¿curvas?¿otros?
48
coming soon
49
Orthographic Projection
http://user.xmission.com/~nate/tutors.html
Nate RobinsOpenGL Tutorials:
50
Gracias
¡Gracias!