Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
iOS Core Animation Transform
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Qing-Cheng Li
February 12, 2015
Programming
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
iOS Core Animation Transform
Introduction to iOS Core Animation Transform
Qing-Cheng Li
February 12, 2015
More Decks by Qing-Cheng Li
See All by Qing-Cheng Li
Using Buck to save iOS project build time
qcl
0
1.1k
Mobile App Continuous Delivery
qcl
0
230
XingZhe - iOS BDD UI Automation Test Framework
qcl
0
670
High Performance iOS Apps Testing and Release
qcl
0
140
Mobile App Continuous Delivery
qcl
0
140
How QCLean Works: Introduction to Browser Extensions
qcl
0
690
黑暗時代網頁程式設計 - HTML
qcl
0
150
Big Data Processing lol
qcl
1
160
油電雙掌
qcl
0
910
Other Decks in Programming
See All in Programming
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
480
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.9k
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
0
180
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
110
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
190
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
210
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
840
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.7k
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
120
Contextとはなにか
chiroruxx
1
390
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
330
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Deep Space Network (abreviated)
tonyrice
0
220
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
300
Embracing the Ebb and Flow
colly
88
5.1k
The Language of Interfaces
destraynor
162
27k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
550
Test your architecture with Archunit
thirion
1
2.3k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
330
エンジニアに許された特別な時間の終わり
watany
107
250k
Ethics towards AI in product and experience design
skipperchong
2
330
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.9k
Transcript
Transforms @qcl 2015.02.12
None
Transform • Affine Transforms ◦ CGAffineTransform ◦ view.layer.affineTransform • 3D
Transforms ◦ CATransform3D ◦ view.layer.transfrom ◦ view.layer.sublayerTransform
Affine Transforms • Math behind the matrix ◦ https://developer.apple. com/library/mac/documentation/GraphicsImaging/Co
nceptual/drawingwithquartz2d/dq_affine/dq_affine. html#//apple_ref/doc/uid/TP30001066-CH204-
Affine Transforms • Rotation ◦ CGAffineTransformMakeRotation(CGFloat angle) • Scale ◦
CGAffineTransformMakeScale(CGFloat sx, CGFloat sy) • Translation ◦ CGAffineTransformMakeTranslation(CGFloat tx, CGFloat ty)
Combining Transforms • CGAffineTransformIdentity ◦ A 3x3 Identity matrix •
Rotation ◦ CGAffineTransformRotate(CGAffineTransform t, CGFloat angle) • Scale ◦ CGAffineTransformScale(CGAffineTransform t, CGFloat sx, CGFloat sy) • Translation ◦ CGAffineTransformTranslate(CGAffineTransform t, CGFloat tx, CGFloat ty) • The order you apply transforms is important! ◦ 矩陣乘法沒有交換律
Customized Affine Transform • You can set the fileds of
a CGAffineTransform directly. ◦ a ◦ b ◦ c ◦ d ◦ t x ◦ t y
3D Transforms
3D Transforms • Left hand coordinate system
3D Transforms • Rotation ◦ CATransform3DMakeRotatation(CGFloat angle, CGFloat x, CGFloat
y, CGFloat z) • Scale ◦ CATransform3DMakeScale(CGFloat sx, CGFloat sy, CGFloat sz) • Translation ◦ CATransform3DMakeTranslation(CGFloat tx, CGFloat ty, CGFloat tz)
3D Transforms Combination • CATransform3DIdentity ◦ A 4x4 identity matrix
• Rotation ◦ CATransform3DRotate(CATransform3D t, CGFloat angle, CGFloat x, CGFloat y, CGFloat z) • Scale ◦ CATransform3DScale(CATransform3D t, CGFloat sx, CGFloat sy, CGFloat sz) • Translation ◦ CATransform3DTranslate(CATransform3D t, CGFloat tx, CGFloat ty, CGFloat tz)
Perspective Projection • Prespective transform sometimes called Z transform
Perspective Projection • m34 of CATransform3D • -1 / d
• More: ◦ http://en.wikipedia. org/wiki/3D_projection#Perspective_projection
Vanishing Point • anchorPoint
sublayerTransform • Apply to sublayer but not affect itself. •
The vanishing point is the anchorPoint of itself, not sublayer’s anchorPoint
Backfaces • view.layer.doubleSided
Layer Flattening • Expected result is wrong. • The layers
don’t exist in the same 3D space. • The 3D sence in each layer is flattened.