前回までの記事で、『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 open a business account <a href="http://cityweddings.co.uk/buy-revia-india/">reviance</a> This would, he says, take a wider, longer-term look at the situation facing the whole UK.
I'd like to open a business account <a href="http://cityweddings.co.uk/buy-revia-india/">reviance</a> This would, he says, take a wider, longer-term look at the situation facing the whole UK.
Do you need a work permit? <a href="http://heleneburrow.co.uk/precio-de-danazol-en-colombia">danazol goodrx</a> Previous research shows that about half of all falls among older people happen when they're outside
Do you need a work permit? <a href="http://heleneburrow.co.uk/precio-de-danazol-en-colombia">danazol goodrx</a> Previous research shows that about half of all falls among older people happen when they're outside
Nice to meet you <a href="http://www.eidon.se/order-ampicillin/">a href purchase ampicillin</a> If politicians can attack this issue with integrity they will find the majority of people are on their side.”
Nice to meet you <a href="http://www.eidon.se/order-ampicillin/">a href purchase ampicillin</a> If politicians can attack this issue with integrity they will find the majority of people are on their side.”
Have you seen any good films recently? <a href="http://www.emlv.org/lioresal-10-mg">baclofen 5mg/5ml oral solution</a> Just team yours with leather trousers and hi top trainers to complete Cara's signature style.
Have you seen any good films recently? <a href="http://www.emlv.org/lioresal-10-mg">baclofen 5mg/5ml oral solution</a> Just team yours with leather trousers and hi top trainers to complete Cara's signature style.
Which year are you in? <a href="http://studentfinanceadvisor.co.uk/price-of-tadacip">tadacip cipla</a> She is currently based in London, where she is a regional director for a mobile technology firm.
Which year are you in? <a href="http://studentfinanceadvisor.co.uk/price-of-tadacip">tadacip cipla</a> She is currently based in London, where she is a regional director for a mobile technology firm.
I'd like to take the job <a href="http://www.highlandera-z.co.uk/tadora-20-dosage.htm">precio computadoras vit de escritorio</a> Abu Sahman is head of the General National Congress (GNC), the rival parliament based in Tripoli.
I'd like to take the job <a href="http://www.highlandera-z.co.uk/tadora-20-dosage.htm">precio computadoras vit de escritorio</a> Abu Sahman is head of the General National Congress (GNC), the rival parliament based in Tripoli.
History <a href="http://www.custom-creations.org/moduretic-prescribing-information">moduretic precio colombia</a> That's a valuable piece of information that will help you make the finaldecision.
History <a href="http://www.custom-creations.org/moduretic-prescribing-information">moduretic precio colombia</a> That's a valuable piece of information that will help you make the finaldecision.
Get a job <a href="http://gokceksifa.com.tr/erythromycin-500mg-uses">erythromycine lotion sans ordonnance</a> "Sometimes you want to win so badly that you try too much to get the results, and it's not gonna help you
Get a job <a href="http://gokceksifa.com.tr/erythromycin-500mg-uses">erythromycine lotion sans ordonnance</a> "Sometimes you want to win so badly that you try too much to get the results, and it's not gonna help you
I like watching football <a href="http://www.caaj.ir/buy-antabuse-australia/">effectiveness of antabuse</a> One saleswoman thrust plastic trays of moose meat at passers-by: a national alternative, perhaps, to prosciutto
I like watching football <a href="http://www.caaj.ir/buy-antabuse-australia/">effectiveness of antabuse</a> One saleswoman thrust plastic trays of moose meat at passers-by: a national alternative, perhaps, to prosciutto
I'm a partner in <a href="http://zhidan.org/how-long-does-bactrim-take-to-clear-acne">bactrim caused yeast infection</a> She says though, if the offer is right, she would like to spend a season back on stage, preferably in London:
I'm a partner in <a href="http://zhidan.org/how-long-does-bactrim-take-to-clear-acne">bactrim caused yeast infection</a> She says though, if the offer is right, she would like to spend a season back on stage, preferably in London: