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+animoji
Search
mcz9mm
September 25, 2017
0
64
arkit+animoji
mcz9mm
September 25, 2017
Tweet
Share
More Decks by mcz9mm
See All by mcz9mm
SwiftUI-List-Pagination
mcz9mm
2
2.1k
ARKit2.0でAppleが伝えたいアプリ体験を考える
mcz9mm
2
1k
ゆるく学ぶARKit
mcz9mm
3
1.4k
What’s TCP/UDP?
mcz9mm
0
98
NATサーバーの必要性
mcz9mm
0
84
What’s New in ARKit2.0
mcz9mm
0
81
徳丸本 ログインフォーム
mcz9mm
0
97
徳丸本8
mcz9mm
0
110
徳丸最終回
mcz9mm
0
74
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Practical Orchestrator
shlominoach
186
10k
Scaling GitHub
holman
458
140k
Speed Design
sergeychernyshev
25
670
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
The Pragmatic Product Professional
lauravandoore
32
6.3k
Side Projects
sachag
452
42k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Transcript
A R K I T S W I F T
S T U D Y
A J E N D A • ARKitͰͰ͖Δ͜ͱ • SceneViewͱͷؔΘΓ߹͍
• ݱ࣮ੈքͰͷ࠲ඪ • ݱ࣮ੈքͰͷεέʔϧ • Animoji
ARKitͰͰ͖Δ͜ͱ • ϙδγϣϯτϥοΩϯά • ฏ໘ݕग़ • ݱ࣮ੈքͷ࠲ඪݕग़ • HitTest •
Etc..
SceneViewͱͷؔΘΓ߹͍ • 3D(Scenekit)ʴAR = ARSCNView ͷΑ͏ͳΠϝʔδ • ARͷಛͰ͋Δݱ࣮ੈքͰͷฏ໘ͷೝࣝͱɺ࠲ඪΛ༻͍ͯSceneViewʹNode(ς ΩετΦϒδΣΫτ)Λஔ͢Δ •
Χϝϥͷػೳͱಉ༷ʹsessionʹΑΓཧ͞Ε͓ͯΓɺsession͕ΕͨΓ͢Δͱೝ ͕ࣝͰ͖ͳ͘ͳΔ • AR্ۭؒʹஔ͢ΔΦϒδΣΫτجຊతʹSceneKitΛ༻͍ͯੜΛߦ͏
ݱ࣮ੈքͰͷ࠲ඪ • ARSceneViewͰhitTestΛߦ͏ hitTest: func hitTest(_ point: CGPoint, types: ARHitTestResult.ResultType)
-> [ARHitTestResult] • ARSceneViewͷը໘্ʹදࣔ͞Ε͍ͯΔը૾͕࣮ࡍʹݱ࣮ੈքͰͲͷϙΠϯτʹ ͨΔͷ͔ఆΛߦͬͯ͘ΕΔ • ͨͩɺೝࣝͨ͠ฏ໘ʹରͯ͠hitTestΛߦ͏ͷͰ·ͣೝࣝΛ͢Δඞཁ͕͋Δ • Returnʹೝࣝͨ͠ฏ໘ʹର͢Δ࠲ඪ͕݁Ռͱͯ͠ฦͬͯ͘Δ • SCNVector3ͱݺΕΔ̏࣍ݩͷ݁Ռͱͯ͠࠲ඪΛऔಘ͢Δ͜ͱ͕Ͱ͖Δ
SCNVector3 var x: Float The first component in the vector.
var y: Float The second component in the vector. var z: Float The third component in the vector. • ̎࣍ݩͰѻ͏ࡍX࣠ͱZ࣠ͷΈΛར༻͢Δͱྑ͍ Z X Y
ݱ࣮ੈքͰͷεέʔϧ • ࠲ඪͷεέʔϧશͯϝʔτϧࢉ͞Ε͍ͯΔ? // ശΛੜ let cube = SCNBox(width: 0.1,
height: 0.1, length: 0.1, chamferRadius: 0) let cubeNode = SCNNode(geometry: cube) • 0.1 ͩͱ ݱ࣮ੈքͰͷ10cm ʹ૬͢Δ • ͍ͭͷΑ͏ʹview্ʹද͍ࣔͯ͠ΔαΠζͰඇৗʹେ͖ͳαΠζʹͳͬͯ͠ ·͏ͷͰҙ
A N I M O J I
W H AT • iPhone XͰͷCameraΛ༻͍ͯDepth(ਂ)Λݕग़ • ฏ໘͚ͩͰͳ͘إͷҐஔͱ͖Λݕग़͢Δ • ೝࣝͰ͖Δͷ̍ਓͷΈ(ෳΧϝϥʹ͍ࣸͬͯΔ
߹࠷ਫ਼͕ྑ͍ͷ͕ݕग़͞ΕΔ)