$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ARKitのための3D算数
Search
KBOY
August 30, 2018
Programming
3
4.4k
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
52
iOS15から使えるScreenTimeAPIをFlutterアプリで動かす
fujikawakei
0
110
FlutterエンジニアがFlutterFlowを使ってみた感想
fujikawakei
0
120
Flutterと課金
fujikawakei
0
110
【スタートアップ開発者必見】firebaseとalgoliaとstripeで1人で本格的なiOSアプリを作る方法
fujikawakei
2
530
ARCore-Kotlin-Sampler作ってきました
fujikawakei
0
230
Basic 3D Math for ARKit
fujikawakei
1
640
ARKitでお絵かきする方法2選
fujikawakei
0
1.7k
assertion を積極的に使って 役立った話
fujikawakei
0
1.9k
Other Decks in Programming
See All in Programming
Cognitoが大型アップデート!Managed Loginとパスワードレスログインを実際に使ってみた@しむそくRadio Special Day1
tmhirai
3
210
Symfony Mapper Component
soyuka
2
360
[KR] Open-Source Ecosystems
skydoves
0
110
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
210
PipeCDの歩き方
kuro_kurorrr
4
140
Gestaltung digitaler Lösungen – Produktions- oder Designprozess?
techstories
0
120
Remix on Hono on Cloudflare Workers
yusukebe
2
390
Reckoner における Datadog Browser Test の活用事例 / Datadog Browser Test at Reckoner
nomadblacky
0
190
かんたんデザイン編集やってみた~「完全に理解した」までの道のり~
morit4ryo
1
110
[FlutterKaigi2024] Effective Form 〜Flutterによる複雑なフォーム開発の実践〜
chocoyama
1
3.9k
我々のデザインシステムは Chakra v3 にアップデートします
shunya078
2
2.7k
Criando Commits Incríveis no Git
marcelgsantos
1
120
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Six Lessons from altMBA
skipperchong
27
3.5k
Fireside Chat
paigeccino
34
3.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
GraphQLとの向き合い方2022年版
quramy
44
13k
Navigating Team Friction
lara
183
15k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.8k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
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 ݄
͓ΘΓ