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
80
徳丸本 ログインフォーム
mcz9mm
0
97
徳丸本8
mcz9mm
0
110
徳丸最終回
mcz9mm
0
73
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
169
14k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
GraphQLとの向き合い方2022年版
quramy
43
13k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
4 Signs Your Business is Dying
shpigford
180
21k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Done Done
chrislema
181
16k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Speed Design
sergeychernyshev
25
620
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
A Philosophy of Restraint
colly
203
16k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
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(ਂ)Λݕग़ • ฏ໘͚ͩͰͳ͘إͷҐஔͱ͖Λݕग़͢Δ • ೝࣝͰ͖Δͷ̍ਓͷΈ(ෳΧϝϥʹ͍ࣸͬͯΔ
߹࠷ਫ਼͕ྑ͍ͷ͕ݕग़͞ΕΔ)