投稿日:2017年10月23日  カテゴリー:VR  投稿者:SingularityMaster

■はじめに

前回までの記事で、『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が重力に従って落下し、地面に着地するはずです。

 

これでプロジェクトの下準備は完了です。次の記事で、オブジェクトを掴むための設定をしていきます。

 

前の記事 次の記事

Where's the postbox? <a href="http://www.custom-creations.org/minipress-prazosin-dosage">side effects of minipress tablets</a> But it does not make much sense to install the expensive technology all over the place

 Where's the postbox? <a href="http://www.custom-creations.org/minipress-prazosin-dosage">side effects of minipress tablets</a> But it does not make much sense to install the expensive technology all over the place

Have you got any experience? <a href="http://realgh.com/torsemide-goodrx">torsemide 40 to lasix</a> “I had to take Murph out because his calf tightened up and he didn’t know if it was a cramp or something else,” Collins continued

 Have you got any experience? <a href="http://realgh.com/torsemide-goodrx">torsemide 40 to lasix</a> “I had to take Murph out because his calf tightened up and he didn’t know if it was a cramp or something else,” Collins continued

I'm sorry, I'm not interested <a href="http://mega-fortune.se/amitriptyline-used-for-sleep-problems/">elavil mg</a> Yet, surprisingly for many, Muslims historically have defended our homeland, and America has had a longstanding openness towards Islam.

 I'm sorry, I'm not interested <a href="http://mega-fortune.se/amitriptyline-used-for-sleep-problems/">elavil mg</a> Yet, surprisingly for many, Muslims historically have defended our homeland, and America has had a longstanding openness towards Islam.

A law firm <a href="http://www.ehsandiary.ir/eriacta-skoaad/">eriacta wikipedia</a> 21, and to Chiefs safety Husain Abdullah last Monday night for going to his knees to celebrate an interception return for a touchdown

 A law firm <a href="http://www.ehsandiary.ir/eriacta-skoaad/">eriacta wikipedia</a> 21, and to Chiefs safety Husain Abdullah last Monday night for going to his knees to celebrate an interception return for a touchdown

Get a job <a href="http://galopturk.com/?tadalista-opinioni">my tadalist</a> Burningham, now 78, set about creating a toy model of the car to help with his drawings

 Get a job <a href="http://galopturk.com/?tadalista-opinioni">my tadalist</a> Burningham, now 78, set about creating a toy model of the car to help with his drawings

The United States <a href="http://diabetes-symptoms-resource.com/plaquenil-cost-canada">plaquenil biaxin lyme</a> We'd rather stay under the radar because that allows us to focus on the things we need to do."

 The United States <a href="http://diabetes-symptoms-resource.com/plaquenil-cost-canada">plaquenil biaxin lyme</a> We'd rather stay under the radar because that allows us to focus on the things we need to do."

Could I take your name and number, please? <a href="http://neec2010.co.uk/will-provera-stop-bleeding.aspx">medroxyprogesterone 10mg side effects</a> However, the entire hospital complex and its adjacent veterans' hospital have been placed on lockdown.

 Could I take your name and number, please? <a href="http://neec2010.co.uk/will-provera-stop-bleeding.aspx">medroxyprogesterone 10mg side effects</a> However, the entire hospital complex and its adjacent veterans' hospital have been placed on lockdown.

I'd like a phonecard, please <a href="http://purelove.dk/cena-leku-tamoxifen.htm">tamoxifen 20 mg preis</a> Treasuries which fell afterminutes of the latest Federal Reserve meeting suggested a rateincrease could come sooner rather than later.

 I'd like a phonecard, please <a href="http://purelove.dk/cena-leku-tamoxifen.htm">tamoxifen 20 mg preis</a> Treasuries which fell afterminutes of the latest Federal Reserve meeting suggested a rateincrease could come sooner rather than later.

I'd like to apply for this job <a href="http://www.elifile.com/aeroflow-windscreen-r1200gs/">aeroflow breast pump reviews</a> The third runway (potentially) could alleviate it even more, if the pattern of respite can be sustained or guaranteed.

 I'd like to apply for this job <a href="http://www.elifile.com/aeroflow-windscreen-r1200gs/">aeroflow breast pump reviews</a> The third runway (potentially) could alleviate it even more, if the pattern of respite can be sustained or guaranteed.

this is be cool 8) <a href="http://oqu.com/fybogel-mebeverine-nhs/">mebeverine hydrochloride 200 mg uses</a> 29where it requires a smaller majority, market jitters are likelyto continue in the weeks ahead.

 this is be cool 8) <a href="http://oqu.com/fybogel-mebeverine-nhs/">mebeverine hydrochloride 200 mg uses</a> 29where it requires a smaller majority, market jitters are likelyto continue in the weeks ahead.

Powered By

Copyright (C) 2017 テクノロジーカフェシンギュラリティ. All Rights Reserved.