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
Basic 3D Math for ARKit
Search
KBOY
September 15, 2018
Technology
1
680
Basic 3D Math for ARKit
KBOY
September 15, 2018
Tweet
Share
More Decks by KBOY
See All by KBOY
How to make Stripe and RevenueCat coexist in an app
fujikawakei
0
74
iOS15から使えるScreenTimeAPIをFlutterアプリで動かす
fujikawakei
0
120
FlutterエンジニアがFlutterFlowを使ってみた感想
fujikawakei
0
120
Flutterと課金
fujikawakei
0
120
【スタートアップ開発者必見】firebaseとalgoliaとstripeで1人で本格的なiOSアプリを作る方法
fujikawakei
2
550
ARCore-Kotlin-Sampler作ってきました
fujikawakei
0
240
ARKitのための3D算数
fujikawakei
3
4.5k
ARKitでお絵かきする方法2選
fujikawakei
0
1.8k
assertion を積極的に使って 役立った話
fujikawakei
0
1.9k
Other Decks in Technology
See All in Technology
PL900試験から学ぶ Power Platform 基礎知識講座
kumikeyy
0
120
開発組織のための セキュアコーディング研修の始め方
flatt_security
3
1.4k
サーバーレスアーキテクチャと生成AIの融合 / Serverless Meets Generative AI
_kensh
12
3.1k
白金鉱業Meetup Vol.17_あるデータサイエンティストのデータマネジメントとの向き合い方
brainpadpr
4
300
Moved to https://speakerdeck.com/toshihue/presales-engineer-career-bridging-tech-biz-ja
toshihue
2
670
地方拠点で エンジニアリングマネージャーってできるの? 〜地方という制約を楽しむオーナーシップとコミュニティ作り〜
1coin
1
220
Cloud Spanner 導入で実現した快適な開発と運用について
colopl
1
320
Datadog APM におけるトレース収集の流れ及び Retention Filters のはなし / datadog-apm-trace-retention-filters
k6s4i53rx
0
330
スタートアップ1人目QAエンジニアが QAチームを立ち上げ、“個”からチーム、 そして“組織”に成長するまで / How to set up QA team at reiwatravel
mii3king
2
1.3k
マルチモーダル理解と生成の統合 DeepSeek Janus, etc... / Multimodal Understanding and Generation Integration
hiroga
0
370
ビジネスモデリング道場 目的と背景
masuda220
PRO
9
410
Larkご案内資料
customercloud
PRO
0
650
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Designing Experiences People Love
moore
139
23k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Raft: Consensus for Rubyists
vanstee
137
6.8k
How to train your dragon (web standard)
notwaldorf
91
5.8k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
How GitHub (no longer) Works
holman
313
140k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
Transcript
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