Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Basic 3D Math for ARKit
Search
KBOY
September 15, 2018
Technology
850
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Basic 3D Math for ARKit
KBOY
September 15, 2018
Transcript
114 slides
Basic 3D Mathematics for ARKit Kei Fujikawa 2018.9.15@Tokyo iOS Meetup
Who?
Who?
Why is ے?
Spajam 2nd Prized Best Body Japan Held ے.swift Showing in Article Smooth-sailing?
Not so easy.
A bunch of ے
ے 4FOHPLV1FSJPE
AR!
Question!
Spajam 2nd Prized Best Body Japan Held ے.swift Showing in Article
I have to ride on this big wave.
So,
I joined AR startup this January
Graffity Inc.
Apps we’re making
I studied ARKit for so much time
Not so easy.
Let’s think about this example.
Place an airplane at the 30cm in front of screen’s
touched point.
None
Looks way too easy
Getting x,y from touch gesture and Z is 0.3?
Finally
None
It does not show
Ideal
None
Real
None
Not so easy
So,
I studied 3D programming.
Books I read for study IUUQTBN[OUP.4V.F( IUUQTBN[OUP1,'Z5
So,
Today I will explain 3D Programming clearly.
Basic 3D Mathematics for ARKit Kei Fujikawa 2018.9.15@Tokyo iOS Meetup
Today’s goal
Place an airplane at the 30cm in front of screen’s
touched point.
None
We will study •Coordinate systems •Method for coordinate transformation
Coordinate system for ARKit
Coordinates World Object Camera Screen Drawn by iPad Pro
World Coordinate system The biggest coordinates In your iPhone
Object Coordinate system Airplane’s own coordinate
Camera coordinate system ΧϝϥͷϩʔΧϧ࠲ඪ
Camera
Screen
Screen
Coordinates World Object Camera Screen Drawn by iPad Pro
Let’s check the Goal
Place an airplane at the 30cm in front of screen’s
touched point.
30cm Get x,y from tap gesture Place the object In
the world. Place at 30cm In front of camera Convert to world ᶃ ᶄ ᶅ Convert to Screen ᶆ ᶄ’ Convert to screen
ᶃPlace at 30cm in front of camera Minus 30cm
None
ᶄConvert to World
Convert from a coordinate to a coordinate
ᶄ’Convert to screen
World <-> Screen
ᶅGet x,y from tap gesture
ᶆPlace in the world
Screen <-> World
At 30cm Tapped position Convert Convert
Calculate at easy coordinate system
By the way
You can do it all in the screen coordinate
30cm Get x,y from tap gesture Place the object In
the world. Place at 30cm In front of camera Convert to world ᶃ ᶄ ᶅ Convert to Screen ᶆ ᶄ’ Convert to screen Removable
Removabl
It looks easier!!
Yes
You can code shorter
None
But
In fact
This 0.996 is Same with 0.3m in camera coordinate
What is 0.996?
Review for coordinate system
0.0 1.0 Screen’s z 0.001m 1000m Camera’s z
Screen’s Z
https://developer.apple.com/documentation/scenekit/scnscenerenderer/1522631-unprojectpoint Z is 0.0~1.0
Camera’s Z?
None
None
None
debug
None
Z is 0.01~1000
Let’s change zNear.
None
0.0 1.0 Screen’s z 0.001m 1000m Camera’s z
Screen’s z vs Camera’s z
http://www.alecjacobson.com/weblog/?p=3835 -0.001 -1000 0.996 screenZ = f(n + cameraZ)/((f −
n)cameraZ) -0.3 screenZ cameraZ
screenZ = f(n + cameraZ)/((f − n)cameraZ) screenZ = 1000(0.001
+ (−0.3))/((1000 − 0.002)(−0.3)) f = 1000 n = 0.001 cameraZ = − 0.3 screenZ = 0.9966...
Way too hassle
Removable?
Must
So,
Understanding Coordinate’s system And..
None
Make sense?
Let’s study more?
Make a airplane Bigger or Rotation
Scale
Rotate by SCNVector4 Axis Degree
Rotate by Euler angle
Rotate by Euler angle x
Rotate by Euler angle Y
Rotate by Euler angle Z
x Y Z
That’s it
One more thing.
Making ARKit 2.0 repository
End
More Decks by KBOY
See All by KBOY
How to make Stripe and RevenueCat coexist in an app
fujikawakei
0
190
iOS15から使えるScreenTimeAPIをFlutterアプリで動かす
fujikawakei
0
180
FlutterエンジニアがFlutterFlowを使ってみた感想
fujikawakei
0
220
Flutterと課金
fujikawakei
0
200
【スタートアップ開発者必見】firebaseとalgoliaとstripeで1人で本格的なiOSアプリを作る方法
fujikawakei
2
650
ARCore-Kotlin-Sampler作ってきました
fujikawakei
0
320
ARKitのための3D算数
fujikawakei
3
5.4k
ARKitでお絵かきする方法2選
fujikawakei
0
2.2k
assertion を積極的に使って 役立った話
fujikawakei
0
2.2k
Other Decks in Technology
See All in Technology
Terraform 0 to 100:100個以上のリポジトリを常に最新にし続けるための自動化
sue445
2
130
Claude Codeで新規事業を伸ばせるか? Zennの試行錯誤の記録
wadayusuke
2
240
信頼性を犠牲にせず、PR マージからデプロイまで人の介入を完全にゼロにするまでの道のり
knwoop
2
720
契約書SaaSにAIエージェントを組み込む
sansantech
PRO
0
190
Context parameters で作る!はじめての型クラス
kworkdev
PRO
1
150
ラクスル会社紹介資料|エンジニア向け / RAKSUL Introduction for Engineers
raksulrecruiting
0
140
変更差分を読むために環境を整備しよう
pipepasta
1
470
Gov-JAWS#9 統合監視機能のマネージドサービス化+AIによる障害時自動調査
fj_yoshimura_kosuke
0
210
こんなに変わった! AWSネットワークの常識
shotashiratori
16
11k
_マネジメントする人される人ナイト_2026__良いチームを作っていきたい_お気持ち_.pdf
xkxaxkx
0
810
統制されたID・権限をどう利用するか : DPoP/FAPIによるAPIセキュリティ強化
oidfj
1
190
Agent Routerで作るマルチテナント 推論基盤 #CNDW2026 / Building Multi-Tenant Inference Platform with Agent Router #CNDW2026
everpeace
3
390
Featured
See All Featured
Music & Morning Musume
bryan
48
7.5k
Balancing Empowerment & Direction
lara
6
1.4k
How to build a perfect <img>
jonoalderson
1
6.2k
Visualization
eitanlees
153
17k
Typedesign – Prime Four
hannesfritz
42
3.2k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
The untapped power of vector embeddings
frankvandijk
2
2k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
850
Abbi's Birthday
coloredviolet
5
11k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Darren the Foodie - Storyboard
khoart
PRO
5
4.1k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
380