Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Going Raw With Animations - Trilha iOS @ TDC Fl...

Going Raw With Animations - Trilha iOS @ TDC Florianópolis 2017

Knowing what is under your car hood might not help you drive better, but certainly helps you buy the right car. Or build a better one.

Animations are not different, and they do not work the same. Actually, there are many types of animations regarding where things get interpolated, who controls the animation, and most fundamentally: how to create natural-feeling movements, that resemble real life?

In this talk, you will get an overview of animations. But what you will actually learn, has nothing to do with the car itself. Lets take a look at the motor first?

Avatar for Ivan Seidel

Ivan Seidel

May 05, 2017
Tweet

More Decks by Ivan Seidel

Other Decks in Programming

Transcript

  1. Ivan Seidel Gomes Robótica FLL, OBR, CBR , RoboCup 4

    Competições Mundiais Eletrônica uControlador, Digital, Analógica Simulação Fisica, Controle, UI Machine Learning Going Raw with Animations
  2. Ivan Seidel Gomes Robótica FLL, OBR, CBR , RoboCup 4

    Competições Mundiais Eletrônica uControlador, Digital, Analógica Simulação Fisica, Controle, UI Machine Learning
  3. Ivan Seidel Gomes Robótica FLL, OBR, CBR , RoboCup 4

    Competições Mundiais Eletrônica uControlador, Digital, Analógica Simulação Fisica, Controle, UI Machine Learning
  4. Ivan Seidel Gomes Robótica FLL, OBR, CBR , RoboCup 4

    Competições Mundiais Eletrônica uControlador, Digital, Analógica Simulação Fisica, Controle, UI Machine Learning
  5. Robótica FLL, OBR, CBR , RoboCup 4 Competições Mundiais Eletrônica

    uControlador, Digital, Analógica Simulação Fisica, Controle, UI Machine Learning Ivan Seidel Gomes
  6. Robótica FLL, OBR, CBR , RoboCup 4 Competições Mundiais Eletrônica

    uControlador, Digital, Analógica Simulação Fisica, Controle, UI Machine Learning Ivan Seidel Gomes Conteúdo
  7. Robótica FLL, OBR, CBR , RoboCup 4 Competições Mundiais Eletrônica

    uControlador, Digital, Analógica Simulação Fisica, Controle, UI Machine Learning Conteúdo
  8. Transforms Point Y X x y p1 = x y

    z p2 = p2 p3 = p1 +
  9. Transforms Point Y X x y p1 = x y

    z p2 = p3 = p1 + 3 1
  10. Transforms 1.0 2.0 pt = 3.0 2.0 + = 4.0

    4.0 Translation dY dX Point Y X
  11. Transforms 1.0 2.0 ps = = 1.0*1 2.0*1 Point Y

    X Scale sY sX + 1.0*0 + 1.0*0 1 0 0 1
  12. Transforms 1.0 2.0 ps = = 1.0*1 2.0*1 Point Y

    X Scale sY sX + 1.0*0 + 1.0*0 1 0 0 1
  13. Transforms 1.0 2.0 ps = sX 0 0 sY =

    1.0*sX 2.0*sY Point Y X Scale sY sX
  14. Transforms x y ps = sX 0 0 sY =

    x*sX y*sY Point Y X Scale sY sX
  15. Transforms Point Y X Rotation Θ [1, 0] -1 0

    0 -1 1×-1 + 0×0 0×0 + 0×-1 = =
  16. Transforms Translation dY dX Point Y X Scale sY sX

    Rotation Θ 1 0 0 0 1 0 0 0 1 pX pY 1
  17. Transforms 1 0 dX 0 1 dY 0 0 1

    pX pY 1 Translation dY dX Point Y X Scale sY sX Rotation Θ
  18. Transforms sX 0 0 0 sY 0 0 0 1

    pX pY 1 Translation dY dX Point Y X Scale sY sX Rotation Θ
  19. Transforms 0 0 0 0 1 pX pY 1 cosΘ

    cosΘ -cosΘ sinΘ Translation dY dX Point Y X Scale sY sX Rotation Θ
  20. Transforms sX 0 dX 0 sY dY 0 0 1

    pX pY 1 0 0 0 0 1 cosΘ cosΘ -cosΘ sinΘ Translation dY dX Point Y X Scale sY sX Rotation Θ
  21. sX 0 dX 0 sY dY 0 0 1 0

    0 cosΘ cos -cosΘ sin … Transforms Translation dY dX Point Y X Scale sY sX Rotation Θ
  22. UIView Translation dY dX Point Y X Scale sY sX

    Rotation Θ Property: UIView.transform
  23. UIView Translation dY dX Point Y X Scale sY sX

    Rotation Θ Property: UIView.layer.transform
  24. UIView Translation dY dX Point Y X Scale sY sX

    Rotation Θ Property: UIView.layer.transform
  25. UIView Translation dY dX Point Y X Scale sY sX

    Rotation Θ Property: UIView.layer.transform Demo!
  26. UIView Translation dY dX Point Y X Scale sY sX

    Rotation Θ Property: UIView.layer.transform
  27. UIView Translation dY dX Point Y X Scale sY sX

    Rotation Θ Property: UIView.layer.presentation().transform
  28. Translation dY dX Point Y X Scale sY sX Rotation

    Θ Transforms Z dZ sZ vZ vY vX
  29. Translation dY dX Point Y X Scale sY sX Rotation

    Θ Transforms Z dZ sZ vZ vY vX 1 0 0 0 1 0 0 0 1 pX pY 1
  30. Translation dY dX Point Y X Scale sY sX Rotation

    Θ Transforms Z dZ sZ vZ vY vX 1 0 0 0 1 0 0 0 1 pX pY 0 0 0 0 0 0 1 1 pZ
  31. Translation dY dX Point Y X Scale sY sX Rotation

    Θ Transforms Z dZ sZ vZ vY vX sX 0 0 0 sY 0 0 0 sZ pX pY 0 0 0 dX dY dZ 1 1 pZ
  32. Translation dY dX Point Y X Scale sY sX Rotation

    Θ Transforms Z dZ sZ vZ vY vX 0 0 0 0 1 pX pY 0 0 0 0 0 0 1 1 pZ cosΘ cosΘ -cosΘ sinΘ Eixo Z
  33. Translation dY dX Point Y X Scale sY sX Rotation

    Θ Transforms Z dZ sZ vZ vY vX 0 0 1 0 0 pX pY 0 0 0 0 0 0 1 1 pZ cosΘ cosΘ -cosΘ sinΘ Eixo Y
  34. Translation dY dX Point Y X Scale sY sX Rotation

    Θ Transforms Z dZ sZ vZ vY vX 1 0 0 0 0 pX pY 0 0 0 0 0 0 1 1 pZ cosΘ cosΘ -cosΘ sinΘ Eixo X
  35. Translation dY dX Point Y X Scale sY sX Rotation

    Θ Transforms Z dZ sZ vZ vY vX 1 0 0 0 1 0 0 0 1 pX pY 0 0 0 0 0 0 1 1 pZ
  36. Translation dY dX Point Y X Scale sY sX Rotation

    Θ Transforms Z dZ sZ vZ vY vX 1 0 0 0 1 0 0 0 1 pX pY 0 0 d 0 0 0 1 1 pZ Perspectiva d
  37. UIView CALayer alpha UIView CALayer opacity center position transform transform

    backgroundColor backgroundColor bounds bounds frame frame
  38. Renderização 2.208 x 1.242 = ~2.700.000 pixels pixels x 4

    bytes = 10.800.000 bytes 50 ciclos x bytes = 540.000.000 ciclos ciclos ÷ 2.4Ghz = ~200 ms
  39. Vertex Buffer Vertex Indexes 1 2 3 1 3 4

    5 6 7 5 7 8 … … … … … … … … … … … … … OpenGL
  40. Vertex Buffer Vertex Indexes 1 2 3 1 3 4

    5 6 7 5 7 8 … … … … … … … … … … … … … OpenGL
  41. Vertex Buffer Vertex Indexes 1 2 3 1 3 4

    5 6 7 5 7 8 … … … … … … … … … … … … … OpenGL
  42. Interpolação Estado Estado 0.0 0.5 1.0 0.75 0.25 Float Color

    Integer Matrix Vectors Interpoláveis: * 0.1 + 0.9 * MyFloatA MyFloatB
  43. Interpolação Estado Estado 0.0 0.5 1.0 0.75 0.25 Float Color

    Integer Matrix Vectors Interpoláveis: * 0.1 + 0.9 * [R, G, B] [R, G, B]
  44. Interpolação Estado Estado 0.0 0.5 1.0 0.75 0.25 Float Color

    Integer Matrix Vectors Interpoláveis: 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 * 0.1 + 0.9 *
  45. Interpolação Estado Estado 0.0 0.5 1.0 0.75 0.25 Float Color

    Integer Matrix Vectors Interpoláveis: Linear Ease (In/Out) Curvas: Spring Bounce Dinâmica
  46. Interpolação Estado Estado 0.0 0.5 1.0 0.75 0.25 CPU Interpolação:

    GPU Float Color Integer Matrix Vectors Interpoláveis: Linear Ease (In/Out) Curvas: Spring Bounce Dinâmica
  47. Interpolação Estado Estado 0.0 0.5 1.0 0.75 0.25 Float Color

    Integer Matrix Vectors Interpoláveis: Linear Ease (In/Out) Curvas: Spring Bounce Dinâmica CPU Interpolação: GPU Demo!