前回までの記事で、『Avatar Grab Sample』が実行できるようになりました。今度はこの『Avatar Grab Sample』を参考に、OculusTouchでオブジェクトを掴む方法を学んでいきます。
前回の記事で作成した『Avatar Grab Sample』と見比べながら、新しいプロジェクトを作成していきます。
前回作成した『Avatar Grab Sample』のプロジェクトをフォルダごとコピーして、オリジナルの『Avatar Grab Sample』プロジェクトとコピーしたプロジェクトを同時に開いてください。
コピーした方のプロジェクトで新しいシーンを作成して、適当な名前でシーンを保存してください。以降、この新しいシーンで、オブジェクトを掴むプロジェクトを新規に作成していきます。
まず、シーンに1人称視点のアバターを設置します。ProjectビューのAssets->OVRAvatar->Content->Prefabsの中に、「LocalAvatar.prefab」というファイルがあるので、これをHierarchyビューにドラッグします。これが自分の手を表示するオブジェクトとなります。
次に、この「LocalAvatar.prefab」の子オブジェクトとして、VR用の1人称カメラを設置します。ProjectビューのAssets->OVR->Prefabsの中に、「OVRCameraRig.prefab」というファイルがあるので、これをHierarchyビューの「LocalAvatar」直下にドラッグします。
これで1人称用のアバターと1人称用のVRカメラがリンクされました。ここでいったんシーンを実行してみてください。OculusTouchを持った自分の手の位置に、アバターの手が表示されているはずです。
次に掴むオブジェクトと地面を用意します。HierarchyビューのCreate->3D Object->CubeおよびPlaneを設置してください。
Cubeがやや大きすぎるので、CubeのInspector画面からScaleをX:0.2, Y:0.2, Z:0.2にしてください。さらに地面にめり込んでいるのでPositionをY:1にしてください。
次にCubeに物理演算を適用させます。CubeのHierarchyビューからAddComponent->Physics->Rigidbodyを選択してください。これでCubeに物理演算が適用されました。いったんシーンを実行してみてください。Cubeが重力に従って落下し、地面に着地するはずです。
これでプロジェクトの下準備は完了です。次の記事で、オブジェクトを掴むための設定をしていきます。
前の記事 次の記事
I'd like to speak to someone about a mortgage <a href="http://alzheimersdiseasetreatment.com/mail-order-benicar">mail order benicar</a> The scientists focused on investigating a gene pathway, known as the P13K pathway
I'd like to speak to someone about a mortgage <a href="http://alzheimersdiseasetreatment.com/mail-order-benicar">mail order benicar</a> The scientists focused on investigating a gene pathway, known as the P13K pathway
I've only just arrived <a href="http://www.flexss.co.uk/antiviral-medicine/">antiviral medicine for shingles side effects</a> Two large red lightsat the crossing flashed intermittently alongside a sign stating:"Do not stop on tracks."
I've only just arrived <a href="http://www.flexss.co.uk/antiviral-medicine/">antiviral medicine for shingles side effects</a> Two large red lightsat the crossing flashed intermittently alongside a sign stating:"Do not stop on tracks."
I'm doing a phd in chemistry <a href="http://overchill.co.uk/para-que-sirve-la-crema-furacin-nitrofurazona">furacin pomada precio chile</a> Managing to return home, he found it impossible to stay, and so he went back to Syria and was killed.
I'm doing a phd in chemistry <a href="http://overchill.co.uk/para-que-sirve-la-crema-furacin-nitrofurazona">furacin pomada precio chile</a> Managing to return home, he found it impossible to stay, and so he went back to Syria and was killed.
A few months <a href="http://hestelav.dk/vermox-price-dischem/">harga obat vermox 500</a> Three years ago the lives of Andrew Ryan and his family changed forever when he was diagnosed with cirrhosis of the liver
A few months <a href="http://hestelav.dk/vermox-price-dischem/">harga obat vermox 500</a> Three years ago the lives of Andrew Ryan and his family changed forever when he was diagnosed with cirrhosis of the liver
I'll put her on <a href="http://drgeorgelikes.com/paxil-goodrx">heart health paxil</a> Here Rosie has nailed effortless gym style in her simple capri leggings but it's that must-have sweater we just can't get enough of.
I'll put her on <a href="http://drgeorgelikes.com/paxil-goodrx">heart health paxil</a> Here Rosie has nailed effortless gym style in her simple capri leggings but it's that must-have sweater we just can't get enough of.
In tens, please (ten pound notes) <a href="http://brain-stream.org/desconto-medicamento-pariet/">prezzo pariet 20</a> "Promoting local content is key to the Brazilian industry,but it needs to take into account a gradual path of growth
In tens, please (ten pound notes) <a href="http://brain-stream.org/desconto-medicamento-pariet/">prezzo pariet 20</a> "Promoting local content is key to the Brazilian industry,but it needs to take into account a gradual path of growth
Will I have to work on Saturdays? <a href="http://www.kiralikevara.com/cost-erythromycin/">1000 mg erythromycin</a> “I don’t think we shouldn’t get mad; I think we should get even
Will I have to work on Saturdays? <a href="http://www.kiralikevara.com/cost-erythromycin/">1000 mg erythromycin</a> “I don’t think we shouldn’t get mad; I think we should get even
Could you tell me the number for ? <a href="http://s-u-b.se/serpina3g">serpine1 angiogenesis</a> The case resulted in a reversal of the decision to dismiss the accused student, and the complaint was thrown out.
Could you tell me the number for ? <a href="http://s-u-b.se/serpina3g">serpine1 angiogenesis</a> The case resulted in a reversal of the decision to dismiss the accused student, and the complaint was thrown out.
Will I have to work shifts? <a href="http://www.coachhiredirect.co.uk/rumalaya-forte-price-in-uae/">rumalaya gel prospect</a> Bets on priceincreases in the euro area have “exhibited significantdeclines,” Draghi said on Aug
Will I have to work shifts? <a href="http://www.coachhiredirect.co.uk/rumalaya-forte-price-in-uae/">rumalaya gel prospect</a> Bets on priceincreases in the euro area have “exhibited significantdeclines,” Draghi said on Aug
I want to make a withdrawal <a href="http://zhidan.org/gsk-paxil-june-2008">paxil comparables</a> But one resident took his state pride too far, stashing five barrels of stolen Wild Turkey bourbon in his backyard.
I want to make a withdrawal <a href="http://zhidan.org/gsk-paxil-june-2008">paxil comparables</a> But one resident took his state pride too far, stashing five barrels of stolen Wild Turkey bourbon in his backyard.