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
ARKitのための3D算数
Search
KBOY
August 30, 2018
Programming
3
4.5k
ARKitのための3D算数
iOSDC 2018
KBOY
August 30, 2018
Tweet
Share
More Decks by KBOY
See All by KBOY
How to make Stripe and RevenueCat coexist in an app
fujikawakei
0
61
iOS15から使えるScreenTimeAPIをFlutterアプリで動かす
fujikawakei
0
110
FlutterエンジニアがFlutterFlowを使ってみた感想
fujikawakei
0
120
Flutterと課金
fujikawakei
0
110
【スタートアップ開発者必見】firebaseとalgoliaとstripeで1人で本格的なiOSアプリを作る方法
fujikawakei
2
540
ARCore-Kotlin-Sampler作ってきました
fujikawakei
0
230
Basic 3D Math for ARKit
fujikawakei
1
660
ARKitでお絵かきする方法2選
fujikawakei
0
1.7k
assertion を積極的に使って 役立った話
fujikawakei
0
1.9k
Other Decks in Programming
See All in Programming
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
340
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
480
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
180
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
100
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
260
Recoilを剥がしている話
kirik
5
6.8k
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
140
快速入門可觀測性
blueswen
0
380
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
140
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Become a Pro
speakerdeck
PRO
26
5k
Facilitating Awesome Meetings
lara
50
6.1k
The Cult of Friendly URLs
andyhume
78
6.1k
Optimising Largest Contentful Paint
csswizardry
33
3k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Side Projects
sachag
452
42k
Transcript
ARKitͷͨΊͷ 3Dࢉ KBOY@ےΤϯδχΞ 2018.8.30@iOSDC 2018
ࣗݾհ ૣҴా͕ߍͰ͢
ےΤϯδχΞͷܦྺ
݄ ݄ ݄ ݄ ݄
Spajam༏ल ϕετϘσΟδϟύϯग़ ے.swift։࠵ స৬υϥϑτग़ԋ ॱ෩ຬൕʂʁ
͔ͦ͠͠͏͘ͳ͍
ےΤϯδχΞͷ಄
ےΤϯδχΞ ઓࠃ࣌
ͦ͏ͩʂARͩʂ
݄ ݄ ݄ ݄ ݄
Spajam༏ल ϕετϘσΟδϟύϯग़ స৬υϥϑτग़ԋ ے.swift։࠵
Δ͔͠ͳ͍ ͜ͷϏοάΣʔϒʹ
ͱ͍͏͜ͱͰ
ࠓ1݄ʹ ARελʔτΞοϓJOIN
Graffity Inc. Ϧʔμʔ
͜ΜͳΞϓϦ࡞ͬͯ·͢
ͱ͍͏͜ͱͰARKitΛ ؤுͬͯษڧ͠·ͨ͠
͔͠͠ ͦ͏͘ͳ͍
͜͏͍͏ྫΛ ߟ͑ͯΈ·͠ΐ͏
εΫϦʔϯ্ͷλοϓͨ͠෦ͷ 30cmલʹ ඈߦػΛஔ͘
None
༨༟ͬ͠ΐʂ
λοϓδΣενϟʔ͔Β x, yΛऔಘ, z0.3mΛೖΕΕʂ
݁Ռ
None
શવग़ͯ͜ͳ͍…
ཧ
None
ݱ࣮
None
ͬͺΓ ͦ͏͘ͳ͍
ͦΜͳ࣌ɺϦʔμʔ͕ खΛࠩ͠৳ͯ͘Εͨ
3DϓϩάϥϛϯάΛ ษڧ͢Ε༨༟ͩΑ
Ϧʔμʔʂʂ
ͦͯ͠
3Dϓϩάϥϛϯά Λษڧͨ͠ɻ
ษڧʹͬͨຊ IUUQTBN[OUP.4V.F( IUUQTBN[OUP1,'Z5
ͱ͍͏͜ͱͰ
ࠓօ͞Μʹ Θ͔Γ͘͢ 3DϓϩάϥϛϯάΛ આ໌͠·͢
ARKitͷͨΊͷ 3Dࢉ KBOY@ےΤϯδχΞ 2018.8.30@iOSDC 2018
ࠓͷΰʔϧ
εΫϦʔϯ্ͷλοϓͨ͠෦ͷ 30cmલʹ ඈߦػΛஔ͘
None
ษڧ͢Δ͜ͱ •࠲ඪܥΛΔ •࠲ඪมͷϝιουΛΔ
ARKitͰ͏࠲ඪܥ
࠲ඪ·ͱΊ ϫʔϧυ࠲ඪܥ ΦϒδΣΫτ࠲ඪܥ Χϝϥ࠲ඪܥ εΫϦʔϯ࠲ඪܥ iPad ProͰॻ͖·ͨ͠ɻ
ϫʔϧυ࠲ඪܥ ͜ΕΑΓେ͖ͳ֎ଆͷ ࠲ඪۭؒͰදݱͰ͖ͳ͍
ΦϒδΣΫτ࠲ඪܥ ඈߦػࣗͷϩʔΧϧ࠲ඪʂ
Χϝϥ࠲ඪܥ ΧϝϥͷϩʔΧϧ࠲ඪ
Χϝϥ࠲ඪܥ
εΫϦʔϯ࠲ඪܥ
εΫϦʔϯ࠲ඪܥ
࠲ඪ·ͱΊ ϫʔϧυ࠲ඪܥ ΦϒδΣΫτ࠲ඪܥ Χϝϥ࠲ඪܥ εΫϦʔϯ࠲ඪܥ iPad ProͰॻ͖·ͨ͠ɻ
ΰʔϧͷ֬ೝ
εΫϦʔϯ্ͷλοϓͨ͠෦ͷ 30cmલʹ ඈߦػΛஔ͘
30cm εΫϦʔϯλοϓͷ xy࠲ඪऔಘ ϫʔϧυ࠲ඪʹมͯ͠ ͦ͜ʹஔ͘ʂ Χϝϥͷ30cmલʹஔ͘ ϫʔϧυ࠲ඪʹม ᶃ ᶄ ᶅ
εΫϦʔϯ࠲ඪʹม ᶆ ᶄ’ εΫϦʔϯ࠲ඪʹม
ᶃΧϝϥ࠲ඪͰ30cmલʹஔ͘ ϚΠφε 30cm
None
ᶄϫʔϧυ࠲ඪʹม
͋Δ࠲ඪܥ͔Β ͋Δ࠲ඪܥ มͰ͖Δ
ᶄ’εΫϦʔϯ࠲ඪʹม
ϫʔϧυ࠲ඪܥ→εΫϦʔϯ࠲ඪܥ
ᶅεΫϦʔϯλοϓͷxy࠲ඪऔಘ
ᶆϫʔϧυ࠲ඪʹมͯ͠ஔ͘
εΫϦʔϯ࠲ඪܥ→ϫʔϧυ࠲ඪܥ
30cmલ λοϓͨ͠Ґஔ ม ม
ͦΕͧΕɺ߹ͷ͍͍ ࠲ඪܥͰܭࢉ͢Δ
ͪͳΈʹ
εΫϦʔϯ࠲ඪܥ͚ͩ ͰશͯΛදݱͰ͖Δ
εΫϦʔϯλοϓͷ xy࠲ඪऔಘ ϫʔϧυ࠲ඪʹมͯ͠ ͦ͜ʹஔ͘ʂ Χϝϥͷ30cmલʹஔ͘ ϫʔϧυ࠲ඪʹม ᶃ ᶄ ᶅ εΫϦʔϯ࠲ඪʹม
ᶆ ᶄ’ εΫϦʔϯ࠲ඪʹม ͜͜ল͚Δ 30cm
͜͜ল͚Δ
ͬͪ͜ͷํָ͕͡ΌΜʂ
͔ͨ͠ʹ
͜ͷ͍ίʔυͰߦ͚Δ
None
Ͱ
࣮
͜ͷ0.996 Χϝϥ࠲ඪܥͷ0.3mͱ ಉ͡ҙຯ
0.996ͱ
͜͜Ͱ࠲ඪܥͷ෮श
0.0 1.0 εΫϦʔϯ࠲ඪܥͷ z 0.001m 1000m Χϝϥ࠲ඪܥͷ z
εΫϦʔϯ࠲ඪܥͷz
https://developer.apple.com/documentation/scenekit/scnscenerenderer/1522631-unprojectpoint εΫϦʔϯ࠲ඪܥͷ z0.0~1.0
Χϝϥ࠲ඪܥͷzʁ
None
None
None
debugͯ͠ΈΔͱ
None
zNearΛ มԽͤͯ͞ΈΑ͏
None
0.0 1.0 εΫϦʔϯ࠲ඪܥͷ z 0.001m 1000m Χϝϥ࠲ඪܥͷ z
εΫϦʔϯ࠲ඪͷz vs Χϝϥ࠲ඪͷ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...
࣮ʹ໘͍͘͞
͜͜ল͚Δʂʁ
ඞཁʂ
ͱ͍͏͜ͱͰ
࠲ඪมΛۦͯ͠
None
ʂ
͏ͪΐ͍ͬͯΈ·͠ΐ͏ʂ
ඈߦػΛ֦େͨ͠Γɺ ճసͤ͞Α͏ʂ
֦େɾॖখ
ճస (SCNVector4) ࣠ ֯
ճస(Euler angle)
ճస (Euler angle) x
ճస (Euler angle) Y
ճస (Euler angle) Z
x Y Z
Ҏ্
͜͜·Ͱ͕ࢉ
·ֶ͕ͩ͋Γ·͢ɻ
Ͱ
࠲ඪͷ֓೦Λཧղͯ͠ SceneKitARKitΛ ͍͜ͳͤΕྑ͍ɻ
ֶʹ͍ͭͯQiitaͰɻ
ARKitͷͨΊͷ 3D ֶ
ࠂ
Graffity Inc. ΤϯδχΞืूதʂ
࠷ޙʹ
ݸਓͰARKitͷಈըڭࡐ࡞த
One More Thing
ࠓΓ·͢ .kt
ے.kt w :BIPP-PEHF w ݄
͓ΘΓ