transformações geométricas coordenadas homogêneas e rotações
TRANSCRIPT
![Page 1: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/1.jpg)
Transformações Geométricas
Coordenadas Homogêneas
e
Rotações
![Page 2: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/2.jpg)
Motivação: representação de movimentos e formas
![Page 3: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/3.jpg)
Objetos compostos hierarquicamente
Hieraquia de movimentos
Base
Braço 1
Braço 2
Braço 3
Dedo Dedo
Hieraquia de transformações
![Page 4: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/4.jpg)
Transformações R2 R2
xy
yx
y
x 2
'
'
Exemplos:
x
yx´
y´ p´ =
x
y
y
xf
y
x'
'
pp T'
x
yp =
yx
yx
y
x 52'
'
)sin(
)cos('
'
yx
yx
y
x
![Page 5: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/5.jpg)
Transformações lineares R2 R2
x
y
m11 x´
y´ =
m21 m22
m12
Mostre que:
1 0
x
y
0 1
m11 m21
1 0 T =
m12 m22
0 1 T =
T (0) = 0A)
B)
0)()()()0( pppp TTTT
222112211 ),()()( RpRpppp ii eaTaTaaaT
![Page 6: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/6.jpg)
Transformações lineares: escala
x
y
a =x
y
x´
y´ a =
Redução (0< sx <1) ,Aumento (sy >1)
c
b
y
x
s
s
ys
xs
y
x
y
x
y
x
0
0
'
'
y
x
s
s
0
0S
x
y
i
j
0)( xs
T i
ysT
0)(j
![Page 7: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/7.jpg)
Transformações lineares: espelhamento
x´ = -1xy´ = y
x
y
x´
y´ p' =
=px
y
y
x
y
x
y
x
10
01
'
'
x
y
i
j
0
1)( iiT
1
0)( jjT
10
01yE
![Page 8: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/8.jpg)
Transformações lineares: rotação
x´
y´ p' =
x´
y´
r
x´ = x.cos - y.sen y´ = x.sen + y.cos
x
y
p =x
yr
r
sincoscoscos
sinsincoscos
rr
rr
y
x
y
x
cossin
sincos
'
'
r
sinsin - coscos )cos(
sincos cossin )sin(
)sin(
)cos(
'
'
r
r
y
x
![Page 9: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/9.jpg)
Transformações Lineares:matriz derivada pela geometria
x
y
sin
cos)(iT
cos
sin)(jT
i
j
cossin
sincosR
cossin
sincosR
![Page 10: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/10.jpg)
Mudança de referêncial
x
y
p =x
y
x
y
cos u
v=
sen cos
-sen
u
v
u
vou
x
y
p =
x´
y´ p'=
x
y
x
yux
u
v=
vxvy
uy
Para montarmos a matriz que transforma as coordenadas de um refencial xy para um novo refencial uv basta escrevermos as linhas como sendo os unitários das direções.
x
y
sin
cos)(iT
cos
sin)(jT
i
j
cossin
sincosR
![Page 11: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/11.jpg)
Mudança de coordenadas entre sistemas rotacionados
• As coordenas de um ponto rodado de um ângulo em relação a um sistema são iguais as coordenadas do ponto original em relação a um sistema que sofre a rotação inversa.
• Como o novo sistema sofre a rotação inversa, a matriz de rotação é a inversa da matriz que levaria da base original para a este novo sistema.
• As colunas de uma matriz de uma rotação são as transformadas dos vetores da base e a transposta desta matriz é a sua inversa (rotaçãomatriz ortonormal).
• Logo as linhas da matriz que escreve uma mudança entre bases ortonormais rodadas são as coordenadas do vetores da nova base em relação a base original.
![Page 12: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/12.jpg)
y
x
y
yx
y
x
10
tan1tan
'
'
Transformações lineares: cisalhamento (shear)
Cisalhamento em x
x
x
yy
x
y
ij
0
1)( iiT
1)(
tgT j
10
1 tgShx
![Page 13: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/13.jpg)
Exemplo de aplicação do cisalhamento
x
y
a
b
cplano de projeção
m
x
y
a' m'
x
y
c'
b'
a' m'
R
ySh
![Page 14: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/14.jpg)
Exemplo de aplicação do cisalhamento
2
xy
1
4
y
xyx
x
y
x12
101
2'
'
x
y
a x
y
c'
b'
a' m'
5
4
2
4
2'
'
xyy
xx
i
)(jj T
)(iT
![Page 15: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/15.jpg)
Decomposição Singular de Matrizes
USVM diagonal
rotações
0.7991650.601112
0.601112-0.799165
1.3294760
00.752176
0.6011120.799165-
0.7991650.601112
10
5773.01
10
5773.01
10
30tan1 0
M
)cos(37)sin(37
)sin(37-)cos(37
1.3294760
00.752176
)cos(-53)sin(-53
)sin(-53-)cos(-53
10
30tan100
00
00
000
)37()329.1,752.0()53()30( 000 RSRSh x
![Page 16: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/16.jpg)
Exemplo: cisalhamento como composição de rotações e escala
10
5773.01
0.7991650.601112
0.601112-0.799165
1.3294760
00.752176
0.6011120.799165-
0.7991650.601112
)30( 0xSh
)37( 0R
S
)53( 0R
![Page 17: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/17.jpg)
Transformações Geométricas: Translação
x
y
p
p'
tx
ty
t =
x
yp' =
tx
ty
+=x’
y’
x
y
? x´
y´ =
? ??
x
y
1 x´
y´ =
0 10 tx
ty
+
Não pode ser escrito na forma
Ruim paraimplementação
![Page 18: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/18.jpg)
Translação num plano do R3
yh
xh
w
w=1
x
y
t
1100
10
01
1
'
'
y
x
t
t
y
x
y
x
matriz de translação
![Page 19: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/19.jpg)
Concatenação
x
y
x0
y0
x
y
x
y
x
y
x0
y0
1 0
0 1
0 0 1
0
0
x
y 1 0
0 1
0 0 1
0
0
x
y
cos sin
sin cos
0
0
0 0 1
x
y
x
y
x
y
x
y
'
'
cos sin
sin cos
1
1 0
0 1
0 0 1
0
0
0 0 1
1 0
0 1
0 0 1 1
0
0
0
0
![Page 20: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/20.jpg)
Concatenação
x
y
x
y
x
y
x
y
x
y
x
yT1
R1
E
R2
T2P’= T2 R2 E R1 T1 PP’= T2 R2 E R1 T1 P
![Page 21: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/21.jpg)
Coordenadas projetivas(ou homogêneas)
x
yp
wx
wy
w
xh
yh
w
= =
x
y
1
= =
yh
xh
w
w=1
x
y
wx
wy
w
x = xh /w
y = yh /ww>0
Ex.:
3
2
1
3
2
6
4
2
9
6
3
== =
p
![Page 22: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/22.jpg)
Vantagens das coordenadas homogêneas (pontos no infinito)
yh
xh
w
w=1
x
y
2
3u =
u
uh
2
3
0
=?
?
w=1
uh
wh1
c1h2 = c2
h3
c3
2
3
2
2
3
1
2
3
1/2
2
3
1/4
2
3
0
. . .
1
1.5
2
3
4
6
8
12
infinitona
direção(2,3)
infinitona
direção(2,3)
h1 h2 h3 h4
c1 c2 c3 c4
![Page 23: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/23.jpg)
MGattass
Transformações em 3D(translações e escalas)
x’
y’
z’
1
0
1
0
0
0
0
1
0
tx
ty
tz
1
y
z
1
x
=
1
0
0
0
x
y
z
x’
y’
z’
1
0
sy
0
0
0
0
sz
0
0
0
0
1
y
z
1
x
=
sx
0
0
0
![Page 24: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/24.jpg)
MGattass
Rotação em torno do eixo y
x
y
z
'i'j
'k
y
y
sin
0
cos
'i
0
1
0
'j
y
y
cos
0
sin
'k
z
y
x
z
y
x
yy
yy
cos0sin
010
sin0cos
'
'
'
y
11000
0cos0sin
0010
0sin0cos
1
'
'
'
z
y
x
z
y
x
yy
yy
'k'i
k
i
z
x
'ˆˆ jj
y
![Page 25: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/25.jpg)
MGattass
Rotação em torno do eixo x
x
y
z
x
11000
0cossin0
0sincos0
0001
1
'
'
'
z
y
x
z
y
x
xx
xx
'i'j
'k
0
0
1
'i
x
x
sin
cos
0
'j
x
x
cos
sin
0
'k
z
y
x
z
y
x
xx
xx
cossin0
sincos0
001
'
'
'
![Page 26: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/26.jpg)
MGattass
Rotação em torno do eixo z
x
y
z
'i'j
'k
0
sin
cos
'ˆ z
z
i
0
cos
sin
'ˆ z
z
j
1
0
0
'k
z
y
x
z
y
x
zz
zz
100
0cossin
0sincos
'
'
'
z
11000
0100
00cossin
00sincos
1
'
'
'
z
y
x
z
y
x
zz
zz
![Page 27: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/27.jpg)
MGattass
Rotações em torno dos eixos cartesianos
x
y
z
x
y
z
11000
0cossin0
0sincos0
0001
1
'
'
'
z
y
x
z
y
x
xx
xx
11000
0cos0sin
0010
0sin0cos
1
'
'
'
z
y
x
z
y
x
yy
yy
11000
0100
00cossin
00sincos
1
'
'
'
z
y
x
z
y
x
zz
zz
![Page 28: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/28.jpg)
MGattass
Instanciação de objetos
braço
ante-braço
x
y
z
1
1
1
![Page 29: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/29.jpg)
MGattass
Ordem das transformações
x
y
y
xp
R x
y
2
22 y
xp
T
x
y
1
11 y
xp
R x
y
1
11 y
xp
x
y
2
22 y
xp
T
(a)
(b)
![Page 30: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/30.jpg)
MGattass
Composição com sistema local móvel
x,xL
y,yL
x L
y L
TL
x
y
p2 = R T pp1= T p e p2 = R p1
x
TR
y
x
y
xp
x
y y
1
11 y
xp
2
22 y
xp
p’= R p e p2 = TL p’ p2 = R T pou
p2
xy L
x
y
x LR p’p
p2 = R T R-1 R p
![Page 31: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/31.jpg)
MGattass
Instâncias de objetos
x2y
z2
xz
y2x4
y4
z4
x6
x1
y1
z1
x3
y3
z3
x5 z5y5d1
d2
![Page 32: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/32.jpg)
MGattass
Matrizes para desenho em cada sistema
x2y
z2
xz
y2x4
y4
z4
x1
y1
z1
x3
y3
z3
x5 z5y5d1
d2
base I
ante-braço Ry Rz1Ty1
cotovelo Ry Rz1Ty1Ty1
braço Ry Rz1Ty1Ty1 Rz3Ty3
pulso Ry Rz1Ty1Ty1 Rz3Ty3 Ty3
mão Ry Rz1Ty1Ty1 Rz3Ty3 Ty3 Rz5
![Page 33: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/33.jpg)
x2y
z2
xz
y2x4
y4
z4
x1
y1
z1
x3
y3
z3
x5 z5y5d1
d2
Desenha a base;Roda em y; Roda em z1;Translada em y1 de d1/2;Desenha o ante-braço;Translada em y2 de d1/2;Desenha cotovelo;Roda em z3;Translada em y3 de d2/2;Desenha o braço;Translada em y3 de d2/2;Desenha o pulso;Roda em z5;Desenha a mão;
![Page 34: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/34.jpg)
MGattass
Hierarquia em árvore
base
braço direitobraço esquerdo
![Page 35: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/35.jpg)
MGattass
Hierarquia em árvore
x5
y5
y6
y7
y8 y9
x6
x7
x8x9
a
b
c
d
e ef
a
palma
base dos dedos
dedo direitodedo esquerdo
![Page 36: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/36.jpg)
y7
y8 y9
x7
x8 x9
a
b
c
e efvoid desenhaDedos(float b,float c, float e, float f ) { /* dedo esquerdo */ glPushMatrix(); /* Salva matriz corrente C0 */ glTranslatef((f+e)/2,(b+c)/2,0.); /* C=CTesq */ glScalef(e,c,e); /* C=CS */ glutSolidCube(1.0); glPopMatrix(); /* Recupera da pilha C=C0 */ /* dedo direito */ glPushMatrix(); /* Salva matriz corrente C0 */ glTranslatef(-(f+e)/2,(b+c)/2,0.); /* C=CTdir */ glScalef(e,c,e); /* C=CS */ glutSolidCube(1.0); glPopMatrix(); /* Recupera da pilha C=C0 */}
![Page 37: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/37.jpg)
MGattass
Transformações em 3D(rotação em torno de um eixo qualquer)
x’
y’
z’
1
m12
m22
m32
0
m13
m23
m33
0
0
0
0
1
y
z
1
x
=
m11
m21
m31
0
m11 = ex2 + cos (1- ex
2)
m12 = exey(1-cos) - ez sen
m13 = ezex(1-cos) + ey sen
m21 = exey(1-cos) + ez sen
m22 = ey2 + cos (1- ey
2)
m23 = eyez(1-cos) - ex sen
m31 = exez (1-cos) - ey sen
m32 = eyez(1-cos)+ ex sen
m22 = ez2 + cos (1- ez
2)
x
y
z
z
y
x
e
e
e
ê
![Page 38: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/38.jpg)
MGattass
Matriz de rotação em torno de um eixo ê que não passa pela origem
xy
z
z
y
x
e
e
e
ê
xy
z
z
y
x
e
e
e
ê
p0
p0
xy
z
z
y
x
e
e
e
ê
p0
M
xy
z
z
y
x
e
e
e
ê
p0
1000
100
010
001
0
0
0
z
y
x
T
1000
100
010
001
0
0
0
1
z
y
x
T
![Page 39: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/39.jpg)
MGattass
Algebra da rotação em torno de um eixo unitário ê
e
pp
||p
v
'p
x
y
z pev ˆ
)()(' || pppp RR
)()(' || ppp RR
vppp )()(cos' || sen
p
p
'pv
)ˆ)(()ˆ)ˆ()((cosˆ)ˆ(' peepepepep sen
),ˆ,(' epp f
))(())((cos)(cos)(' pêêpêpêpêp sen
))(())(cos1()(cos' pêêpêpp sen
![Page 40: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/40.jpg)
MGattass
A coluna da matriz é a transformada dos vetores da base
sin)cos1(
sin)cos1(
)cos1(cos0
sin)cos1(
0
0
1
cos
2
22
21
11
yzx
zyx
x
y
z
z
y
x
x
eee
eee
e
e
e
e
e
e
e
m
m
m
sin)cos1(
)cos1(cos
sin)cos1(
0sin)cos1(
0
1
0
cos 2
32
22
12
xzy
y
zxy
x
z
z
y
x
y
eee
e
eee
e
e
e
e
e
e
m
m
m
233
23
13
)cos1(cos
sin)cos1(
sin)cos1(
0
sin)cos1(
1
0
0
cos
z
xyz
yxz
x
y
z
y
x
z
e
eee
eee
e
e
e
e
e
e
m
m
m
11000
0
0
0
'
'
'
333231
232221
131211
z
y
x
mmm
mmm
mmm
w
z
y
x
![Page 41: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/41.jpg)
MGattass
Matriz da rotação em torno de um eixo ê
1000
0)cos1(cossin)cos1(sin)cos1(
0sin)cos1()cos1(cossin)cos1(
0sin)cos1(sin)cos1()cos1(cos
2
2
2
zxzyyzx
xyzyzyx
yxzzxyx
eeeeeee
eeeeeee
eeeeeee
M
11000
0
0
0
'
'
'
333231
232221
131211
z
y
x
mmm
mmm
mmm
w
z
y
x
z
y
x
e
e
e
ê
x
y
z
![Page 42: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/42.jpg)
MGattass
Matriz de rotação em torno de um eixo
))(())(cos1()(cos' pêêpêpp sen
z
y
x
ee
ee
ee
xy
xz
yz
0
0
0
sinsin pê
z
y
x
100
010
001
coscos p
z
y
x
eee
e
e
e
zyx
z
y
x
)cos1()()cos1( pêê
pêêêIp )()cos1()(cos' 3 senT
êêêIR )()cos1()(cos 3 senT
![Page 43: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/43.jpg)
MGattass
Demonstração de:
z
y
x
eeeee
eeeee
eeeee
zeeyeexee
zeeyeexee
zeeyeexee
zyzxz
zyyxy
zxyxx
zzyzxz
zyyyxy
zxyxxx
2
2
2
)( êpê
)(
)(
)(
)(
zeyexee
zeyexee
zeyexee
e
e
e
zeyexe
zyxz
zyxy
zyxx
z
y
x
zyxêpê
z
y
x
eee
e
e
e
zyx
z
y
x
êpê )(
pêêêpê T )(
![Page 44: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/44.jpg)
MGattass
Interface para rotaçõestipo ArcBall
![Page 45: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/45.jpg)
MGattass
Rotação do ArcBall
![Page 46: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/46.jpg)
MGattass
Conservativo
![Page 47: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/47.jpg)
MGattass
90°
+ 90°
Complexidade da Rotação
Giroscópio
![Page 48: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/48.jpg)
ox 90o
z 90
ox 90 o
z 90
oy 90
![Page 49: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/49.jpg)
MGattass
Yaw-Pitch-Rol
cos0sin
010
sin0cos
R
cossin0
sincos0
001
R
100
0cossin
0sincos
R
coscoscossinsinsincossinsincossincos
sincoscoscossinsinsinsincoscossinsin
sinsincoscoscos
R
x
z y
![Page 50: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/50.jpg)
MGattass
Ângulos de Euler Transforma x-y-z em x’-y’-z’ em 3 passos
( , , )x y z
( , , ) ( , , )
( , , )x y z
z
x
y
z
x
y
z
x
y
z
x
y
x
Dx
CDx
Ax BCDx
Rotação de em torno eixo z
Rotação de em torno do eixo
Rotação de em torno do eixo ’
![Page 51: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/51.jpg)
MGattass
Ângulos de Euler Transforma x-y-z em x’-y’-z’ em 3 passos
( , , )x y z
( , , )
( , , )
( , , )x y z
Rotação de em torno eixo z
Rotação de em torno do eixo
Rotação de em torno do eixo ’
x
Dx
CDx
Ax BCDx
cos sin 0
sin cos 0
0 0 1
D1 0 0
0 cos sin
0 sin cos
Ccos sin 0
sin cos 0
0 0 1
B
cos cos cos sin sin cos sin cos cos sin sin sin
sin cos cos sin cos sin sin cos cos cos cos sin
sin sin sin cos cos
A
![Page 52: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/52.jpg)
cos0sin
010
sin0cos
R
cossin0
sincos0
001
R
100
0cossin
0sincos
R
coscoscossinsinsincossinsincossincos
sincoscoscossinsinsinsincoscossinsin
sinsincoscoscos
R
x
z y
z
x
y
z
x
y
z
x
y
z
x
y
cos sin 0
sin cos 0
0 0 1
D1 0 0
0 cos sin
0 sin cos
C
cos sin 0
sin cos 0
0 0 1
B
cos cos cos sin sin cos sin cos cos sin sin sin
sin cos cos sin cos sin sin cos cos cos cos sin
sin sin sin cos cos
A
![Page 53: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/53.jpg)
MGattass
Parametrização de rotações: Ângulos de Euler
1000
0
0
0
),,(yxzxzyxzxzyx
yxzxzyxzxzyx
yzyzy
zyx cccssscsscsc
csccssssccss
ssccc
R
xx
y
z
y
x
y
z
z
x
y
z
![Page 54: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/54.jpg)
MGattass
Ângulos de EulerGimbal lock
![Page 55: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/55.jpg)
MGattass
Ângulos de EulerGimbal lock
1000
00
00
0100
),90,(zxzxzxzx
zxzxzxzxz
ox csscsscc
ccsssccsR
xx
y
z
y=90o
x
y
z
z
x
y
z
1000
00)sin()cos(
00)cos()sin(
0100
zxzx
zxzx
1000
0
0
0
),,(yxzxzyxzxzyx
yxzxzyxzxzyx
yzyzy
zyx cccssscsscsc
csccssssccss
ssccc
R
![Page 56: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/56.jpg)
Interpolação não gera posições “entre”
![Page 57: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/57.jpg)
MGattass
Quatérnios
kjiq zyxs
vq ,s
![Page 58: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/58.jpg)
MGattass
Soma e multiplicação por escalar
2121221121,,, vvvvqq ssss
vvq asasaa ,,
![Page 59: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/59.jpg)
MGattass
Produto de dois quatérnios
kkkjkik
jkjjjij
ikijiii
kjiqq
21212121
21212121
21212121
2121212121
zzyzxzsy
zyyyxysy
zxyxxxsx
zsysxsss
kjikjiqq 2222111121zyxszyxs
jikkiikjjkkjiij
kkjjii
,,
1
kji
kjikji
)()()(
)()(
)(
212121212121
11122221
2121212121
xyyxzxxzyzzy
zyxszyxs
zzyyxxss
![Page 60: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/60.jpg)
MGattass
Produto de dois quatérnios(cont.)
),( 211221212121vvvvvvqq ssss
kji
kjikji
)()()(
)()(
)(
212121212121
11122221
2121212121
xyyxzxxzyzzy
zyxszyxs
zzyyxxss
![Page 61: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/61.jpg)
MGattass
Conjugado, normas eproduto interno
conjugado de um quatérnio vvq ,, ** ss
norma de um quatérnio
22222* ,,)( zyxssssn vvvvqqq
produto interno de dois quatérnios
2121212121 zzyyxxss qq
norma euclidiana 2
)( qq n
![Page 62: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/62.jpg)
MGattass
Quatérnio inverso e unitário
inverso de um quatérnio *1
)(
1q
n
1)(
)(
)(
1 *1
q
qqq
qqq
n
n
n
q1
ˆ unitário de um quatérnio
vq ˆsin,cosˆ
![Page 63: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/63.jpg)
MGattass
Quatérnios e rotações
Dada uma rotação definida por um eixo ê e um ângulo construímos o quatérnio unitário:
êq
2sin,
2cosˆ
Dado um ponto qualquer p do R3 construímos o quatérnio:
pp ,0
Calculamos o produto:1ˆˆ' qpqp
',0' pp
![Page 64: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/64.jpg)
MGattass
Demostração
êpêp
2sin,
2cos,0
2sin,
2cos)',0(
))(())(cos1()(cos' pêêpêpp sen
…
![Page 65: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/65.jpg)
MGattass
Composição de rotações
1q
2qseguida de
12
1112 ˆ)ˆˆ(ˆ qqpqq
11212 )ˆˆ()ˆˆ( qqpqq
12 ˆˆ qq
![Page 66: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/66.jpg)
MGattass
Composição de rotações
)0,0,1(,)0,0,1)(30sin(),30cos(ˆ21
23
1 ooq
)0,1,0(,)0,1,0)(45sin(),45cos(ˆ2
12
12
ooq
),,(,)0,0,1(,)0,1,0(,ˆˆ5
153
51
410
46
21
23
21
21
12qq
05.104 ),,(5
153
51ê
![Page 67: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/67.jpg)
ox 90
oz 90 )1,0,0)(45sin(),45cos(ˆ 00
1q
)0,0,1)(45sin(),45cos(ˆ 00
1q
)1,0,0(
2
1,
2
1ˆ
1q
)0,0,1(
2
1,
2
1ˆ
2q
Exemplo
![Page 68: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/68.jpg)
)1,0,0(
2
1,
2
1)0,0,1(
2
1,
2
1ˆˆ
12qq
)
3
1,
3
1,
3
1(
2
3,
2
1ˆˆ
12qq
o120
3
13
13
1 ê
![Page 69: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/69.jpg)
MGattass
Interpolação de quatérnios
1q
2q
21)1()( qqq
ttt
não é unitário
não representa rotação
]1,0[t
![Page 70: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/70.jpg)
MGattass
Interpolação de quatérnios
(1-t)1
q
2q
)(tq
1)( tq
)cos()(2
tt qq
)cos(21
21)( qqq
bat
)sin(
)sin(ˆ
)sin(
1sinˆ,ˆ,ˆ)(ˆ
2121
tt
tSlerpt qqqqq
t
![Page 71: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/71.jpg)
![Page 72: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/72.jpg)
![Page 73: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/73.jpg)
MGattass
Quatérnios e matrizes
),,,(ˆ zyxwq
1ˆˆ qpq
1000
0)(212222
022)(2122
02222)(21
22
22
22
ˆyxxwyzywxz
xwyzzxzwxy
ywxzzwxyzy
qM
![Page 74: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/74.jpg)
MGattass
Matrizes e quatérnios
1000
0
0
0
333231
232221
131211
mmm
mmm
mmm
332211222 1)222(24 mmmzyx
3322112 1)1(44 mmmw
33221121 1 mmmw
w
mmx
42332
w
mmy
43113
w
mmz
41221
1000
0)(212222
022)(2122
02222)(21
22
22
22
yxxwyzywxz
xwyzzxzwxy
ywxzzwxyzy
![Page 75: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/75.jpg)
MGattass
Transformação de normais
x
y
x
y
sx=0.5
d
c
b
a
n
0pn
1
z
y
x
p
0
1
1
z
y
x
dcbaT MMpn
1' Mn dcbaT
0
1
z
y
x
dcbaT pn
1
'z
y
x
Mp
d
c
b
a
TMn'
d
c
b
a
n
x
y
![Page 76: Transformações Geométricas Coordenadas Homogêneas e Rotações](https://reader035.vdocuments.pub/reader035/viewer/2022062219/552fc10b497959413d8c2594/html5/thumbnails/76.jpg)
MGattass
FIM