LoginSignup
1
2

More than 1 year has passed since last update.

Unityを利用してthree.js用のパノラマ画像を作成する

Last updated at Posted at 2021-08-06

VRツアーをthree.jsで作成しようとサンプル素材を探したところ
1フロア各所のパノラマ画像が全然なく
Unityを利用してパノラマ画像を作成しました

インストール

Unity2020.3
Unity Recorderをpackageから
部屋のアセットを購入、インポート

シーン設定

ライティングやマテリアルの設定で何度も録画するため、
タグ機能を使い複数の場所を同時に出力できるようにする
タグをr1 - r7までつくり
カメラの複製、位置移動、タグ設定を繰り返す
camera.png

Unity Recorder設定

rec.png

Recording Mode -> Single Frame
Capture
Source -> 360 View
Camera -> TaggedCamera
Tag -> r1 *
Output File
File Name -> r1 *

Add Recorderで、追加して*部分を割当

Recordしてファイル生成

render.png

three.jsに埋め込み

コードは、公式サンプルの https://threejs.org/examples/webgl_panorama_equirectangular.html を参考

テクスチャのパスだけ変えて

webgl_panorama_equirectangular.html
const texture = new THREE.TextureLoader().load( 'textures/r1.jpg' );

ブラウザで確認

gif

つづき

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