2019年3月19日 星期二

Week 05 吳幸俞

今天一開始老師介紹了「Theta 360]這款360度的攝影機

先上網安裝軟體,上網搜尋「Theta PC]後進到網站,安裝下面兩個軟體,就能使用了,其中一個是在PC上瀏覽拍攝的相片跟影片、另一個是將拍攝後的照片、影片轉換成一般能正常拉動鏡頭的360度版本

下圖是未經過轉檔的畫面

接著將老師給的360度圖片放進Unity裡面,新增一個Material選Skybox再選Panoramic,之後將圖片套用到Material上後直接丟到場景就好


接下來要做3D的聲音,上網下載一個音檔,並在Unity中創建一個Cube,將音檔套用上去,接著新增一個Script,打上以下程式碼並套用在Cube上,然後將Cube拉到Script的public GameObject上,之後播放就能看到Cube繞著Camera轉動了
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MovingSound : MonoBehaviour
{
public GameObject cube;

float angle=0;
float len=13;
// Start is called before the first frame update
void Start()
{
}

// Update is called once per frame
void Update()
{
cube.transform.transform.position=new Vector3(len*Mathf.Cos(angle),1,len*Mathf.Sin(angle));
angle+=0.01f;
}
}

沒有留言:

張貼留言