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
Qing-Cheng Li
February 12, 2015
Programming
210
0
Share
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
220
XingZhe - iOS BDD UI Automation Test Framework
qcl
0
660
High Performance iOS Apps Testing and Release
qcl
0
130
Mobile App Continuous Delivery
qcl
0
140
How QCLean Works: Introduction to Browser Extensions
qcl
0
680
黑暗時代網頁程式設計 - HTML
qcl
0
140
Big Data Processing lol
qcl
1
150
油電雙掌
qcl
0
900
Other Decks in Programming
See All in Programming
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
810
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
320
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
550
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
6.1k
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
150
20260320登壇資料
pharct
0
170
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
110
KagglerがMixSeekを触ってみた
morim
0
370
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
130
存在論的プログラミング: 時間と存在を記述する
koriym
5
850
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
370
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
190
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
21k
Claude Code のすすめ
schroneko
67
220k
So, you think you're a good person
axbom
PRO
2
2k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
460
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
200
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
360
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
160
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Color Theory Basics | Prateek | Gurzu
gurzu
0
290
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
760
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.