LoginSignup
0
0

More than 5 years have passed since last update.

【Oculus Go】コントローラからレーザーポインタを表示する

Last updated at Posted at 2019-01-20

はじめに

Oculus Goのコントローラからレーザーポインタを表示するサンプルを動かしてみます。

準備

手順

1. レーザーポイント用のオブジェクトの追加

Hierarchy上で「Create Empty」を追加し、オブジェクト名を「Selection Visualizer」とする。

1.png

2. Line Rendererの追加

Selection Visualizerのコンポーネントに「Line Renderer」を追加する。

linerender.png

インスペクタで、設定を以下のように変更する。

項目名
Cast Shadows off
Receive Shadows off
Width 0.020

2.png

ラインレンダラーの詳細はこちら

3. レーザーポインタの先端用のオブジェクトの追加

SelectionVisualizer上で、「Sphere」を追加する。

5.png

scaleのx,y,zのscaleを0.05に変更する。

スクリーンショット 2019-01-20 13.27.29.png

4. OVRPointerVisualizerの追加

Selection Visualizerのコンポーネントに「OVRPointerVisualizer」を追加する。

スクリーンショット 2019-01-20 12.47.37.png

インスペクタで、設定を以下のように変更する。

項目名
Tracking Space OVRCameraRig > TrackingSpace
Line Pointer Selection Visualizer
Gaze Pointer Selection Viualizer > Shpere

スクリーンショット 2019-01-20 13.29.38.png

動作確認

無事、レーザポインタが表示されました。

screenshot-1547956236509.jpg

(おまけ)レーザーの色を変更する。

MaterialsのElement0を変更すると、色を変更できるようです。

スクリーンショット 2019-01-20 13.42.13.png

screenshot-1547959436262.jpg

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0