[Unity3D self-study record] making VR video player

Recently, VR is popular, but overall, panoramic pictures and panoramic videos have the most VR resources. Today, I will briefly introduce how to use Unity to make a simple VR video player. First find the EasyMovieTexture plug-in, AssetStore address: https://www.assetstore.unity3d.com/en/#!/content/10032 After importing , you can see the following scene in the project directory. This time we are using Demo_Sphere. After opening, you can see that there is only one MainCamera and one Sphere in the scene. This Spere is the sphere we want to use to play the video. Next, import the SDK of GoogleCardBoard (it is recommended to download the latest version). Official website address (need to go over the wall): https://developers.google.com/cardboard/unity/download (Long-lost Chinese, so moved) Find Prefabs in the Cardboard folder, drag CardboardHead into the scene, return the position and rotation to 0, and delete the original MainCamera in the scene. Now, when you find Sphere, you can see that the MediaCtrl script is hung on it, where strFileName is the path of the video, put your VR video into the StreamingAssets folder, fill in the file name, and put it on your phone to run it~ At the same time, benefiting from the powerful functions of EasyMovieTexture, the video path supports video URL links and streaming media playback, everyone is blessed! To play different videos, you only need to pass in the corresponding address according to the user's selection of videos.







 





 






 





      



 









 
(请忽略大长腿,随便用一下)

Guess you like

Origin blog.csdn.net/hackdjh/article/details/51895400