1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

いつでも現実逃避できる!自分で撮影した思い出の360度VR空間に逃げる方法の作り方。

Last updated at Posted at 2022-05-11

Unityで撮影した360度画像のVR環境を自作する

自分で撮影した360度画像でVR空間を作るためのナレッジをまとめました。
これでいつでも自分が撮影した思い出の360度空間に現実逃避することが可能です!
ぜひ思い出のシーンを360度カメラで撮影し、いつでもその空間に逃げられる準備を整えてください。

全体像

今回実装する全体像は以下の通り
Image from Gyazo
① 動画を流すためのVideoPlayerObject
このObject内に、流す動画データ(360Movie)とその動画を映すスクリーン(360 Render Texture)を設定
② 360度空間を実装するためのSkyBox Material Object
このSkyBox内に先ほどの動画が描出されるスクリーン(360RenderTexture)を貼り付けることで、360Movieが流れる360空間(360SkyBox)が作成される。
③ Main Camera Objectに360度空間を貼り付ける
360空間(360SkyBox)を見るために、360SkyBoxをアタッチする。

環境

Unityのvaesionは、2020.3.26f1を使用

VideoPlayerObjectの作成

まずは映し出すスクリーンであるRender Textureを作成する。
Image from Gyazo
Assets内にTexturesフォルダを作成し、その中にRender Texture(360RenderTexture)をCreateする。

Image from Gyazo
作成したRender Textureは上記の様に設定。

Image from Gyazo
次にヒエラルキー上にVideo Player Objectを作成し、360VideoPlayerと命名。

Image from Gyazo
作成した360VideoPlayerにオリジナルの360度動画と先ほど作成した360RenderTextureをアタッチ。

SkyBox Material Objectの作成

Image from Gyazo
Aseetes内にMaterialsフォルダを作成し、その中にMaterial(360Material)をCreateする。

Image from Gyazo
ShaderをSkybox/Panoramicに変更し、Sphericalの360RenderTextureをアタッチする。

##  Main Camera Objectの作成
Image from Gyazo
ヒエラルキー上のMain CameraにSkybox ComponentをAddする。

実装

上記のような感じで、自分で撮影した360度画像でVR空間を実装できます。

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?