SlideShare uma empresa Scribd logo
1 de 14
iPhone XでFace Trackingして
VRMのモデルを動かす
kawasaki.rb #060 LT
Ryosuke Akiyama (@kechako)
自己紹介
• 名前:秋山 亮介
• 最近使ってる言語:Go言語、C#(最近Ruby使ってない……)
• GitHub、Twitter:@kechako
iPhone XでFace Trackingして
VRMのモデルを動かしたかった
kawasaki.rb #060 LT
Ryosuke Akiyama (@kechako)
安心してください
デモはあります!
ARKitとは
• iOS11以降に標準搭載されたARアプリフレームワーク
• iPhone XのTrueDepthカメラに対応している
• TrueDepthカメラを使うと、ユーザーの顔の位置や表情を正確にリアルタ
イムで取得できる
UnityでARKitを使う
• Unity ARKit Pluginをインポートする
• Unity ARKit PluginはAssetStoreにて公開されている
• https://assetstore.unity.com/packages/essentials/tutorial-projects/unity-
arkit-plugin-92515
ARKitによる表情の取得
using UnityEngine.XR.iOS;
var session = UnityARSessionNativeInterface.GetARSessionNativeInterface();
var config = new ARKitFaceTrackingConfiguration();
session.RunWithConfig(config);
UnityARSessionNativeInterface.ARFaceAnchorAddedEvent += FaceAdded;
UnityARSessionNativeInterface.ARFaceAnchorUpdatedEvent += FaceUpdated;
UnityARSessionNativeInterface.ARFaceAnchorRemovedEvent += FaceRemoved;
ARKitによる表情の取得
void FaceUpdated(ARFaceAnchor anchorData)
{
var faceRotation = UnityARMatrixOps.GetRotation(anchorData.transform);
var cameraPose = UnityARSessionNativeInterface.GetARSessionNativeInterface().GetCameraPose();
var cameraRotation = UnityARMatrixOps.GetRotation(cameraPose);
var faceAngle = (faceRotation.eulerAngles - cameraRotation.eulerAngles);
var blendShapes = anchorData.blendShapes;
var eyeBlinkLeft = blendShapes[ARBlendShapeLocation.EyeBlinkLeft];
var eyeBlinkRight = blendShapes[ARBlendShapeLocation.EyeBlinkRight];
// ....
}
ARKitによる表情の取得
https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928261-eyeblinkleft
VRMとは
• VRアプリケーション向けの人型3Dアバターデータを扱うためのフォーマ
ット
• glTF2.0をベースにしている
• ドワンゴ社が開発
• モデリングツールによる作法の違いや複雑な仕様、アバターとして使用す
る観点で不足しているパラメーター等を補う目的で開発された
• https://dwango.github.io/vrm/
VRMをUnityで表示する
• UniVRMはVRMをUnityでインポート・エクスポートするためのUnity
package
• https://github.com/dwango/UniVRM
• UniVRMをUnityプロジェクトにインポートし、VRMファイルをUnityにド
ラッグ&ドロップすることで、ModelのPrefabが生成される
• あとはPrefabをシーンに配置するだけ
モデルの表情を動かす
var proxy = this.GetComponent<VRMBlendShapeProxy>();
proxy.SetValue(BlendShapePreset.Blink_L, eyeBlinkLeft);
proxy.SetValue(BlendShapePreset.Blink_R, eyeBlinkRight);
デモ
Links
• Unity ARKit Plugin
• https://assetstore.unity.com/packages/essentials/tutorial-projects/unity-arkit-
plugin-92515
• UniVRM
• https://github.com/dwango/UniVRM/releases
• ニコニ立体ちゃん
• http://3d.nicovideo.jp/works/td32797

Mais conteúdo relacionado

Destaque

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destaque (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

iPhone XでFace TrackingしてVRMのモデルを動かす