Download - Graficaci ón IA7200-T
![Page 1: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/1.jpg)
GraficaciónIA7200-T
Líneas Ocultas
![Page 2: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/2.jpg)
Graficación 2
Líneas Ocultas• Introducción• Visibilidad• Representación 3D• Figuras con hoyos• Caras y líneas (estructura de datos)• Interfaz gráfica• Gráficas de Tortuga
![Page 3: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/3.jpg)
Graficación 3
Segmentos y Triángulos
![Page 4: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/4.jpg)
Graficación 4
Segmentos y Triángulos
![Page 5: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/5.jpg)
Graficación 5
Visibilidad
lineSegment(line PQ, S set of triangles)In set S, try to find a triangle ABC that obscures PQ (or part of it) If no such triangle found,
Draw PQ Else
If triangle ABC leaves part PI of PQ visible lineSegment(PI, the remaining triangles of s);
If triangle ABC leaves JQ of PQ visible lineSegment(JQ, the remaining triangles of s);
![Page 6: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/6.jpg)
Graficación 6
Detalles de Implementación
![Page 7: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/7.jpg)
Graficación 7
Caso 1 (2D)• Minimax Test
• Max(P,Q)<=Min(A,B,C)
• ABC no obstruye a PQ
• = para el caso simétrico
![Page 8: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/8.jpg)
Graficación 8
Caso 2 (3D)• Igualdad de vértices• ABC no obstruye a PQ• Comparación por # vértice - eficiente• No siempre es posible
![Page 9: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/9.jpg)
Graficación 9
Caso 3 (3D)• Minimax 3D en z• Min(P,Q)<=Max(A,B,C)• ABC no obstruye a PQ
• = para el caso simétrico
![Page 10: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/10.jpg)
Graficación 10
Caso 4 (2D)• PQ en un lado de AB
• C en el otro lado
• Si ABC es CCW y ABP y ABQ son CW
• ABC no obstruye a PQ
• (= para lados BC y CA)
![Page 11: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/11.jpg)
Graficación 11
Caso 5 (2D)
• PQA = área del tríangulo PQA• PQA < 0 si PQA es CW• ABC no obstruye a PQ
![Page 12: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/12.jpg)
Graficación 12
Caso 6 (3D)• Funciona cuando el caso 3 falla
• ABC no obstruye a PQ
![Page 13: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/13.jpg)
Graficación 13
Caso 7 (2D)• PQ dentro de ABC• Si todos los demás casos no decidieron, ABC
oculta completamente a PQ• boolean pInside = Tools2D.insideTriangle(aScr, bScr, cScr, pScr);
boolean qInside = Tools2D.insideTriangle(aScr, bScr, cScr, qScr);
![Page 14: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/14.jpg)
Graficación 14
Caso 8 (3D)• P más cerca que ABC (o Q)
• pNear: hP > hqNear: hQ > h
• pNear && pInside || qNear && qInside• ABC no obstruye a PQ
![Page 15: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/15.jpg)
Graficación 15
Caso 9 (3D)• ABC obstruye parcialmente a PQ
1. Calcular (las proyecciones 2D de) I y J en la pantalla.
2. Calcular los valores z de I y J (interpolación lineal de 1/z).
3. Calcular distancia de I y J en dirección del plano.
![Page 16: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/16.jpg)
Graficación 16
Caso 9-1
• Esto se cumple para dos lados
• u=PQ, v=AB, w=A-P
A
B
C
![Page 17: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/17.jpg)
Graficación 17
Caso 9-2
• Se debe usar 1/z en lugar de z
![Page 18: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/18.jpg)
Graficación 18
Caso 9-3• n = (a,b,c) – normal al triángulo
• P dentro de ABC?
• Q dentro de ABC?
• P y Q dentro de ABC?
![Page 19: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/19.jpg)
Graficación 19
lineSegmentvoid lineSegment(Graphics g,
Point3D p, Point3D q, Point2D PScr, Point2D QScr, int iP, int iQ, int iStart)
• Si no se cuenta con número de vértice (iP, iQ), se usa -1
• iStart indica el índice del triángulo donde comenzamos
![Page 20: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/20.jpg)
Graficación 20
Gráficas de Tortuga• Mostrar Gráficas de Tortuga en Java
![Page 21: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/21.jpg)
Graficación 21
Gráficas de Tortuga• 3D: 3 ángulos para especificar la dirección
(H, L, U)
• 6 Comandos de Giro
![Page 22: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/22.jpg)
Graficación 22
Gráficas de Tortuga
![Page 23: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/23.jpg)
Graficación 23
Gráficas de Tortuga• Comandos de Tortuga 3D
![Page 24: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/24.jpg)
Graficación 24
Gráficas de Tortuga• Ejemplo:
![Page 25: Graficaci ón IA7200-T](https://reader035.vdocumento.com/reader035/viewer/2022062802/56814483550346895db11b2a/html5/thumbnails/25.jpg)
Graficación 25
Gráficas de Tortuga